Skip to main content

Request Sales Order Payment

POST 

/api/sales-orders/:salesOrder/request-payment

Email the order's customer a payment request for the order's outstanding balance, and record the send in the customer's communications log. Send sales_invoice_id to request payment of one issued invoice of the order instead — the amount is that invoice's balance due and the email names the invoice.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body (all optional)

  • recipient (email): override the destination; defaults to the customer's billing email, then their primary email
  • subject (string, up to 255) and body (string, up to 10,000): email templates. Placeholders: {customer_name}, {order_number}, {amount_due}, {days_overdue}, {invoice_number}, {due_date}, {total_due}, {payment_instructions}. Defaults: "Payment Request — Order {order_number}", or "Payment Request — Invoice {invoice_number}" with sales_invoice_id
  • attach_invoice (boolean, default false): attach a PDF of what is outstanding on the order (or on the invoice)
  • sales_invoice_id (integer): an issued invoice of this order to request payment for

Returns the logged communication (scope is order, or invoice with sales_invoice_id). Returns 422 when the order or invoice has no outstanding balance, has no linked customer, no recipient email can be found, the invoice is not issued, or the invoice belongs to another order.

Requires orders:write and the sales_orders.index, customers.show and customers.send_communications permissions. Rate limited to 60 requests per minute.

Request​

Responses​

OK

Response Headers
    Content-Type