Send Invoice
POST/api/stripe/invoices
Creates, finalizes, and sends a Stripe Invoice for a sales order — or, with sales_invoice_id, for one issued sales invoice's balance due. Stripe emails the customer the hosted invoice link automatically. If a payable open invoice already exists for the sales order it is returned instead of creating a new one (idempotent).
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Fields:
integration_instance_id(required, integer) — the Stripe integration to charge throughsales_order_id(integer, required unlesssales_invoice_idis sent) — the sales order being invoicedsales_invoice_id(optional, integer) — send one sales invoice instead of the whole order: the default amount is the invoice's balance due, and the payment is allocated to that invoice when Stripe reports it paid.sales_order_idis then not needed. Returns 404 when the invoice does not exist and 422 when it is not issued, is not linked to a sales order, or has no outstanding balanceamount_in_cents(optional, integer, min 1) — override the order outstanding balance, in the currency's smallest unit; if omitted the full outstanding balance is invoicedcustomer_email(optional, email) — override the customer email on file (defaults to the sales order's customer email)
Rate limited: 30 requests/minute.
Returns 422 when the invoice is refused: the sales order has no outstanding balance, has no currency (and the Stripe account has no default currency), or has no valid customer email.
amount_in_cents is in the currency's smallest unit, as Stripe expects it: cents for USD/EUR (2-decimal currencies), whole units for zero-decimal currencies (¥1,000 → 1000 for JPY, also KRW, VND, CLP…), thousandths for three-decimal currencies (KWD, BHD, JOD, OMR, TND: 1.500 KWD → 1500). The default (outstanding balance / remaining refundable amount) is computed the same way.
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
- 502
Created
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
Response Headers
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.
Bad Gateway