Skip to content

GET /api/agent/bills

AP-side mirror of /api/agent/invoices. Returns CashItem rows with source = XERO_BILL. Identical filter / pagination / sensitive-data semantics, including the ?autoPaginate=true opt-in (caps at 5,000 rows; truncated: true on overflow). Use ?autoPaginate=true for sums / totals so you don't report a partial-page subtotal as a full-period figure. The response always includes totalCount (pre-redaction match count). Opt-in totals (?totals=true): mirrors the AR endpoint — adds an aggregate totals.byStatus + totals.grandTotal block across the full filtered set; ideal for "what's my YTD AP spend?" style questions without paginating. Lines (when requested) are joined from XeroBillLine. Note: the discountRate, discountAmount, and lineSubtotal fields on each line are always null on bills — AP discount support is deferred. The fields are present in the response shape for symmetry with /api/agent/invoices.

Auth

  • Required scope: READ_INVOICES
  • Header: Authorization: Bearer cr_live_<prefix>_<secret>

Query parameters

NameTypeRequiredNotes
statusstringnoComma-separated Xero statuses. Same vocabulary as /invoices.
contactIdstringno
dateFromstringno
dateTostringno
cursorstringno
limitintegerno
linesbooleanno
autoPaginatebooleannoWhen true, the server loops pages internally and returns every matching bill in one response (hard-capped at 5,000; truncated: true on overflow). Mutually exclusive with cursor. Prefer for sum / aggregate reads.
totalsbooleannoAP-side mirror of /invoices?totals=true. Same shape (byStatus + grandTotal + currency; mixed-currency short-circuit; 100K cap → totalsTruncated: true). Off by default.

Responses

200 — Page of bills

Body: BillsResponse

FieldTypeRequiredNotes
billsarray of Invoiceyes
nextCursorstringyes
totalCountintegeryesTotal bills matching the request filters (pre-redaction). See InvoicesResponse.totalCount.
redactedItemCountintegeryes
truncatedbooleannoPresent and true only when ?autoPaginate=true was requested and more than 5,000 rows matched. See InvoicesResponse.truncated.
totalsInvoiceBillTotalsno
totalsTruncatedbooleannoPresent and true only when ?totals=true was requested AND the matched set exceeded the 100,000-row cap. See InvoicesResponse.totalsTruncated.
billingAlertBillingAlertno
xeroAlertXeroAlertno

401 — Unauthorized

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

403 — Key lacks the required scope

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

429 — Rate-limited or quota-exhausted

Body: ErrorResponse

FieldTypeRequiredNotes
errorstringyes

Response headers

Every successful response carries X-CashRunway-Subscription, X-CashRunway-Plan, X-CashRunway-Quota-Remaining, and X-CashRunway-Quota-Reset. Trialing subscriptions also include X-CashRunway-Trial-Days-Remaining. See the overview for details.

Released under a proprietary license.