Orders

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.

post/v1/invoices/{invoice_id}/pay

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_idinteger required

Invoice id (from GET /invoices).

Headers

Idempotency-Keystring nullable

Request body

method'credit' | 'bank_transfer' | 'spt'

How to settle the invoice. credit = pay from your account balance, no browser step (returns 402 with the amount due if the balance doesn't cover the total). bank_transfer = leave the invoice unpaid and return a pay_url for a human to complete the payment in a browser. spt = charge a card with a Stripe Shared Payment Token supplied in shared_payment_token - a fully programmatic card payment for agents, no browser step. See shared_payment_token below.

shared_payment_tokenstring nullable

A single-use Stripe Shared Payment Token (spt_...) - required when method='spt', ignored otherwise. The buyer's agent obtains it from the buyer's payment provider, scoped to a specific amount and expiry; we charge that card directly and, on success, provision the same way as a credit payment. If the token's own limits are exceeded the charge is declined and the invoice stays unpaid.

Example request

{
  "method": "credit"
}

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.