Your First Request
Get up and running with the DayZero API in minutes.
Prerequisites
- A DayZero account with API access enabled
- An API token (see Authentication)
- Your business ID — from the dashboard URL or settings, or from Step 1 below
Step 1: List Your Businesses
This is the one common endpoint that does not need x-business-id:
curl "https://api.ondayzero.com/api/v1/businesses" \
-H "Authorization: Bearer dz_your_token_here" \
-H "Accept: application/json"Response (abbreviated — every successful response is wrapped in {"success": true, "data": …}):
{
"success": true,
"data": {
"items": [
{
"id": "01912345-abcd-7000-8000-000000000001",
"name": "Acme Corp",
"default_currency": "USD",
"accounting_basis": "accrual",
"created_at": "2026-01-15T10:30:00Z"
}
],
"next_cursor": null,
"prev_cursor": null,
"has_next": false,
"has_prev": false,
"limit": null,
"total": null
}
}Step 2: Fetch Transactions
Use the id from above as your x-business-id:
curl "https://api.ondayzero.com/api/v1/transactions?limit=5" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: 01912345-abcd-7000-8000-000000000001" \
-H "Accept: application/json"The response has the same shape: data.items holds the transactions, data.next_cursor / data.has_next drive paging (see Pagination).
Step 3: Create an Invoice
You need a customer first — GET /api/v1/customers lists them, POST /api/v1/customers creates one. Then:
curl -X POST "https://api.ondayzero.com/api/v1/invoices" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: 01912345-abcd-7000-8000-000000000001" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"customer_id": "019ab37c-c057-7000-8000-000000000001",
"due_date": "2026-11-01",
"description": "Consulting — October",
"line_items": [
{
"description": "Consulting services",
"quantity": 1,
"unit_price": 15000
}
]
}'A line item with no variant_id is a custom line: description and unit_price are required and quantity defaults to 1. To bill a catalog product instead, pass its variant_id with a quantity (the catalog price is used unless you send unit_price).
The response data is the created invoice: id, number, status (draft), total, balance_due, the normalised line_items, and more.
Note: All amounts are in cents.
15000= $150.00. Never send decimals.
Step 4: Something went wrong?
Every error is one JSON envelope — {"error", "message", "code", "request_id"} — and 422 validation errors add an errors map naming the offending fields. See Error Handling.
What's Next?
- Error Handling — understand API error responses
- Pagination — navigate large result sets
- Transactions — work with bank transactions
- Invoices — finalize, send and record payments
- Using DayZero from an AI Agent — if an agent is making these calls
- MCP Server — connect AI assistants like Claude and Cursor