Load Zuora data to Google Cloud Storage

Build a Zuora to Google Cloud Storage 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.

Source
Zuora
Introduction to the v1 API
Destination
Google Cloud Storage
Write data from any source to Google Cloud Storage buckets as Parquet, JSONL or CSV files with the dlt filesystem destination.

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 → Google Cloud Storage 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 Google Cloud Storage pipeline

Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.

Prompt
Run uvx dlthub-init@latest to build a pipeline from Zuora to Google Cloud Storage 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 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 URLhttps://rest.zuora.com
Example endpointGET object-query/accounts
Records found atdata
AuthenticationOAuth 2.0 client credentials yielding a Bearer access token — sent in the Authorization header, prefixed Bearer
PaginationCursor-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 fieldupdateddate
Record idid
API referencehttps://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

  1. 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 Google Cloud Storage?

These are the Zuora endpoints dlt can load into Google Cloud Storage:

ResourceEndpointMethodData selectorDescription
oauth_tokenoauth/tokenPOSTCreates an OAuth bearer token using client_id, client_secret, and grant_type=client_credentials; do not send authentication headers.
accountsobject-query/accountsGETdataLists accounts; supports pageSize, cursor, sort[], filter[], expand[], and fields[].
contactsobject-query/contactsGETdataLists contacts through Object Query; supports the common Object Query query capabilities.
ordersobject-query/ordersGETdataLists orders through Object Query; supports the common Object Query query capabilities.
productsobject-query/productsGETdataLists Product objects through Object Query; supports the common Object Query query capabilities.
subscriptionsobject-query/subscriptionsGETdataLists Subscription objects through Object Query; supports the common Object Query query capabilities.
usagesobject-query/usagesGETdataLists Usage Record objects through Object Query; supports the common Object Query query capabilities.
rating_detailsobject-query/rating-detailsGETdataLists rating details and supports pagination/filtering.
custom_object_recordsobjects/records/default/{object}GETrecordsLists records for a custom object type; pageSize and forward cursor are supported.
catalog_productsv1/catalog/productsGETproductsRetrieves 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 Google Cloud Storage:

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_google_cloud_storage_filesystem() -> None: pipeline = dlt.pipeline( pipeline_name="zuora_pipeline", destination="filesystem", dataset_name="zuora_data", ) load_info = pipeline.run(zuora_source()) print(load_info) if __name__ == "__main__": load_zuora_to_google_cloud_storage_filesystem()

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 configure Google Cloud Storage as the destination?

dlt writes to Google Cloud Storage through its filesystem destination; the gs:// scheme in bucket_url selects it. Install the extra with uv add "dlt[gs]", then add to .dlt/config.toml and .dlt/secrets.toml:

# .dlt/config.toml [destination.filesystem] bucket_url = "gs://<bucket>/<path>" # .dlt/secrets.toml [destination.filesystem.credentials] project_id = "<project id>" private_key = "<private key>" client_email = "<service account email>"

dlt writes JSONL by default; pass loader_file_format="parquet" to pipeline.run() for Parquet. Delta and Iceberg table formats are supported too. See the dlt filesystem destination docs.

Changing bucket_url is all it takes to write the same data to Amazon S3, Azure Blob Storage or local files instead; see dlt's filesystem destination for all four.


How do I query Zuora data in Google Cloud Storage?

After a run, pipeline.dataset() holds the loaded tables, one per resource. A Relation is a query on that dataset, either a whole table or a SQL string, and reading it gives you the data as a Pandas DataFrame, a PyArrow table or Python tuples. Nothing is read until you ask for it. A filesystem destination holds files rather than tables, so dlt reads them through DuckDB views and the interface is the same as for a SQL destination; for frequent reads load Delta or Iceberg tables, which DuckDB reads only as far as the query needs (see reading data from filesystem).

import dlt pipeline = dlt.pipeline("zuora_pipeline") # Step 1: Get the dataset from the pipeline dataset = pipeline.dataset() # Step 2: Get a Relation, either a whole table... accounts = dataset.table("accounts") # ...or any SQL query against Google Cloud Storage sample = dataset("SELECT * FROM accounts LIMIT 100") # Step 3: Read the data df = accounts.df() # or .df(chunk_size=50) for a large table arrow_table = sample.arrow() # a PyArrow Table rows = sample.fetchall() # a list of Python tuples # Which tables were loaded, and how big are they? print(dataset.row_counts().df()) """ table_name row_count 0 accounts 13 1 custom_object_records 3 """

The columns are the fields the Zuora API returns. Your agent can run the same queries through the MCP server's execute_sql_query tool, and uv run dlthub show opens the Pipeline Dashboard with the schema, load metrics and a query box. See access loaded data in Python and exploring it in marimo notebooks.


How do I deploy the Zuora to Google Cloud Storage 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.

Book a demo →


What other destinations can I load Zuora data to?

dlt loads into any of these — only the destination argument changes:

DestinationExample 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 Google Cloud Storage?

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