Pay an invoice (credit, card token, or bank transfer)
Pay one of your unpaid invoices (e.g. the proforma from a just-placed order).
Three payment methods, all settling the invoice through the SAME engine the web panel uses - a successful payment triggers the exact same provisioning:
- credit - pay from your account balance, no browser step. Returns 402 with the amount due + pay_url if the balance doesn't cover the full total (nothing is deducted in that case).
- spt - charge a card programmatically with a Stripe Shared Payment Token (shared_payment_token), no browser step. Built for agentic checkout: the buyer's agent supplies a single-use, amount- and expiry-scoped token and we charge that card directly. Declined charges leave the invoice unpaid.
- bank_transfer - leave the invoice unpaid and return a pay_url for a human to finish the payment in a browser.
An Idempotency-Key header is REQUIRED. An already-paid invoice returns success without charging again (natural idempotency).
On success the response carries the issued VAT invoice: invoice_number (the fiscal document number - the proforma is converted in place to a VAT invoice on payment), document_type (vat), converted_from_proforma, and the amount breakdown (net = be PVM, vat, vat_rate %, gross = su PVM; total = gross).
There is no per-payment spend cap by default; one is applied only if the developer_api_max_charge setting is configured to a positive number.
Request
- Base URL: https://developers.servera.co.uk
- URL: https://developers.servera.co.uk/v1/invoices/{invoice_id}/pay
- Auth: HTTP bearer
Path parameters
Invoice id (from GET /invoices).
Headers
Request body
Example request
{
"method": "credit"
}Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.