Skip to content

API Reference ​

Read-only agentic surface for cash position, bank balances, and 13-week forecasts. Bearer-token auth (API keys start with cr_live_). All decimal values are serialised as canonical strings — JSON-safe and drift-free across IEEE-754.

Endpoints ​

EndpointScopeSummary
GET /api/agent/account-balancesREAD_ACCOUNTSBalance-sheet account balances as-at a date
GET /api/agent/bank-accountsREAD_BANKList active bank accounts
GET /api/agent/billsREAD_INVOICESList AP bills
GET /api/agent/cash-positionREAD_FORECASTRead the current cash position
GET /api/agent/cohorts/retentionREAD_SUMMARYFull cohort retention matrix
GET /api/agent/cohorts/summaryREAD_SUMMARYCohort KPI summary
GET /api/agent/contactsREAD_CONTACTSList customers / suppliers
GET /api/agent/contacts/summaryREAD_SUMMARYContact-population aggregates (byType, topByRevenue, topBySpend, ABC)
GET /api/agent/contacts/{id}READ_CONTACTSSingle-contact drill
GET /api/agent/credit-notesREAD_INVOICESList credit notes (customer and/or supplier)
GET /api/agent/credit-notes/{id}READ_INVOICESGet a single credit note (customer or supplier)
GET /api/agent/daily-summaryREAD_SUMMARYComposite daily summary — the agent killer endpoint
GET /api/agent/expenses/summaryREAD_SUMMARYAggregate expense summary (AP-side mirror)
GET /api/agent/forecastREAD_FORECASTFetch the latest 13-week forecast
GET /api/agent/invoicesREAD_INVOICESList AR invoices
GET /api/agent/orgsanyReachable client orgs + key kind (partner discovery)
GET /api/agent/purchase-ordersREAD_PURCHASE_ORDERSList purchase orders
GET /api/agent/purchase-orders/{id}READ_PURCHASE_ORDERSGet a single purchase order
GET /api/agent/quotesREAD_QUOTESList quotes
GET /api/agent/quotes/{id}READ_QUOTESGet a single quote
GET /api/agent/revenue/summaryREAD_SUMMARYAggregate revenue summary (the killer agent endpoint)
GET /api/agent/statusanyBilling + quota + key context for session bootstrap

Authentication ​

Every agent endpoint requires a Bearer token in the Authorization header. Tokens start with cr_live_ and are issued from Settings → API keys. Scopes are assigned per key — an endpoint's required scope is listed alongside its URL.

Rate limits ​

Per-key burst cap: 60 requests / minute / endpoint. Query credits are metered per (user, account) in a rolling 5-hour window — Free 10 / Pocket 50 / Wallet 250 / Vault 1,000 / Reserve 5,000 per window — and reported in the response usage block. Credits free up continuously as each call ages past 5 hours; run dry and you can upgrade your plan or let Cushion auto-top-up. The /api/agent/status endpoint is exempt from query-credit counting. See Plans, query credits & accounts.

Response headers ​

Every successful response carries:

HeaderValue
X-CashRunway-Subscriptiontrialing / active / past_due / canceled / trial_ended
X-CashRunway-PlanSubscription display name (legacy field). For the current query-credit plan, read the usage block.
X-CashRunway-Trial-Days-Remaininginteger, only when trialing
X-CashRunway-Reset-Minutesinteger — minutes until the next query credit frees up (mirrors usage.nextCreditInMinutes).
X-CashRunway-Quota-Remaininginteger (legacy per-org daily bucket — prefer usage.remaining).
X-CashRunway-Quota-ResetISO timestamp (legacy daily bucket — prefer usage.windowResetAt).

When an escalation trigger fires (trial ≤5d, quota ≥90%, status ≠ active/trialing) a billingAlert field is folded into the JSON body. Its absence on a healthy call is the positive signal.

Schemas ​

Click to expand all schemas

BillingAlert ​

Present only when an escalation trigger fires (trial ≤5 days, quota ≥90%, or subscription status ∈ {past_due, canceled, trial_ended}). Absence of this field on a healthy response is the positive signal — LLMs don't need to check every call.

FieldTypeRequiredNotes
severitystring · one of warn criticalyes
messagestringyes
ctaobjectyes

XeroAlert ​

Present only when the org's Xero connection needs operator attention. Absence = healthy connection. Three kinds: reconnect_required (critical — token expired or circuit breaker tripped, data is stale and won't update); service_issue (warn — Xero returning errors but auto-retrying, data may be up to 12 hours old); no_connection (warn — no Xero account connected at all). Always tell the user when this field is present.

FieldTypeRequiredNotes
severitystring · one of warn criticalyes
kindstring · one of reconnect_required service_issue no_connectionyes
messagestringyes
lastSuccessfulSyncstring,null (date-time)yesISO timestamp of the last successful Xero sync, or null if never synced.
ctaobjectyes

AgentNote ​

Plain-language context an agent / LLM can reason over without re-deriving signals from raw numbers.

FieldTypeRequiredNotes
kindstring · one of seasonality trend pipeline ar concentrationyes
windowstring · one of this_month next_4w this_quarteryes
severitystring · one of info warnyes
textstringyes
sourceInsightIdstringnoSet when the note was produced by the insight engine; omitted for fallback-detector notes.

ErrorResponse ​

FieldTypeRequiredNotes
errorstringyes

QuotaExhaustedResponse ​

The rolling-5h query-credit window is at cap (error: "daily_limit_exceeded"). IMPORTANT: the window is ROLLING, not a periodic reset — credits return ONE AT A TIME as individual calls age past 5 hours, continuously. nextCreditInMinutes is the wait until the FIRST credit frees (one more call); resetAt is the much later instant when EVERY credit has returned. Pace retries off nextCreditInMinutes / Retry-After, never off resetAt.

FieldTypeRequiredNotes
errorstring · one of daily_limit_exceededyes
usedTodayintegernoCalls in the trailing-5h window (name retained for compatibility).
limitintegernoThe per-window cap for this seat.
remainingintegernoAlways 0 on a 429.
resetAtstring (date-time)noInstant EVERY credit has returned (the newest call ages out). Do NOT use this to schedule a retry — see nextCreditInMinutes.
nextCreditInMinutesintegernoMinutes until the FIRST credit frees — i.e. until exactly one more call is possible. Mirrored on the Retry-After (seconds) and X-CashRunway-Reset-Minutes headers.

BurstLimitedResponse ​

The per-key, per-endpoint burst cap was exceeded (error: "rate_limited"). Independent of query credits: this fires before the credit check and carries only Retry-After. Retry after the stated window.

FieldTypeRequiredNotes
errorstring · one of rate_limitedyes
limitintegernoRequests allowed per window.
windowSecondsintegernoBurst window length.

BankAccount ​

FieldTypeRequiredNotes
idstringyes
namestringyes
currencystringyes3-letter ISO code.
reconciledBalancestringyes
statementBalancestringyes
balanceSourcestring · one of STATEMENT RECONCILEDyes
balanceSyncedAtstring (date-time)no

CashPositionResponse ​

FieldTypeRequiredNotes
asOfDatestring (date)yes
startingCashstringyesEffective opening cash (post-override, post-auto-adjust). Equal to effectiveStartingCash today; surfaced under both names for clarity.
sourcestring · one of manual xero_reconciledyes
xeroReconciledTotalstringyesBare sum of Xero-reconciled bank balances across the org's RECONCILED accounts. This is the honest ledger total — no operator override or auto-detected unreconciled-transaction adjustment applied. Compare against effectiveStartingCash to detect drift driven by overrides or pending Xero categorisation.
effectiveStartingCashstringyesPost-override and post-auto-adjust opening cash, used by the forecast engine. Diverges from xeroReconciledTotal when an operator override or auto-detected unreconciled-transaction adjustment is in play.
currencystringno
accountsarray of objectyes
redactedItemCountintegeryesnumber of accounts rows whose name was rewritten to "Sensitive account" for this caller. Always 0 when the key carries the READ_SENSITIVE scope. Lets agentic consumers know they're operating on a masked view without inspecting every name.
notesForAgentarray of AgentNoteno
billingAlertBillingAlertno
xeroAlertXeroAlertno

ForecastWeek ​

FieldTypeRequiredNotes
weekStartstring (date)yes
weekEndstring (date)yes
openingstringyes
inflowstringyes
guaranteedInflowstringnoSubset of inflow from guaranteed sources (paid AR, recurring, manual, pipeline). Drives the dashboard's conservative runway line. Optional; absent on engineVersion=1 snapshots written before this split.
forecastInflowstringnoSubset of inflow from STATISTICAL items only (predicted POs from the hazard model). Drives the dashboard's optimistic runway line, layered on top of conservative. Optional; absent on engineVersion=1 snapshots, in which case readers default to 0 (collapses optimistic onto conservative).
outflowstringyes
netstringyes
closingstringyes
itemIdsarray of stringyes
overdueItemIdsarray of stringno
probabilityWeightedbooleanno
categoriesobjectno

ForecastResponse ​

FieldTypeRequiredNotes
scenarioIdstringyes
scenarioNamestringno
scenarioKindstring · one of BASE BEST WORST CUSTOMno
computedAtstring (date-time)yes
weeksarray of ForecastWeekyes
startingCashstringyes
endingCashstringyes
minClosingCashstringno
minClosingCashWeekIndexintegerno
totalInflowstringno
totalOutflowstringno
redactedItemCountintegeryessum across all weeks of (week, account) pairs whose account name was rewritten to "Sensitive account" inside weeks[].categories.accounts[id].name for this caller. Always 0 when the key carries READ_SENSITIVE. The net cash trajectory (opening/inflow/outflow/closing) is never masked: a sensitive account's totals still feed weekly amounts (Stripe restricted-key pattern).
notesForAgentarray of AgentNoteno
billingAlertBillingAlertno
xeroAlertXeroAlertno

OrgsResponse ​

FieldTypeRequiredNotes
keyKindstring · one of PARTNER USERyesPARTNER for an advisory partner key (multi-client); USER for an ordinary org key.
orgsarray of objectyesClient orgs this key can reach, sorted by name. For PARTNER keys these are the advisory-linked clients (intersected with the key's scope ceiling); for USER keys, the orgs the key's creator is a member of.

StatusResponse ​

FieldTypeRequiredNotes
subscriptionobjectyes
quotaobjectyesLegacy per-org daily quota bucket (retained for backwards-compat). For the query-credit model — credits remaining AND minutes until they free up — read the usage block instead.
usageobjectnoRolling-5h query-credit window for the key's (user, billing-account-of-target-org). remaining is credits left; nextCreditInMinutes is the wait until the FIRST credit frees (0 when under cap — a credit is available now); fullResetInMinutes is the wait until EVERY credit returns (0 for an empty window); windowResetAt is the ISO instant the window fully empties. The same nextCreditInMinutes value is mirrored on the X-CashRunway-Reset-Minutes response header. null when the key has no billable seat or the target org has no owning billing account (a status probe still succeeds; usage is simply unresolvable).
keyobjectyes
environmentstring · one of dev prodyes
billingAlertBillingAlertno
xeroAlertXeroAlertno

InvoiceLine ​

Line-item shadow of a Xero Invoice.LineItems[] (or Bill.LineItems[]) entry.

FieldTypeRequiredNotes
idstringyes
lineNumberintegeryes
accountCodestringno
accountNamestringyes
lineAmountstringyesEx-GST line subtotal as a canonical decimal string.
taxAmountstringyesGST / tax charged on the line, as a canonical decimal string.
quantitystringnoUnits sold on this line (Xero LineItem.Quantity) as a canonical decimal string. null when Xero omits the field (rare; manual-journal-style invoices) or when the line was ingested before this column was added and its parent invoice hasn't been re-synced yet. Treat null as 'unknown' rather than 'zero'.
unitAmountstringnoPer-unit list / RRP ex-GST price (Xero LineItem.UnitAmount, pre-discount) as a canonical decimal string. Same null-semantics as quantity. Combine with discountRate or discountAmount to derive the effective per-unit price.
discountRatestringnoLine-level discount as a fraction 0–1 (e.g. "0.5" for 50% off). Normalised from Xero's LineItem.DiscountRate percent at ingest. null means the line is at list price OR the discount was entered as an absolute amount (see discountAmount). Sales invoices only — always null on bills.
discountAmountstringnoLine-level discount as an absolute amount in invoice currency (Xero's LineItem.DiscountAmount). Mutually exclusive with discountRate. Sales invoices only — always null on bills.
lineSubtotalstringnoPre-discount list-price subtotal — quantity * unitAmount — captured at ingest. null when either factor is null (manual-journal-style line). Distinct from lineAmount which is the billed amount AFTER discount.
taxTypestringno
currencystringyes
lineDescriptionstringno

Invoice ​

Agent-API projection of a CashItem row (source = XERO_INVOICE or XERO_BILL). xeroStatus collapses the internal status into a canonical Xero status value.

FieldTypeRequiredNotes
idstringyes
externalIdstringno
invoiceNumberstringno
referencestringno
amountstringyes
currencystringyes
expectedDatestring (date-time)yes
actualDatestring (date-time)no
issueDatestring (date-time)no
statusstring · one of FORECAST ACTUAL CANCELLEDyesInternal CashItem lifecycle. Agents filter by xeroStatus instead; status is surfaced for diagnostic transparency.
xeroStatusstring · one of DRAFT SUBMITTED AUTHORISED PAID VOIDED DELETEDyes
contactIdstringno
contactNamestringno
categorystringno
sentbooleannoWhether the invoice has been sent to the customer (Xero SentToContact). THREE distinct states — true = sent, or marked-as-sent by a human in Xero; false = never sent (the actionable state: an invoice raised but never delivered, i.e. money the customer has never been asked for); null = UNKNOWN, meaning the record predates this field and has not been re-synced yet, or is a bill. Do NOT treat null as false — that reports records nobody has checked as invoices that were never sent. Note true means sent or manually marked sent, so it is not proof an email was delivered. Sales invoices only: always null on /bills.
voidedAtstring (date-time)noWhen the sync observed this document being voided or deleted in Xero, or null when the document is live. Voided documents are EXCLUDED from every list by default and surface only when you name VOIDED or DELETED in ?status=, so a non-null voidedAt never appears unasked-for in a normal page. Read xeroStatus to tell the two terminal states apart — VOIDED (a cancelled document) vs DELETED (a discarded draft); the internal status field collapses both to CANCELLED. NOTE: voidedAt records when WE saw the void, not when the operator performed it — Xero does not expose the latter. Rows voided before this feature shipped are recovered from a bounded window (90 days, or back to the sync cursor if that is earlier), so an empty void ledger is not proof a document was never voided.
amountDuestringnoWhat is still OUTSTANDING on this document (Xero AmountDue), as a canonical decimal string. This is the figure to chase a customer for, and it is the field to read even though amount often carries the same number, for two reasons. FIRST, HONEST NULLS: when Xero returns no AmountDue, amount records 0 — indistinguishable from a settled document — while amountDue records null, meaning UNKNOWN. Do NOT render null as 0; that reports a live debt as settled. SECOND, STABLE MEANING: amount is not a dependable measure of anything on its own. On an OPEN document it holds the outstanding balance; once a document settles it is usually rewritten to the gross total, but not always — a document settled by a payment the sync observed before it re-read the document keeps whatever amount it already had. So amount cannot be summed, compared or reasoned about even within one status. amountDue always means outstanding, on every row. "0" means settled in full. null also covers a record predating this field that has not been re-synced or backfilled, or a row that is not a Xero invoice/bill. A PAID row can legitimately report null here. When the sync sees a payment for a document it has not re-read, it settles the row and RETRACTS both money fields to null rather than leave the pre-payment figures in place — those would show a positive balance owing on a document the same response calls PAID. It also does not write 0: one payment does not prove settlement in full. So on a PAID row, null means we have not re-read the document yet; a later sync resolves it.
amountPaidstringnoCash actually received (invoices) or paid (bills) against this document — Xero AmountPaid — as a canonical decimal string. null = UNKNOWN, on the same rule as amountDue, including the PAID-row case: a document settled from a payment the sync observed without re-reading the document reports null here rather than a figure that predates that payment. Read it from this field and never derive it. amount - amountDue does NOT give it: on an open document those two hold the SAME figure, so the subtraction yields 0 no matter how much has been paid, and on a credit-note-settled document it yields the full face value and reports the invoice as paid in cash when nothing was received. To find out whether a credit note reduced a document, ask directly with ?credits=true and read creditedAmount — no arithmetic over amount, amountDue and amountPaid reveals a credit on an open row.
creditedAmountstringnoTotal value of credit notes applied to this document, as a canonical decimal string. Present ONLY when credits=true was supplied — the key is absent otherwise, so null never means "you didn't ask". "0" = known-and-none: we hold this org's allocation data and no credit note touches this document. null = UNKNOWN, which happens four ways, and ONLY THE FIRST IS TEMPORARY: (1) no allocation data has been normalised for this org yet, which a backfill resolves; (2) a matched allocation carries no amount from Xero, in which case creditNotes still lists it so you can inspect it; (3) the org has NEVER HAD A CREDIT NOTE, so it holds no allocation rows and reads null PERMANENTLY; (4) a credit note applied to this document is SENSITIVE (sensitive contact, or a line on a sensitive account) and the key lacks READ_SENSITIVE — it is left out of creditNotes, and the total is withheld so the response neither itemises nor sums hidden credit notes. This withholds the itemisation only; it does NOT conceal the amount, which can still be inferred from the document's amount / amountDue / amountPaid and the visible entries. In cases (1) and (3) creditNotes is also null; in (2) and (4) it is an array. (2) and (4) can occur together, so an array containing a null-amount entry is ambiguous between them; the working test is: an array with NO null-amount entries ⇒ (4), credit this key cannot see. Because of (3), do not report null as "data still loading" or "check back later" — an org with no credit notes would be told that every day forever. Report (1)/(3) as "no credit-note data is recorded for this org", and (4) as "credit has been applied that this key is not permitted to see". VOIDED and DELETED credit notes are excluded — a voided credit reduces nothing. AR credit notes offset invoices and AP credit notes offset bills; the two are never crossed.
creditNotesarray of InvoiceCreditNotenoThe individual credit notes making up creditedAmount. Present ONLY when credits=true was supplied. [] = known-and-none; null = unknown, on the same rule as creditedAmount. Without READ_SENSITIVE, sensitive credit notes (sensitive contact, or any line on a sensitive account) are omitted, and creditedAmount is then null.
linesarray of InvoiceLinenoPresent only when lines=true was supplied on the request.

InvoiceCreditNote ​

One credit note applied to the invoice or bill carrying it. Answers "what credited this document, and by how much?" without a search across credit notes. For the credit note's line items, drill with GET /api/agent/credit-notes/{creditNoteId}.

FieldTypeRequiredNotes
creditNoteIdstringyesXero CreditNoteID (GUID). Pass to GET /api/agent/credit-notes/{id}.
creditNoteNumberstringnoXero CreditNoteNumber (e.g. "CN-0441"). null on rows synced before that column existed.
allocatedAtstring (date-time)noXero's allocation date for this entry. null = Xero omitted it, not "no date".
amountstringnoAmount of this credit note applied to THIS document — not the credit note's face value. null = Xero omitted the amount on the allocation; such an entry also forces the parent creditedAmount to null rather than under-reporting it.

ListTotalsBucket ​

Single status / type bucket inside totals.byStatus. count is the row count; amount is the gross sum (canonical decimal string, trailing zeros trimmed). For contacts, only count is meaningful; the schema is shared but contacts totals.byType uses plain integers (no buckets) since there is no $ axis.

FieldTypeRequiredNotes
countintegeryes
amountstringyesCanonical decimal string, e.g. "1099419.91". "0" when the bucket is empty. Trailing zeros trimmed per serializeDecimal().

InvoiceBillTotals ​

Opt-in aggregate block returned on /api/agent/invoices and /api/agent/bills when ?totals=true is set. Three variants: (1) single-currency — byStatus carries every known Xero status as a key ({count:0, amount:"0"} when unused; agents are sensitive to absent keys), grandTotal is the sum across buckets, and currency carries the org's transacting currency for the matched set. (2) multi-currency — mixedCurrency: true, primaryCurrency set, byStatus: null (a cross-currency sum would mislead more than no sum). (3) empty matched set — byStatus carries all-zero buckets and grandTotal is {count:0, amount:"0"}. Note: when the matched set exceeds 100,000 rows the totals block is OMITTED and the parent response sets totalsTruncated: true instead — fall back to a tighter filter (date range / status) to bring the scan back under the cap.

FieldTypeRequiredNotes
byStatusobjectnoMap of Xero status → bucket. ALWAYS includes every known status key zero-filled when the matched set is non-empty single-currency. null when mixedCurrency: true.
grandTotalListTotalsBucketno
currencystringnoSingle currency of the matched set (e.g. "AUD"). Present when the set is non-empty and spans exactly one currency; omitted on the multi-currency and empty-set branches.
mixedCurrencybooleannoPresent and true only when the matched set spans >1 currency. When set, byStatus is null and primaryCurrency carries the (lexicographically-first) currency code purely for the response shape.
primaryCurrencystringnoSet only when mixedCurrency: true.

ContactsTotals ​

Opt-in aggregate block returned on /api/agent/contacts when ?totals=true is set. Distinct shape from invoices/bills — contacts have NO $ axis (LTV / spend live on TrendBaseline, not aggregable inline), so this surfaces only count buckets. ALWAYS includes every byType key (customer / supplier / both / neither) zero-filled when unused.

FieldTypeRequiredNotes
byTypeobjectyes
grandTotalobjectyesSum across byType buckets — reconciles to totalCount.

InvoicesResponse ​

FieldTypeRequiredNotes
invoicesarray of Invoiceyes
nextCursorstringyesOpaque base64url cursor — pass back as ?cursor=... on the next request. Always present; null signals 'this is the last page in this view'. Both the natural last page AND an ?autoPaginate=true response (truncated or not) emit null — truncation is signalled via the separate truncated field, not via the cursor.
totalCountintegeryesTotal number of rows matching the request filters (pre-redaction). Reconciles to Xero source-of-truth; the page array may be shorter if sensitive rows were dropped (the delta is redactedItemCount). Always present.
redactedItemCountintegeryesNumber of rows withheld in this page due to sensitive-data gating. Always 0 when the key carries READ_SENSITIVE.
truncatedbooleannoPresent and true only when ?autoPaginate=true was requested and more than 5,000 rows matched. The response carries the first 5,000 rows; fall back to cursor pagination (drop autoPaginate=true) to read the rest. Absent on healthy responses.
totalsInvoiceBillTotalsno
totalsTruncatedbooleannoPresent and true only when ?totals=true was requested AND the matched set exceeded the 100,000-row aggregation cap. The totals block is omitted in this case; refine the filter (date range / status) to bring the scan back under the cap.
billingAlertBillingAlertno
xeroAlertXeroAlertno

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

ContactSummary ​

Agent-API projection of a XeroContact row. ltv is populated for customer rows where the nightly baseline worker has run; null otherwise (warming, or supplier-only contacts).

Reachability fields (email, accountNumber, contactStatus, contactDetailsSyncedAt) are on this LIST row on purpose. To assemble a send-to list for an AR chase over N customers, call this endpoint ONCE — do NOT loop GET /api/agent/contacts/{id}, which costs N calls (and N query credits) to learn the same addresses. Use the drill only when you additionally need contact persons, payment terms, contact groups, or the payment-history block.

Reading null: every field here means UNKNOWN when null, never zero / none / false. Xero's empty string is normalised to null at ingest, so there is exactly one representation of "absent".

FieldTypeRequiredNotes
idstringyesXero contact external id (the same value returned on invoices / bills as contactId).
namestringyes
isCustomerbooleanyes
isSupplierbooleanyes
isSensitivebooleanyes
lastSyncedAtstring (date-time)yes
emailstringyesPrimary AR contact email address (Xero Contact.EmailAddress) — the address to send an invoice reminder or a statement to. null means UNKNOWN, and it is only interpretable together with contactDetailsSyncedAt: null email + NON-NULL stamp = Xero genuinely holds no AR email for this contact (state that plainly, no hedge); null email + NULL stamp = the contact-detail fields have never been read from Xero, so say "not yet synced", never "no email on file".
accountNumberstringyesXero Contact.AccountNumber. One of the signals for "is this customer on an account rather than prepay?" (the others — payment terms and contact groups — are on GET /api/agent/contacts/{id}). null means UNKNOWN, never "no account number"; read against contactDetailsSyncedAt.
contactStatusstring · one of ACTIVE ARCHIVEDyesXero Contact.ContactStatus, verbatim. ARCHIVED contacts are EXCLUDED from this endpoint by default and only appear when you pass ?includeArchived=true — so on a default response this reads ACTIVE or null. null means UNKNOWN (not yet synced), never "not archived".
contactDetailsSyncedAtstring (date-time)yesPROVENANCE STAMP for email / accountNumber / contactStatus (and, on the drill, contact persons, payment terms and contact groups): when those fields were last read FROM Xero. It is deliberately NOT the same as lastSyncedAt, which only says when the row was last touched. This is the field that makes absence legible. Never report "this customer has no email" off a null email alone — check this stamp first. When it is null, the honest answer is "we haven't read this contact's details from Xero yet".
ltvstringnoHISTORICAL cumulative gross-profit LTV from the nightly TrendBaseline.ltvCumulative (all realised revenue × GP%). This is a DIFFERENT metric from the contact-drill endpoint's projectedLtv (a live, churn-adjusted FORWARD projection): this list field is backward-looking and refreshed by the nightly worker, the drill's projectedLtv is computed live per request. Null when the baseline hasn't computed yet or the contact isn't a customer.

ContactsListResponse ​

FieldTypeRequiredNotes
contactsarray of ContactSummaryyes
nextCursorstringyesOpaque base64url cursor — pass back as ?cursor=.... Always present; null signals the last page in this view. ?autoPaginate=true responses always carry null here — truncation is signalled separately via truncated: true.
totalCountintegeryesTotal number of contacts matching the request filters (pre-redaction). See InvoicesResponse.totalCount.
redactedItemCountintegeryesNumber of contacts withheld due to sensitive-data gating. Always 0 when the key carries READ_SENSITIVE.
truncatedbooleannoPresent and true only when ?autoPaginate=true was requested and more than 5,000 contacts matched. See InvoicesResponse.truncated.
totalsContactsTotalsno
totalsTruncatedbooleannoPresent and true only when ?totals=true was requested AND the matched contact set exceeded the 100,000-row cap.
billingAlertBillingAlertno
xeroAlertXeroAlertno

ContactDrill ​

Single-contact drill payload. Contact reachability (email, contactPersons) and account classification (accountNumber, paymentTerms, contactGroups, contactStatus) all carry contactDetailsSyncedAt as their shared provenance stamp — read it before making any statement about a missing address. Revenue + lifetime-value signals: revenueTrailing12m / revenueAllTime are realised inflow sums; projectedLtv is the churn-adjusted forward gross profit; historicalLtv is earned-to-date gross profit. Other derived signals (payment-days median, cadence, abcClass) come from TrendBaseline; the engine falls back to direct computation on warming customers.

FieldTypeRequiredNotes
idstringyes
namestringyes
isCustomerbooleanyes
isSupplierbooleanyes
isSensitivebooleanyes
lastSyncedAtstring (date-time)yes
emailstringyesPrimary AR contact email address (Xero Contact.EmailAddress). null means UNKNOWN — see contactDetailsSyncedAt before you describe a contact as having no email. If you only need addresses for several contacts, GET /api/agent/contacts carries this field on every list row and costs one call instead of one per contact.
contactPersonsarray of objectyesXero Contact.ContactPersons[], verbatim — the additional named people on the contact, useful when the primary email is absent or goes to a generic mailbox. null and [] mean DIFFERENT things: null = not yet read from Xero (see contactDetailsSyncedAt); [] = Xero confirms there are no contact persons. Do not treat them alike.
accountNumberstringyesXero Contact.AccountNumber. null means UNKNOWN, never "no account number".
paymentTermsobjectyesXero Contact.PaymentTerms, reshaped into sales (what this customer owes you) and bills (what you owe this supplier). Always present; the leaves are null when unknown or when Xero holds no term for that side. day is a day number whose meaning depends on type — an absent term is null, never 0. Together with accountNumber and contactGroups this answers "is this counterparty on account, or prepay?" — the question behind routing a chase letter to the right lane. Prefer all three over inferring from any one.
contactGroupsarray of objectyesXero Contact.ContactGroups[], verbatim — the operator's own segmentation, often the cleanest "on account" / "prepay" signal. null = not yet read from Xero; [] = Xero confirms this contact belongs to no group.
contactStatusstring · one of ACTIVE ARCHIVEDyesXero Contact.ContactStatus, verbatim. Unlike GET /api/agent/contacts, this drill does NOT hide archived contacts — an id you already hold stays drillable — so check this before chasing. null means UNKNOWN, never "not archived".
contactDetailsSyncedAtstring (date-time)yesPROVENANCE STAMP for email, contactPersons, accountNumber, paymentTerms, contactGroups and contactStatus: when those fields were last read FROM Xero. Deliberately distinct from lastSyncedAt, which only records when the row was last touched. A null email under a NON-NULL stamp is a defensible "Xero holds no AR contact for this customer". A null email under a NULL stamp only means "we have not looked yet" — report it that way. Also null when this contact has no Xero contact record at all and the payload was reconstructed from its invoice / bill history: in that case every field above is null too, and the correct statement is "we hold no contact record", NOT "Xero has no email".
availableCreditstringyesUnallocated AR credit this customer currently holds — sum of remainingCredit across their AUTHORISED ACCRECCREDIT credit notes in the org base currency, as a canonical decimal string ("0" when none). Foreign-currency credits are excluded from this scalar; see /api/agent/credit-notes for the per-currency breakdown. Without READ_SENSITIVE, credit notes with any line on a sensitive account are excluded from the sum, matching what /api/agent/credit-notes shows the same key. Answers 'does this customer hold a credit?' in one call.
availableSupplierCreditstringyesUnallocated AP credit this contact, as a SUPPLIER, currently owes us — sum of remainingCredit across their AUTHORISED ACCPAYCREDIT credit notes in the org base currency, as a canonical decimal string ("0" when none). The mirror of availableCredit for the other side; the two are never summed or netted (a customer credit is cash we owe, a supplier credit is cash owed to us). Foreign-currency credits are excluded; see /api/agent/credit-notes?type=supplier for the per-currency breakdown. Without READ_SENSITIVE, credit notes with any line on a sensitive account are excluded from the sum, matching what /api/agent/credit-notes shows the same key.
revenueTrailing12mstringyesTrailing-12-month realised revenue (sum of ACTUAL inflows over the last 365 days), as a canonical decimal string. Doubles as the annual run-rate feeding projectedLtv. Always present ("0" when no inflows).
revenueAllTimestringyesAll-time realised revenue (sum of every ACTUAL inflow to date), as a canonical decimal string. Feeds historicalLtv. Always present ("0" when no inflows).
projectedLtvstringnoChurn-adjusted forward gross-profit lifetime value: run-rate × gross-margin × expected-lifetime-years × churn-retention-factor (Active 1.0 / At-risk 0.5 / Churned 0.0). Null when the org has no COGS convention (grossMarginPercent null); Decimal "0" for a churned customer.
historicalLtvstringnoEarned-to-date gross-profit lifetime value: all-time realised revenue × gross-margin. Null when the org has no COGS convention (grossMarginPercent null).
grossMarginPercentnumbernoOrg-level gross-margin as a fraction in [0,1] (0.42 = 42%). Null when the org has neither a GP% override nor enough COGS history to derive one.
expectedLifetimeYearsnumberyesOrg-derived expected customer relationship length in years — the median engaged-customer (cadence ≠ NONE) lifetime, clamped to [1,5]. Drives the projectedLtv horizon and is identical across the customer card, customers list, and this API.
paymentDelayMedianDaysstringnoMedian days late on paid invoices, in canonical decimal string form.
cadencestring · one of WEEKLY FORTNIGHTLY MONTHLY QUARTERLY ANNUAL NONEno
cadenceConfidenceintegerno
abcClassstring · one of A B Cno80/20 customer tier. Null for non-customer contacts or pre-worker baselines.
lastInvoiceobjectno
lastBillobjectno
recentPaidInvoicesarray of objectyesUp to 50 most recent paid invoices. Entries on sensitive accounts are kept in the array (count preserved) but their accountName is replaced with the sentinel Sensitive account and accountCode is null. redactedItemCount on the wrapper reports how many entries were masked.

ContactDrillResponse ​

FieldTypeRequiredNotes
contactContactDrillyes
redactedItemCountintegeryesNumber of recentPaidInvoices[] entries masked due to sensitive-account gating.
billingAlertBillingAlertno
xeroAlertXeroAlertno

CreditNote ​

A credit note — type: "customer" (Xero ACCRECCREDIT, credit we owe a customer) or type: "supplier" (Xero ACCPAYCREDIT, credit a supplier owes us). status is the cash-flow label (FORECAST/ACTUAL/CANCELLED, same convention as invoices); xeroStatus is the raw Xero status. allocatedAmount = total − remainingCredit (the portion already applied to invoices or bills). Amounts are canonical decimal strings.

FieldTypeRequiredNotes
idstringyes
externalIdstringyesXero CreditNoteID (GUID).
typestring · one of customer supplieryescustomer = AR credit note (ACCRECCREDIT, offsets invoices); supplier = AP credit note (ACCPAYCREDIT, offsets bills).
creditNoteNumberstringnoXero CreditNoteNumber (e.g. "CN-0441"). On supplier credits this is the supplier's own reference — often blank (null) and not unique; prefer externalId as the handle.
contactIdstringno
contactNamestringno
issueDatestring (date-time)yes
statusstring · one of FORECAST ACTUAL CANCELLEDyes
xeroStatusstring · one of DRAFT SUBMITTED AUTHORISED PAID VOIDED DELETEDyes
totalstringyes
remainingCreditstringyesUnallocated portion still available to apply.
allocatedAmountstringyestotal − remainingCredit (the portion applied). "0" on a CANCELLED (VOIDED/DELETED) credit note — a dead credit applies nothing.
currencystringyes

CreditNoteAllocation ​

An invoice (customer credits) or bill (supplier credits) this credit has been applied to.

FieldTypeRequiredNotes
invoiceNumberstringno
invoiceExternalIdstringno
amountstringno
datestringno

CreditNoteLine ​

One credit-note line. accountCode is null when Xero coded none. (Lines are never individually redacted: a credit note with any line on a sensitive account is hidden in full from keys without READ_SENSITIVE.)

FieldTypeRequiredNotes
descriptionstringno
quantitystringno
unitAmountstringno
lineAmountstringno
itemCodestringno
accountCodestringno

CreditNoteDrill ​

any

CreditNotesResponse ​

FieldTypeRequiredNotes
creditNotesarray of CreditNoteyes
nextCursorstringyes
totalCountintegeryes
redactedItemCountintegeryes
truncatedbooleanno
totalsInvoiceBillTotalsno
totalsTruncatedbooleanno
billingAlertBillingAlertno
xeroAlertXeroAlertno

CreditNoteAmbiguousResponse ​

A credit-note NUMBER matched more than one credit note visible to this key (supplier numbers are the supplier's own and often collide with customer CN numbers). Re-request with one candidate's externalId.

FieldTypeRequiredNotes
errorstring · one of ambiguousyes
candidatesarray of objectyes

CreditNoteDrillResponse ​

FieldTypeRequiredNotes
creditNoteCreditNoteDrillyes
redactedItemCountintegeryesAlways 0 on the drill: a sensitive credit note (sensitive contact, or any line on a sensitive account) is hidden in full — 404 — rather than returned with redactions. Kept for wire-shape parity with the list, where it counts dropped rows.
billingAlertBillingAlertno
xeroAlertXeroAlertno

PurchaseOrder ​

A Xero purchase order. status is the RAW Xero status (DRAFT/SUBMITTED/AUTHORISED/BILLED/DELETED) — POs carry no cash-flow FORECAST/ACTUAL collapse; the ?status= filter matches it verbatim. total is the gross, tax-inclusive amount as a canonical decimal string. suppressedReason is set (non-null) when the PO has been matched to a bill and therefore excluded from the forecast (§5-B bill-match backstop) — see the field description.

FieldTypeRequiredNotes
idstringyes
externalIdstringyesXero PurchaseOrderID (GUID).
purchaseOrderNumberstringyesXero PurchaseOrderNumber (e.g. "PO-0042").
referencestringyesXero Reference (free-form).
contactIdstringyesSupplier Xero contact GUID.
contactNamestringyes
statusstringyesRaw Xero status: DRAFT, SUBMITTED, AUTHORISED, BILLED, or DELETED.
issueDatestring (date-time)yes
deliveryDatestring (date-time)yes
expectedArrivalDatestring (date-time)yes
totalstringyesGross, tax-inclusive total.
currencystringyes
suppressedReasonstringyesNon-null ("REFERENCE" or "CONTACT_AMOUNT") when this PO has been matched to a supplier bill and is therefore excluded from the forecast to avoid double-counting the outflow; null when the PO is not suppressed.
itemCodesarray of stringyesDistinct Xero item codes across this purchase order's line items, in line order. Always present and NEVER null — [] means the PO has no coded lines (or its lines are not yet synced), so no null branch is needed (unlike the drill's lineItems). Codes are stored verbatim, exactly as they appear in Xero; the ?itemCode= list filter matches them case-insensitively, whatever the casing of either the stored code or the query.

PurchaseOrderLine ​

FieldTypeRequiredNotes
descriptionstringno
quantitystringno
unitAmountstringno
lineAmountstringno
itemCodestringno
accountCodestringno

PurchaseOrderDrill ​

any

PurchaseOrdersResponse ​

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

PurchaseOrderDrillResponse ​

FieldTypeRequiredNotes
purchaseOrderPurchaseOrderDrillyes
redactedItemCountintegeryes
billingAlertBillingAlertno
xeroAlertXeroAlertno

Quote ​

A Xero sales quote. status is the RAW Xero status (DRAFT/SENT/DECLINED/ACCEPTED/INVOICED/DELETED). Money fields are canonical decimal strings in the quote's own currency; total is tax-inclusive. subTotal, totalTax and totalDiscount are null when Xero did not send them — never "0". Quotes do not feed the forecast.

FieldTypeRequiredNotes
idstringyes
externalIdstringyesXero QuoteID (GUID).
quoteNumberstringyesXero QuoteNumber (e.g. "QU-0042"). Editable and NOT unique in Xero.
referencestringyesXero Reference (free-form).
titlestringyes
summarystringyes
contactIdstringyesCustomer Xero contact GUID.
contactNamestringyes
statusstringyesRaw Xero status: DRAFT, SENT, DECLINED, ACCEPTED, INVOICED, or DELETED.
issueDatestring (date-time)yes
expiryDatestring (date-time)yes
subTotalstringyesTotal before tax; null when Xero did not send it.
totalTaxstringyesTax total; null when Xero did not send it.
totalDiscountstringyesDiscount total; null when Xero did not send it.
totalstringyesGross, tax-inclusive total.
currencystringyes
lineAmountTypesstringyesWhether line amounts are tax EXCLUSIVE, INCLUSIVE or NOTAX.
createdBystringyesName of the person who raised the quote in Xero. Derived from Xero's quote history (Xero has no creator field on the quote); null until that history has been fetched, or when Xero has no such event. This is who created the quote, which is not always the deal owner.
createdAtstring (date-time)yesWhen the quote was created in Xero (from the quote history's Created event) — NOT when CashRunway first stored it. null until the history has been fetched.
lastEditedBystringyesName of the person who last edited or revised the quote, from Xero's quote history. null until the history has been fetched, or when the quote has never been edited.
lastEditedAtstring (date-time)yesWhen the quote was last edited or revised, from Xero's quote history. null under the same conditions as lastEditedBy.
lastSentBystringyesName of the person who last sent the quote (or marked it as sent), from Xero's quote history. null until the history has been fetched, or when the quote has never been sent.
lastSentAtstring (date-time)yesWhen the quote was last sent, from Xero's quote history. null under the same conditions as lastSentBy.

QuoteLine ​

One quote line. Numerics are decimal strings. Only these seven fields are ever returned; quote lines carry no account code.

FieldTypeRequiredNotes
descriptionstringno
quantitystringno
unitAmountstringno
lineAmountstringno
discountRatestringno
taxAmountstringno
itemCodestringno

QuoteDrill ​

any

QuotesResponse ​

FieldTypeRequiredNotes
quotesarray of Quoteyes
nextCursorstringyes
totalCountintegeryesQuotes matching the filters that this key may see (sensitive contacts excluded without READ_SENSITIVE).
redactedItemCountintegeryes0 or 1. 1 means this organisation has quotes that are withheld from this key because their customer is marked sensitive. It does not depend on the request's filters and is not a count. Always 0 when the key carries READ_SENSITIVE.
truncatedbooleanno
totalsInvoiceBillTotalsno
totalsTruncatedbooleanno
billingAlertBillingAlertno
xeroAlertXeroAlertno

QuoteDrillResponse ​

FieldTypeRequiredNotes
quoteQuoteDrillyes
redactedItemCountintegeryes
billingAlertBillingAlertno
xeroAlertXeroAlertno

DailySummaryContactEvent ​

A single inflow or outflow event from the trailing 7-day window. contactName is rewritten to "Sensitive contact" when the underlying contact is flagged sensitive and the key lacks READ_SENSITIVE; amount is NEVER masked.

FieldTypeRequiredNotes
contactNamestringyes
amountstringyes
datestring (date-time)yesISO timestamp of the actual money-moved date (CashItem.actualDate).

SummaryBucket ​

FieldTypeRequiredNotes
countintegeryes
amountstringyes

SummaryMonthBucket ​

FieldTypeRequiredNotes
monthstringyesCalendar month in the org's Organization.timezone (IANA, default Australia/Sydney), formatted YYYY-MM. NOT UTC - a late-evening Sydney transaction lands in the local month, not the prior UTC one.
countintegeryes
amountstringyesEx-GST amount in the org's base currency (per the line splitter).

SummaryTopContact ​

FieldTypeRequiredNotes
contactIdstringyesXero contact external id. Blank when the contact is sensitive AND the key lacks READ_SENSITIVE (paired with name = 'Sensitive contact').
namestringyesContact display name. Rewritten to Sensitive contact for non-sensitive-scope keys (redact mode; amount + count preserved).
countintegeryes
amountstringyes

RevenueSummaryResponse ​

Aggregate AR summary for an org. PAID values are ex-GST (cash-basis P&L), reconciles to Xero within +-1%. AUTHORISED values are gross (what's owed). grandTotal is PAID-only - the byStatus buckets do NOT sum to it.

FieldTypeRequiredNotes
asOfDatestring (date)yes
currencystringyes
windowobjectyes
grandTotalSummaryBucketyes
byStatusobjectyesKeyed by Xero invoice status (PAID, AUTHORISED, ...). PAID = ex-GST cash-basis per the line splitter. AUTHORISED = gross outstanding amounts from source-doc rows.
byMontharray of SummaryMonthBucketyes
topContactsarray of SummaryTopContactyes
redactedItemCountintegeryesNumber of topContacts rows whose name was rewritten to Sensitive contact. Always 0 when the key carries READ_SENSITIVE. Other aggregates (byMonth, byStatus, grandTotal) are NEVER masked.
grossProfitobjectyesOrg-wide gross profit. COGS is derived from per-line P&L coding on Xero bill lines (accounts typed DIRECTCOSTS), NOT bank-feed category descriptors. This is a STABLE trailing-window reading (buffered last-3-full-months) and intentionally does NOT honour the request's dateFrom/dateTo — it reports the org's structural margin, not the margin over the requested window. The same number drives the dashboard GP% panel and the customer LTV card. Present only on the revenue summary (the expenses summary has no gross-profit reading).
billingAlertBillingAlertno
xeroAlertXeroAlertno

CohortSummaryResponse ​

Acquisition-cohort KPI summary. Four headline KPIs (new customers, repeat-order rate, avg revenue/customer, 90-day retention) each with a period-over-period delta vs the immediately preceding 6-month window, the top-3 cohorts by M3 retention, and plain-English notesForAgent. Cohorts aggregate by acquisition month, so no per-contact rows are emitted (redactedItemCount is always 0). window.from/to span the full loaded cohort history (up to 24 acquisition months); KPI deltas compare the most-recent 6-month half vs the prior 6-month half.

FieldTypeRequiredNotes
asOfDatestring (date)yes
currencystringyes
windowobjectyesSpan of the loaded cohort history. from is the earliest acquisition month, to is the latest. Both are YYYY-MM month strings (not full dates). Empty string when the org has no cohorts yet.
kpisobjectyesThe four headline cohort KPIs. Each is a {value, delta, deltaKind} tuple; delta is the period-over-period change and is null when there is no prior base to compare against.
topCohortsarray of CohortTopEntryyesUp to three cohorts ranked by M3 (90-day) retention.
redactedItemCountintegeryesAlways 0 — cohorts aggregate by acquisition month, so no per-contact name is ever masked. Present for envelope parity with the other summary endpoints.
notesForAgentarray of AgentNoteyes

CohortKpi ​

A single cohort KPI: its current value, the period-over-period delta (null when there is no prior base), and the deltaKind describing how to read the delta.

FieldTypeRequiredNotes
valuenumberyesThe KPI's current value. A count for newCustomers, a fraction in [0,1] for repeatOrderRate/retention90d, and an amount for avgRevenuePerCustomer.
deltanumber,nullyesPeriod-over-period change, or null when there is no prior base. Read per deltaKind: a rate delta is a relative fraction (0.15 = +15%); a pct delta is an absolute percentage-point change.
deltaKindstring · one of pct rateyesrate → delta is a relative change fraction; pct → delta is an absolute percentage-point change.

CohortTopEntry ​

One entry in topCohorts — an acquisition month, its cohort size, and its M3 (90-day) retention fraction.

FieldTypeRequiredNotes
acquisitionMonthstringyesAcquisition month, YYYY-MM.
cohortSizeintegeryesDistinct customers first seen in the cohort month.
retention3numberyesM3 retention fraction in [0,1] — the share of the cohort still active 90 days after acquisition.

CohortRetentionResponse ​

The FULL acquisition-month × period-offset cohort matrix — the raw grid behind the analytics cohort heatmap. Each cohort row carries its per-offset values, projected into one of three metrics via ?metric=. The not-yet-elapsed sentinel (null) is preserved verbatim for every metric, so an agent can distinguish 'offset has not happened yet' from a real churned-to-zero (0 / "0"). Cohorts aggregate by acquisition month — no per-contact PII is on the wire (redactedItemCount is always 0) and raw-matrix responses carry no notesForAgent (use /cohorts/summary for narrative insight).

FieldTypeRequiredNotes
asOfDatestring (date)yes
currencystringyes
metricstring · one of retention customers revenueyesWhich metric cohorts[].values[] is projected into. retention (default) = survival fraction 0–1; customers = distinct transacting customers (integer); revenue = cohort revenue as a canonical decimal string.
periodLabelsarray of stringyesColumn headers for the offset grid, e.g. ["M0","M1",…]. Length matches each cohort's values length (capped by ?periods=).
cohortsarray of CohortRetentionRowyes
redactedItemCountintegeryesAlways 0 — cohorts aggregate by acquisition month, so no per-contact name is ever masked.
notesForAgentarray of AgentNoteyesAlways empty for the raw matrix — use /cohorts/summary for narrative insight.

CohortRetentionRow ​

One acquisition-month cohort row of the retention matrix.

FieldTypeRequiredNotes
cohortstringyesAcquisition month, YYYY-MM.
customersintegeryesDistinct customers first seen in the cohort month.
revenuestringyesCanonical decimal string — total revenue summed across every elapsed offset for the cohort.
activeNowintegeryesDistinct customers from the cohort that are still active as of asOfDate.
valuesarray of number,string,nullyesPer-offset projection of the selected metric, aligned to periodLabels. number for retention, integer-valued number for customers, decimal string for revenue, and null for offsets that have not yet elapsed for this cohort.

ExpensesSummaryResponse ​

AP-side mirror of RevenueSummaryResponse. Same shape, same reconciliation guarantees (ex-GST PAID per splitter, gross AUTHORISED).

FieldTypeRequiredNotes
asOfDatestring (date)yes
currencystringyes
windowobjectyes
grandTotalSummaryBucketyes
byStatusobjectyes
byMontharray of SummaryMonthBucketyes
topContactsarray of SummaryTopContactyes
redactedItemCountintegeryes
billingAlertBillingAlertno
xeroAlertXeroAlertno

ContactsSummaryResponse ​

Contact-population aggregates. byType + abcDistribution are population counts (never masked). topByRevenue + topBySpend rows are subject to name redaction.

FieldTypeRequiredNotes
asOfDatestring (date)yes
currencystringyes
byTypeobjectyes
abcDistributionobjectyes
topByRevenuearray of SummaryTopContactyesTop customers by TrendBaseline.ltvCumulative (cumulative gross-profit LTV).
topBySpendarray of SummaryTopContactyesTop suppliers by aggregate XERO_BILL gross amounts. The per-supplier spend baseline isn't materialised in TrendBaseline yet (only fills customer LTV); v1 computes this in-memory at request time.
redactedItemCountintegeryesAggregate count of topByRevenue + topBySpend rows whose name was rewritten to Sensitive contact. Always 0 with READ_SENSITIVE.
billingAlertBillingAlertno
xeroAlertXeroAlertno

DailySummaryResponse ​

Composite agent-facing daily summary — the 'how's the business doing today?' surface. Combines cash position, last-7d activity, AR aging snapshot, 13w forecast headline, agent notes, and a deterministic prose narrative an LLM can read verbatim. Totals across the response reconcile against the operator's ledger regardless of scope; only display names are gated by sensitive-data redaction (redactedItemCount is the aggregate sum across topInflows + topOutflows).

FieldTypeRequiredNotes
orgNamestringyes
generatedAtstring (date-time)yes
asOfDatestring (date)yes
cashTodayobjectyes
bankAccountsintegeryes
last7dobjectyes
arobjectyes
forecast13wobjectyes
narrativestringyesDeterministic LLM-ready 2-4 sentence prose summary. Threshold-driven phrasing for the 7-day net signal (net positive / net negative / roughly flat).
notesForAgentarray of AgentNoteno
redactedItemCountintegeryesSum of topInflows[] + topOutflows[] rows whose contactName was rewritten to "Sensitive contact". Always 0 when the key carries READ_SENSITIVE. Totals (net, in, out, AR bands, cashToday) are NEVER masked.
billingAlertBillingAlertno
xeroAlertXeroAlertno

Released under a proprietary license. · cashrunway.ai