Skip to main content

Preview Invoice Payment

POST 

/api/portal/invoices/pay-preview

Preview what Pay Invoices will charge before the buyer pays: the open balance of the selected invoices, the card surcharge (when the merchant charges one) and the total. Nothing is charged and nothing is saved. Only invoices on the active account are counted, and an invoice with nothing left to pay is ignored.

Buyer portal token

Called by a B2B portal buyer with the bearer token POST /api/portal/auth/login returns (or the buyer's feed key) — not with a staff Personal Access Token.

Body: invoice_ids (array of integers, required, 1-100) and method (string, required): card or echeck.

The surcharge follows the same rule as Pay Invoices: it is added per order-backed invoice when paying by card through Authorize.net and the merchant charges a card surcharge. eCheck (bank) payments, invoices not backed by an order, and Stripe-processed payments carry no surcharge (surcharge_amount: 0).

Response data: subtotal (open balance of the selected invoices, less money already on its way to their orders — an eCheck settling, or a held or not-yet-recorded charge — so it is what can still be paid now), surcharge_amount, total (subtotal + surcharge_amount, the amount the charge will be for) and currency_code. A refusal returns 422 with {error, reason, context}: nothing_owed when none of the selected invoices has an outstanding balance (including ids that are not on the active account); payment_processing when the selected invoices' whole balance is already being collected by another payment. A missing or invalid invoice_ids / method is a standard validation error. Rate limited to 60 requests/minute.

Request​

Responses​

OK

Response Headers
    Content-Type