Load Clover data to DuckDB
Build a Clover to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Clover API base URL, auth, endpoints, and incremental loading.
Clover REST API provides merchant-scoped access to inventory, orders, payments, and other merchant-related resources. Everything needed to build a working Clover → DuckDB pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.
Build your Clover to DuckDB pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
PromptRunuvx dlthub-init@latestto build a pipeline from Clover to DuckDB and run it on dltHub
That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the Clover API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →
Prefer to write it yourself? Every fact the agent uses is below.
Clover API at a glance
| Base URL | https://api.clover.com (Production North America); https://api.eu.clover.com (Production Europe); https://api.la.clover.com (Production Latin America); https://apisandbox.dev.clover.com (Sandbox) |
| Example endpoint | GET v3/merchants/{mId}/items |
| Records found at | elements |
| Authentication | all requests require a Bearer token in the Authorization header — sent in the Authorization header, prefixed Bearer |
| Pagination | Cursor-based via starting_after, page size via limit. The Clover REST API uses two distinct pagination strategies depending on the endpoint. Core v3 merchant data endpoints typically use 'limit' and 'offset' (page number/index based). E-commerce and order-related endpoints often use cursor-based pagination with 'starting_after' and 'ending_before' parameters. 'limit' is used across both styles to control the number of results per page. 'has_more' (boolean) is present in cursor-paginated responses to indicate additional pages. |
| Incremental field | modifiedTime |
| Record id | id |
| API reference | https://docs.clover.com/reference |
These values come from the Clover API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Clover API?
Clover REST API uses Bearer token authentication. You must include the 'Authorization' header in your requests with the value 'Bearer {access_token}', where the access token is obtained via OAuth 2.0 or as a merchant-specific API token.
1. Get your credentials
- Log in to the Clover Global Developer Dashboard (sandbox.dev.clover.com or similar). 2. Navigate to your test merchant's Merchant Dashboard. 3. Locate the 'Business Operations' section in the left-hand navigation. 4. Click on 'API tokens'. 5. Select 'Create new token'. 6. Assign a token name and select the necessary permissions for your integration. 7. Click 'Create Token'. Note: Use merchant-specific API tokens only for testing in the sandbox environment; for production, you must use the OAuth 2.0 flow to obtain expiring access tokens using your App ID and App Secret.
2. Add them to .dlt/secrets.toml
[sources.clover_source] clover_api_token = "your_test_merchant_api_token_here" clover_merchant_id = "your_merchant_id_here" clover_app_id = "your_app_id_here" clover_app_secret = "your_app_secret_here"
dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.
What Clover data can I load into DuckDB?
These are the Clover endpoints dlt can load into DuckDB:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| orders | /v3/merchants/{mId}/orders | GET | elements | Retrieves a list of orders for a merchant. |
| inventory_items | /v3/merchants/{mId}/items | GET | elements | Retrieves a list of all inventory items for a merchant. |
| employees | /v3/merchants/{mId}/employees | GET | elements | Retrieves a list of all employees for a merchant. |
| ecommerce_orders | /v1/orders | GET | data | Retrieves a list of e-commerce orders. |
| ecommerce_charges | /v1/charges | GET | data | Retrieves a list of e-commerce charges. |
How do I load only new Clover records?
Clover exposes modifiedTime on v3/merchants/{mId}/items, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.
{"name": "inventory_items", "endpoint": { "path": "v3/merchants/{mId}/items", "data_selector": "elements", "incremental": {"cursor_path": "modifiedTime", "initial_value": "2024-01-01T00:00:00Z"}, }}
On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.
What does the generated Clover pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading /v3/merchants/{mId}/merchants and /v3/merchants/{mId}/orders from the Clover API into DuckDB:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def clover_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.clover.com (Production North America); https://api.eu.clover.com (Production Europe); https://api.la.clover.com (Production Latin America); https://apisandbox.dev.clover.com (Sandbox)", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "inventory_items", "endpoint": {"path": "v3/merchants/{mId}/items", "data_selector": "elements"}}, {"name": "orders", "endpoint": {"path": "v3/merchants/{mId}/orders", "data_selector": "elements"}} ], } yield from rest_api_resources(config) def load_clover_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="clover_pipeline", destination="duckdb", dataset_name="clover_data", ) load_info = pipeline.run(clover_source()) print(load_info) if __name__ == "__main__": load_clover_to_duckdb()
Run it with python clover_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.
How do I query Clover data in DuckDB?
dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.
Python (pandas DataFrame):
import dlt data = dlt.pipeline("clover_pipeline").dataset() df = data.inventory_items.df() print(df.head())
SQL:
SELECT * FROM clover_data.inventory_items LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Clover to DuckDB pipeline in production?
The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.
- Deploy & schedule — run the pipeline as a managed job with automatic retries.
- Monitor — observable job queues, alerting, and load metrics for every run.
- Transform — promote raw Clover loads into governed, documented models.
- Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.
What other destinations can I load Clover data to?
dlt loads into any of these — only the destination argument changes:
| Destination | Example value |
|---|---|
| PostgreSQL | "postgres" |
| BigQuery | "bigquery" |
| Snowflake | "snowflake" |
| Redshift | "redshift" |
| Databricks | "databricks" |
| Filesystem (S3, GCS, Azure) | "filesystem" |
Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.
Next steps
Was this page helpful?
Community Hub
Need more dlt context for Clover to DuckDB?
Request dlt skills, commands, AGENT.md files, and AI-native context.