Skip to main content
Start a credit purchase through Checkout or a saved card

Authorizations

Authorization
string
header
required

BoxRouter API key; never an upstream provider key.

Headers

Idempotency-Key
string
required

Required caller-generated identifier for one logical mutation. Preserve it when retrying an uncertain response; never reuse it for new work. Do not include credentials or payloads. Stable identifier for one logical mutation.

Required string length: 1 - 128

Body

application/json
payment_method_id
string
required

Optional saved card to charge immediately. Omit to use hosted Checkout.

Pattern: ^pm_[A-Za-z0-9_]+$
amount_minor
integer
required

Top-up in whole US cents, within purchase_bounds_minor.

Required range: x >= 1
expected_total_minor
integer

Required for in-page card purchases; the total from the latest quote. A changed total returns 409 quote_changed with the current quote.

Required range: x >= 1
success_url
string<uri>

URL on the BoxRouter website the payer returns to after paying; other origins are rejected. {PURCHASE_ID} is replaced. Returning here does not establish payment.

Maximum string length: 2048
cancel_url
string<uri>

URL on the BoxRouter website the payer returns to after abandoning Checkout; other origins are rejected. {PURCHASE_ID} is replaced.

Maximum string length: 2048

Response

Checkout purchase, saved-card purchase awaiting authentication, or saved-card purchase confirmed paid.

id
string
required
status
string
required

pending until the payment provider's verified notification arrives; confirmed once the payment has been verified; canceled when an unpaid Checkout session expires; failed when a saved-card attempt is definitively declined. Later refunds and disputes are separate adjustments and do not change this status. Clients must handle unknown values explicitly.

Allowed value: "pending"
amount_minor
integer
required

Credit added to the balance, in US cents. The purchase fee is never part of it.

Required range: x >= 1
currency
string
required
Allowed value: "usd"
created_at
string<date-time>
required
updated_at
string<date-time>
required
checkout_url
string<uri>
required

Hosted payment page for this purchase. Send the payer here.

fee_minor
integer

BoxRouter's fee for adding credits, in US cents, charged on top of amount_minor and never credited. Zero when the purchase carried no fee. Absent on older services.

Required range: x >= 0
total_minor
integer

amount_minor plus fee_minor, in US cents, before any tax. This is what the payer is asked to pay. Absent on older services.

Required range: x >= 1
method
enum<string>

How this purchase was started. New services report existing purchases as checkout; absent on older services.

Available options:
checkout,
saved_card,
auto_top_up
Allowed value: "checkout"
failure_reason
string
required if status = failed

Short safe description present only when a saved-card attempt failed.

Required string length: 1 - 100
adjustments
object[]

Later refunds, dispute adjustments and verified dispute outcomes, oldest first.

invoice
object

Present only after payment is confirmed and Stripe provides invoice links. Older purchases can have no invoice.

receipt_url
string<uri>

Stripe receipt for the confirmed payment; never returned for an unpaid purchase. Links can change.

refund
object

Self-serve refund eligibility and the newest refund. Present only when refund routes are enabled; never contains a stale quote.