Create an invoice
Creates an ad-hoc invoice for a customer. Callers can supply line items, a billing period, purchase order number, and an initial status (draft or issued). Requesting issued releases the invoice for issuance, which completes asynchronously — the response returns the invoice in processing and it settles to issued shortly after, observable via the Get Invoice endpoint. Alternatively, pass tax_calculation_id to turn a persisted tax calculation into an invoice: its line items, tax, and buyer are pinned and the invoice is issued synchronously; add a payment and status: paid to record settlement and mark it paid in the same call.
Authorizations
Headers
A unique string that makes a retried write safe. If you send the same request with the same key within 24 hours, the API returns the stored response and does not run the request again. A 5xx or 429 response is not stored, so a retry with that key runs the request again.
255"ik_a1b2c3d4e5f6"
Body
Existing sub-merchant the invoice is issued for; you remain the seller of record. Create the merchant before referencing it here. Optional alongside tax_calculation_id, where it must match the merchant the calculation was made for. Requires the merchants entitlement
"mrch_01H8XGJWBWBAQ4PLwXYZ"
Initial invoice status. Defaults to draft. Setting issued releases the invoice for issuance, which completes asynchronously: the response returns the invoice in processing, and it settles to issued shortly after — poll the Get Invoice endpoint to observe the final status. paid is only valid on the tax_calculation_id path and must be sent together with a payment.
draft, issued, paid Id of a persisted tax calculation; its stored line items, tax amounts, and buyer become the invoice, which is issued synchronously with no recalculation. Mutually exclusive with line_items (the calculation supplies them). Leave status unset or set it to issued to issue the invoice; set status to paid together with a payment to also mark it paid.
Response
Success
When auto-pay charges the invoice. Before issue, it is null when the invoice inherits the value of its subscription or customer. At issue, the resolved value is saved on the invoice. Invoices issued without a value are charged when they are issued.
on_issue, on_due_date "on_due_date"