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).
post
https://api-dev.gettrx.com/onboard/v1/invoices//pay-invoice
