Pay an invoice by ID

Attempts to pay an open invoice by ID, or marks it (and any related invoices) as paid out-of-band. The invoice must be valid, not soft-deleted, and belong to the merchant account resolved from the secret key. Request body — paymentMethod / paidOutOfBand: - paymentMethod is conditionally required. Only required and allowed when paidOutOfBand is null or false. Must be a payment method associated with the customer on the invoice. - paidOutOfBand is optional. When true, the invoice (and any related invoices) is marked as paid without actually attempting a payment. Not allowed alongside paymentMethod unless paidOutOfBand is explicitly false. Invoice payment process: - The invoice is retrieved and the customer is charged for the total amount on the invoice using the supplied paymentMethod. - Payment method validation: - paymentMethod must be a supported payment method type for the invoice (must satisfy the invoice paymentMethodTypes configuration). Otherwise, a validation error is returned. - paymentMethod must belong to the invoice's customer. Otherwise, a validation error is returned. - Paid out-of-band exception: when paidOutOfBand is true, no payment request is executed against the processor. The invoice (and any related invoices) is simply transitioned to paid because the merchant has collected payment outside the platform. Subscription re-activation: if the invoice being paid is the same as the subscription's latestInvoice and the subscription is currently in incomplete, past_due, or unpaid, the subscription is transitioned back to active on successful payment (or successful out-of-band settlement). This rule does not apply when the subscription status is active, canceled, or incomplete_expired — those statuses are left unchanged. Response data matches GET invoice by id (same shape as /finalize, /void, and /mark-uncollectible).

Path Params
string
required
length between 10 and 128

Invoice ID (e.g. inv_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u). Must be valid, not soft deleted, and belong to the merchant account.

Body Params

Request body for pay-invoice. - paymentMethod: Conditionally required. Only required and allowed when paidOutOfBand is null or false. Must be a payment method associated with the customer on the invoice. - paidOutOfBand: Optional. When true, the invoice (and any related invoices) is marked as paid without actually attempting a payment. Not allowed alongside paymentMethod unless paidOutOfBand is explicitly false.

string

Payment method that will be used to pay the open invoice. Must be associated with the customer. Conditionally required: only required and allowed when paidOutOfBand is null or false.

boolean

Determines whether to actually attempt to run a payment, or to just update the invoice status to paid (along with any related invoices). Not allowed alongside paymentMethod unless the value is set to false.

string
length between 0 and 1024

Optional. At most 1024 characters. Not used when paidOutOfBand is true.

Headers
string
required

Secret key associated to the partner's account (e.g. sk_age14sf40sSwfchDsaetaqsgh3001e4gf2ed).

string

(Optional) AccountId of the merchant that will own the site (e.g. acm_********). Conditionally required when secretKey belongs to an "entity" account.

string

Unique Key String refNumber

string

Unique key generated by the partner (e.g. 490ff93e-8a73-4aa4-a02b-9d9251f91243)

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json