Skip to content

GET /api/agent/purchase-orders

Returns the caller's org Xero purchase orders. Filterable by raw Xero status (comma-separated string match: DRAFT/SUBMITTED/AUTHORISED/BILLED/DELETED), contactId (supplier), and issue-date range. Same pagination/totals/redaction semantics as /api/agent/invoices (cursor + nextCursor, ?autoPaginate=true 5,000-row cap with truncated, ?totals=true aggregate block grouped by raw status, totalCount, sensitive-contact drop with redactedItemCount). Each PO row carries suppressedReason (nullable): when non-null the PO has been matched to a supplier bill and is excluded from the forecast to avoid double-counting the outflow. Read-only; requires the dedicated READ_PURCHASE_ORDERS scope (NOT implied by bill/invoice access).

Auth

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

Query parameters

NameTypeRequiredNotes
statusstringnoComma-separated raw Xero PO statuses (e.g. AUTHORISED,BILLED). Direct string match.
contactIdstringno
dateFromstringnoInclusive issue-date lower bound (YYYY-MM-DD).
dateTostringnoInclusive issue-date upper bound (YYYY-MM-DD).
cursorstringno
limitintegerno
autoPaginatebooleanno
totalsbooleanno

Responses

200 — Matching purchase orders.

Body: PurchaseOrdersResponse

FieldTypeRequiredNotes
purchaseOrdersarray of PurchaseOrderyes
nextCursorstringyes
totalCountintegeryes
redactedItemCountintegeryes
truncatedbooleanno
totalsInvoiceBillTotalsno
totalsTruncatedbooleanno
billingAlertBillingAlertno
xeroAlertXeroAlertno

401 — Unauthorized

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. · cashrunway.ai