Skip to main content

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_item or activity.
  • from (date): Period start. Required when type is activity.
  • to (date): Period end, on or after from. Required when type is activity.
  • as_at (date, optional): open_item only — 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 type is missing, from/to are missing for the activity view, or no recipient email can be resolved (the customer has no billing or primary email and no recipient was 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

OK

Response Headers
    Content-Type