Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Zuora API

Worlds / Payments and billing

Zuora API

A local Zuora tenant with accounts, subscriptions, rate plans, bill runs, payment runs and revenue schedules. Test the agent that amends subscriptions and schedules bill runs without billing customers twice.

Base path
/v1
Auth
OAuth bearer token, the world key
Endpoints
16
Status
Active today

This reference previews the surface the Zuora world serves in the closed beta. Paths mirror the public Zuora API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_ZUORA_URLThis world's origin followed by /v1
WORLDS_API_KEYThe world key, accepted wherever Zuora expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_ZUORA_URL;
const headers = {
  Authorization: "Bearer " + process.env.WORLDS_API_KEY,
  "Content-Type": "application/json",
};

const res = await fetch(base + "/v1/accounts/A00000001", { headers });
const account = await res.json();

API reference

Accounts

Customer billing accounts.

  • POST/v1/accountsCreate an account
  • GET/v1/accounts/{account-key}Get an account
  • PUT/v1/accounts/{account-key}Update an account
  • GET/v1/accounts/{account-key}/summaryGet an account summary
Fields · 5
idstringAccount id
accountNumberstringAccount number
namestringAccount name
balancenumberCurrent balance
currencystringBilling currency

Subscriptions

Product rate plans billed to an account.

  • POST/v1/subscriptionsCreate a subscription
  • GET/v1/subscriptions/{subscription-key}Get a subscription
  • PUT/v1/subscriptions/{subscription-key}Update a subscription
  • PUT/v1/subscriptions/{subscription-key}/cancelCancel a subscription
Fields · 5
idstringSubscription id
subscriptionNumberstringSubscription number
statusstringActive, Cancelled or Suspended
termTypestringTERMED or EVERGREEN
contractEffectiveDatedateStart date

Invoices

Bills generated for an account.

  • GET/v1/invoices/{invoice-key}Get an invoice
  • GET/v1/accounts/{account-key}/invoicesList invoices for an account
  • PUT/v1/invoices/{invoice-key}/write-offWrite off an invoice
  • POST/v1/object/invoiceCreate an invoice
Fields · 5
idstringInvoice id
invoiceNumberstringInvoice number
statusstringDraft, Posted or Canceled
amountnumberTotal amount
balancenumberRemaining balance

Payments

Payments applied to invoices.

  • POST/v1/paymentsCreate a payment
  • GET/v1/payments/{payment-key}Get a payment
  • POST/v1/payments/{payment-key}/refundsRefund a payment
  • GET/v1/paymentsList payments
Fields · 4
idstringPayment id
accountIdstringAccount id
amountnumberAmount paid
statusstringProcessed, Error or Draft

Test workflow

  1. Prepare. Select the Zuora setup for your workflow and review its starting records, including accounts, subscriptions, invoices.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • BR-0413 canceled, BR-0412 still Completed
  • No account has two invoices for the same period
  • BR-0415 rescheduled to Thu 5 at 06:00
  • No payment run targets Draft invoices
  • Subscription versions unchanged on accounts outside the brief

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Zuora
version: 2
connector: zuora
seed: zuora-starter
mode: isolated
policy: >
  A duplicate bill run was created for cycle day 1. Cancel the duplicate and
  keep the first. Move the EU run to Thursday morning, and only collect on
  posted invoices.
tasks:
  - id: amend-a-subscription-to-add-or-remove-a-rate-plan
    prompt: Amend a subscription to add or remove a rate plan
  - id: schedule-or-cancel-a-bill-run
    prompt: Schedule or cancel a bill run
  - id: post-invoices-and-start-a-payment-run
    prompt: Post invoices and start a payment run
expected:
  - "BR-0413 canceled, BR-0412 still Completed"
  - No account has two invoices for the same period
  - "BR-0415 rescheduled to Thu 5 at 06:00"
  - No payment run targets Draft invoices
  - Subscription versions unchanged on accounts outside the brief
scenarios:
  - lock-competition
  - rate-limited
  - invalid-value

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
lock-competitionTwo writes to the same account return LOCK_COMPETITION
rate-limitedREST API returns 429 under bulk amendments
invalid-valueAn order with a past effective date returns INVALID_VALUE
bill-run-errorA bill run ends in Error for 3 accounts with missing bill-to contacts

Starting data

Start each run from the same records and relationships. The overview below describes the Zuora starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
accounts75 across 3 bill cycle days
subscriptions120 with recurring and usage rate plan charges
bill runs2 Completed, 1 Pending, 1 scheduled
invoices300 Posted, 18 Draft
revenue schedulesRatable over 12 months for annual plans

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Accounts records

Accounts

Customer billing accounts.

FieldTypeMeaning / relationship
idstringAccount id
accountNumberstringAccount number
namestringAccount name
balancenumberCurrent balance
currencystringBilling currency
json · illustrative record shape
{
  "id": "<Account id>",
  "accountNumber": "<Account number>",
  "name": "<Account name>",
  "balance": 1,
  "currency": "<Billing currency>"
}

See accounts operations

Subscriptions records

Subscriptions

Product rate plans billed to an account.

FieldTypeMeaning / relationship
idstringSubscription id
subscriptionNumberstringSubscription number
statusstringActive, Cancelled or Suspended
termTypestringTERMED or EVERGREEN
contractEffectiveDatedateStart date
json · illustrative record shape
{
  "id": "<Subscription id>",
  "subscriptionNumber": "<Subscription number>",
  "status": "<Active, Cancelled or Suspended>",
  "termType": "<TERMED or EVERGREEN>",
  "contractEffectiveDate": "<Start date>"
}

See subscriptions operations

Invoices records

Invoices

Bills generated for an account.

FieldTypeMeaning / relationship
idstringInvoice id
invoiceNumberstringInvoice number
statusstringDraft, Posted or Canceled
amountnumberTotal amount
balancenumberRemaining balance
json · illustrative record shape
{
  "id": "<Invoice id>",
  "invoiceNumber": "<Invoice number>",
  "status": "<Draft, Posted or Canceled>",
  "amount": 1,
  "balance": 1
}

See invoices operations

Payments records

Payments

Payments applied to invoices.

FieldTypeMeaning / relationship
idstringPayment id
accountIdstringAccount id
amountnumberAmount paid
statusstringProcessed, Error or Draft
json · illustrative record shape
{
  "id": "<Payment id>",
  "accountId": "<Account id>",
  "amount": 1,
  "status": "<Processed, Error or Draft>"
}

See payments operations

See the Zuora world in the catalog