Customer statement
customer_statementOne customer's statement of account — the same rows, running balance and closing figure as the Statement PDF on the customer's page. Give customerId (from resolve_customer) or customer (a name, resolved like open_invoices: an ambiguous name returns candidates — ask which one). Optional from / to (YYYY-MM-DD). Each line in lines is what the PDF prints, in its order: document (an invoice, credit note or debit note — charge is what it put on the customer's account, which can be LOWER than the invoice total, e.g. a marketplace order's net payout, and is negative on a credit note), payment (money applied to the document above it, on or before to), and on_account (a payment received but not yet applied — in payment — or a refund paid out and not applied — in charge). balance is the running balance after each line and closingBalance the TOTAL OUTSTANDING the PDF prints. With no from, the statement covers the whole history and its closing equals the customer's A/R aging total as of to (except where a bank line was matched to invoices for more than it booked to A/R — an internal fix on that bank line, never printed for the customer). With from, it lists only documents and on-account payments dated from then, with NO balance brought forward, so its closing is the period's own figure — say so. With no to, the statement runs to the later of today and the customer's latest document or payment; period states the dates used. Lines are capped at 300; when more is true the closing and totals are still exact — give a later from to see the rest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| customer | No | A customer name, resolved against this company's customers. | |
| customerId | No | The customer id from resolve_customer. Give this OR `customer`. |