Send Customer Statement
POST/api/customers/:customer/send-statement
Emails the customer a statement of account with the PDF attached, and records the send in the communications log.
The statement is generated with the same parameters as the statement endpoints: type (required — open_item or activity), from/to (required when type=activity), and as_at (open_item only).
The recipient defaults to the customer's billing email, falling back to their primary email; pass recipient to override. subject and body are optional templates; these placeholders are replaced before sending: {customer_name}, {total_due} (the statement's closing balance or net receivable, formatted with currency), {days_overdue}, and {payment_instructions} (the account's configured payment instructions). When omitted, a default subject and body are used.
Returns the logged communication entry.
Body parameters:
- type (string, required):
open_itemoractivity. - from (date): Period start. Required when type is
activity. - to (date): Period end, on or after
from. Required when type isactivity. - as_at (date, optional):
open_itemonly — include only documents dated on or before this date. - recipient (string, email, optional): Override the destination email address.
- subject (string, max 255, optional): Email subject template.
- body (string, max 10000, optional): Email body template.
Errors:
- 422 when
typeis missing,from/toare missing for the activity view, or no recipient email can be resolved (the customer has no billing or primary email and norecipientwas supplied).
Authentication: Requires Bearer token (PAT). Requires permission customers.send_communications and a token with the orders scope. Rate limited to 60 requests per minute.
The activity statement date range cannot exceed 366 days.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.