Atum REST API Python API Docs | dltHub

Build a Atum REST API-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.

Last updated:

Atum is a WooCommerce/WordPress plugin exposing inventory and stock‑management endpoints (ATUM REST API) for programmatic access to ATUM resources via the WooCommerce REST API (wc/v3). The REST API base URL is https://{your_store_domain}/wp-json/wc/v3 and HTTP Basic Auth using WooCommerce REST API consumer key and secret (or consumer_key/consumer_secret query params)..

dlt is an open-source Python library that handles authentication, pagination, and schema evolution automatically. dlthub provides AI context files that enable code assistants to generate production-ready pipelines. Install with uv pip install "dlt[workspace]" and start loading Atum REST API data in under 10 minutes.


What data can I load from Atum REST API?

Here are some of the endpoints you can load from Atum REST API:

ResourceEndpointMethodData selectorDescription
purchase_ordersatum/purchase-ordersGETList all purchase orders (supports pagination and filters such as page, per_page, after, before, search)
purchase_orders_detailatum/purchase-orders/{id}GETRetrieve a single purchase order by ID
inventoriesatum/inventoriesGETList all inventories
inbound_stockatum/inbound-stockGETList all inbound stock records
addonsatum/addonsGETList ATUM add‑ons (returns top‑level JSON array)
dashboardatum/dashboardGETList dashboard widgets (returns top‑level array of widget objects)
dashboard_ordersatum/dashboard/ordersGETRetrieve orders widget data (returns top‑level array)
suppliersatum/suppliersGETList suppliers
toolsatum/toolsGETList tools

How do I authenticate with the Atum REST API API?

Authenticate over HTTPS using HTTP Basic Auth: provide the REST API Consumer Key as username and Consumer Secret as password (curl: -u consumer_key:consumer_secret). If server strips Authorization header, pass consumer_key and consumer_secret as query string parameters.

1. Get your credentials

  1. In your WordPress admin go to WooCommerce > Settings > Advanced > REST API.
  2. Click 'Add key' (or the equivalent).
  3. Enter a description, select the user, and choose permissions (read or read/write).
  4. Save to generate Consumer Key and Consumer Secret.
  5. Use Consumer Key as username and Consumer Secret as password for requests.

2. Add them to .dlt/secrets.toml

[sources.atum_rest_api_source] consumer_key = "ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" consumer_secret = "cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

dlt reads this automatically at runtime — never hardcode tokens in your pipeline script. For production environments, see setting up credentials with dlt for environment variable and vault-based options.


How do I set up and run the pipeline?

Set up a virtual environment and install dlt:

uv venv && source .venv/bin/activate uv pip install "dlt[workspace]"

1. Install the dlt AI Workbench:

dlt ai init --agent <your-agent> # <agent>: claude | cursor | codex

This installs project rules, a secrets management skill, appropriate ignore files, and configures the dlt MCP server for your agent. Learn more →

2. Install the rest-api-pipeline toolkit:

dlt ai toolkit rest-api-pipeline install

This loads the skills and context about dlt the agent uses to build the pipeline iteratively, efficiently, and safely. The agent uses MCP tools to inspect credentials — it never needs to read your secrets.toml directly. Learn more →

3. Start LLM-assisted coding:

Use /find-source to load data from the Atum REST API API into DuckDB.

The rest-api-pipeline toolkit takes over from here — it reads relevant API documentation, presents you with options for which endpoints to load, and follows a structured workflow to scaffold, debug, and validate the pipeline step by step.

4. Run the pipeline:

python atum_rest_api_pipeline.py

If everything is configured correctly, you'll see output like this:

Pipeline atum_rest_api_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset atum_rest_api_data The duckdb destination used duckdb:/atum_rest_api.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs

Inspect your pipeline and data:

dlt pipeline atum_rest_api_pipeline show

This opens the Pipeline Dashboard where you can verify pipeline state, load metrics, schema (tables, columns, types), and query the loaded data directly.


Python pipeline example

This example loads purchase_orders and inventories from the Atum REST API API into DuckDB. It mirrors the endpoint and data selector configuration from the table above:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def atum_rest_api_source(consumer_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://{your_store_domain}/wp-json/wc/v3", "auth": { "type": "http_basic", "consumer_key": consumer_key, }, }, "resources": [ {"name": "purchase_orders", "endpoint": {"path": "atum/purchase-orders"}}, {"name": "inventories", "endpoint": {"path": "atum/inventories"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="atum_rest_api_pipeline", destination="duckdb", dataset_name="atum_rest_api_data", ) load_info = pipeline.run(atum_rest_api_source()) print(load_info)

To add more endpoints, append entries from the resource table to the "resources" list using the same name, path, and data_selector pattern.


How do I query the loaded data?

Once the pipeline runs, dlt creates one table per resource. You can query with Python or SQL.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("atum_rest_api_pipeline").dataset() sessions_df = data.purchase_orders.df() print(sessions_df.head())

SQL (DuckDB example):

SELECT * FROM atum_rest_api_data.purchase_orders LIMIT 10;

In a marimo or Jupyter notebook:

import dlt data = dlt.pipeline("atum_rest_api_pipeline").dataset() data.purchase_orders.df().head()

See how to explore your data in marimo Notebooks and how to query your data in Python with dataset.


What destinations can I load Atum REST API data to?

dlt supports loading into any of these destinations — only the destination parameter changes:

DestinationExample value
DuckDB (local, default)"duckdb"
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Change the destination in dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. See the full destinations list.


Troubleshooting

Authentication failures

Ensure you use the Consumer Key as username and Consumer Secret as password over HTTPS. If you receive "Consumer key is missing" or 401/403 responses, try using query‑string authentication (append consumer_key and consumer_secret to the request) — some servers strip Authorization headers.

Pagination and large result sets

Many list endpoints support page and per_page query parameters. Default per_page is 10. Use page and per_page to iterate. Watch for server‑imposed maximum per_page limits; use incremental paging to avoid timeouts.

API error format and resource‑not‑found

ATUM/WooCommerce errors return an object with keys code (string), message (string) and data (object with status). Example:

{ "code": "atum_rest_term_invalid", "message": "Resource doesn't exist.", "data": { "status": 404 } }

Ensure that the API key is valid to avoid 401 Unauthorized errors. Also, verify endpoint paths and parameters to avoid 404 Not Found errors.


Next steps

Continue your data engineering journey with the other toolkits of the dltHub AI Workbench:

  • data-exploration — Build custom notebooks, charts, and dashboards for deeper analysis with marimo notebooks.
  • dlthub-runtime — Deploy, schedule, and monitor your pipeline in production.
dlt ai toolkit data-exploration install dlt ai toolkit dlthub-runtime install

Was this page helpful?

Community Hub

Need more dlt context for Atum REST API?

Request dlt skills, commands, AGENT.md files, and AI-native context.