Load Zuora data to Microsoft SQL Server
Build a Zuora to Microsoft SQL Server pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Zuora API base URL, auth, endpoints, and incremental loading.
Zuora’s v1 REST API provides operations for storefront integration, subscriber and account management, revenue schedules, and manipulation of Zuora object-model resources. Everything needed to build a working Zuora → Microsoft SQL Server 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 Zuora to Microsoft SQL Server pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
uvx dlthub-init@latest to build a pipeline from Zuora to Microsoft SQL Server and run it on dltHubThat 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 Zuora 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.
Zuora API at a glance
| Base URL | https://rest.zuora.com |
| Example endpoint | GET object-query/accounts |
| Records found at | data |
| Authentication | OAuth 2.0 client credentials yielding a Bearer access token — sent in the Authorization header, prefixed Bearer |
| Pagination | Cursor-based via cursor, next cursor at nextPage, page size via pageSize (default 10, max 99). For the partial v1 operations that expose cursor pagination, send pageSize (1–99) and cursor. The response returns nextPage; use its value as the next request's cursor. nextPage is absent when there are no more results. Pagination is operation-specific, so verify that the endpoint documents pageSize and cursor. Other v1 list endpoints use page/pageSize or may expose a nextPage URL instead; do not assume cursor pagination universally. The production base URL is https://rest.zuora.com. Sandbox REST roots are environment-specific, including https://rest.test.zuora.com, https://rest.sandbox.na.zuora.com, https://rest.apisandbox.zuora.com, https://rest.sandbox.eu.zuora.com, https://rest.test.eu.zuora.com, and https://rest.test.ap.zuora.com. OAuth client-credentials token requests use POST /oauth/token with client_id, client_secret, and grant_type=client_credentials. |
| Incremental field | updateddate |
| Record id | id |
| API reference | https://developer.zuora.com/v1-api-reference/introduction |
These values come from the Zuora API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Zuora API?
Obtain a token with POST /oauth/token using Content-Type: application/x-www-form-urlencoded and form fields client_id, client_secret, and grant_type=client_credentials; do not send Authorization or other authentication headers to the token endpoint. Use the returned access_token on subsequent requests as Authorization: Bearer <access_token>. The API reference also documents Accept: application/json for the token request.
1. Get your credentials
- Sign in to the Zuora tenant UI as an administrator or ask your tenant administrator to do this; Zuora states that API credentials are created by the customer’s Zuora administrator. 2. In the Zuora UI, open Administration or Settings, then navigate to Manage OAuth Clients / OAuth Clients (the exact menu label can vary by UI version). 3. Create a new OAuth client, give it a specific descriptive name, and select the Client Credentials grant type if prompted. 4. Click Create and immediately copy the displayed Client ID and Client Secret; Zuora displays the secret only once, so store it in a secrets manager or environment variables. 5. Use the tenant-specific REST base URL. For the requested production configuration use https://rest.zuora.com; sandbox tenants use their corresponding sandbox URL only as a note, such as https://rest.apisandbox.zuora.com, https://rest.sandbox.na.zuora.com, or https://rest.test.zuora.com. 6. Request a bearer token with POST https://rest.zuora.com/oauth/token, using Content-Type application/x-www-form-urlencoded and the fields client_id, client_secret, and grant_type=client_credentials. Do not send an Authorization, apiAccessKeyId, or apiSecretAccessKey header on this token request. 7. Send the returned access_token as Authorization: Bearer on subsequent v1 REST requests. Cache and reuse the token until near its one-hour expiry rather than requesting one for every API call.
2. Add them to .dlt/secrets.toml
[sources.zuora_source] client_id = "your_zuora_oauth_client_id" client_secret = "your_zuora_oauth_client_secret"
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 Zuora data can I load into Microsoft SQL Server?
These are the Zuora endpoints dlt can load into Microsoft SQL Server:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| oauth_token | oauth/token | POST | Creates an OAuth bearer token using client_id, client_secret, and grant_type=client_credentials; do not send authentication headers. | |
| accounts | object-query/accounts | GET | data | Lists accounts; supports pageSize, cursor, sort[], filter[], expand[], and fields[]. |
| contacts | object-query/contacts | GET | data | Lists contacts through Object Query; supports the common Object Query query capabilities. |
| orders | object-query/orders | GET | data | Lists orders through Object Query; supports the common Object Query query capabilities. |
| products | object-query/products | GET | data | Lists Product objects through Object Query; supports the common Object Query query capabilities. |
| subscriptions | object-query/subscriptions | GET | data | Lists Subscription objects through Object Query; supports the common Object Query query capabilities. |
| usages | object-query/usages | GET | data | Lists Usage Record objects through Object Query; supports the common Object Query query capabilities. |
| rating_details | object-query/rating-details | GET | data | Lists rating details and supports pagination/filtering. |
| custom_object_records | objects/records/default/{object} | GET | records | Lists records for a custom object type; pageSize and forward cursor are supported. |
| catalog_products | v1/catalog/products | GET | products | Retrieves catalog products; supports page/pageSize and returns nextPage when more results exist. |
How do I load only new Zuora records?
Zuora exposes updateddate on object-query/accounts, 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": "accounts", "endpoint": { "path": "object-query/accounts", "data_selector": "data", "incremental": {"cursor_path": "updateddate", "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 Zuora pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading oauth/token and objects from the Zuora API into Microsoft SQL Server:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def zuora_source(oauth_client=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://rest.zuora.com", "auth": {"type": "bearer", "token": oauth_client}, }, "resources": [ {"name": "accounts", "endpoint": {"path": "object-query/accounts", "data_selector": "data"}}, {"name": "custom_object_records", "endpoint": {"path": "objects/records/default/{object}", "data_selector": "records"}} ], } yield from rest_api_resources(config) def load_zuora_to_mssql() -> None: pipeline = dlt.pipeline( pipeline_name="zuora_pipeline", destination="mssql", dataset_name="zuora_data", ) load_info = pipeline.run(zuora_source()) print(load_info) if __name__ == "__main__": load_zuora_to_mssql()
Run it with uv run python zuora_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 Zuora data in Microsoft SQL Server?
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("zuora_pipeline").dataset() df = data.accounts.df() print(df.head())
SQL:
SELECT * FROM zuora_data.accounts LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Zuora to Microsoft SQL Server 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 Zuora 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 Zuora 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 Zuora to Microsoft SQL Server?
Request dlt skills, commands, AGENT.md files, and AI-native context.