GET /api/agent/credit-notes
Returns AR credit notes (Xero ACCRECCREDIT) for the caller's org — the documents /api/agent/invoices does NOT include. Use this to verify a claimed customer credit (CN-####): its existence, holder, balance (remainingCredit), and how much has been applied (allocatedAmount). Filterable by Xero status (raw string match), contactId, 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, totalCount, sensitive-contact drop with redactedItemCount). Coverage: ACTIVE credits only (AUTHORISED with remaining > 0) — fully-applied/voided credits are not synced.
Auth
- Required scope:
READ_INVOICES - Header:
Authorization: Bearer cr_live_<prefix>_<secret>
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
status | string | no | Comma-separated raw Xero credit-note statuses (e.g. AUTHORISED). Direct string match. |
contactId | string | no | |
dateFrom | string | no | Inclusive issue-date lower bound (YYYY-MM-DD). |
dateTo | string | no | Inclusive issue-date upper bound (YYYY-MM-DD). |
cursor | string | no | |
limit | integer | no | |
autoPaginate | boolean | no | |
totals | boolean | no |
Responses
200 — Matching AR credit notes.
Body: CreditNotesResponse
| Field | Type | Required | Notes |
|---|---|---|---|
creditNotes | array of CreditNote | yes | |
nextCursor | string | yes | |
totalCount | integer | yes | |
redactedItemCount | integer | yes | |
truncated | boolean | no | |
totals | InvoiceBillTotals | no | |
totalsTruncated | boolean | no | |
billingAlert | BillingAlert | no | |
xeroAlert | XeroAlert | no |
401 — Unauthorized
Body: ErrorResponse
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
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.