Skip to main content
POST
Buy credits with the saved card or bank account

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
amount_cents
integer
required

What to pay

Required range: x >= 1
expected_credit_cents
integer
required

The credits the page quoted

Required range: x >= 1
purchase_key
string<uuid>
required

Caller-supplied UUID naming this purchase

terms_version
string
required

The purchase terms version shown before Buy.

expected_surcharge_cents
integer

The credit card fee the page showed, in cents, charged on top of amount_cents. Left out means the page showed no fee.

Required range: x >= 0
expected_payment_method_key
string

The payment_method.key the page showed. A new purchase is refused (409 quote_changed, details.payment_method_changed true, nothing reserved) when the saved method is another. A repeat of a purchase_key already used charges the method that purchase was reserved on. Left out means the method is not checked.

Minimum string length: 1

Response

A repeat of the purchase key; the first purchase

credit_purchase
object
required

One purchase of credits: what was paid, what it granted, and where its money stands. succeeded means the credits were granted; processing means the payment is still settling. origin is manual (the merchant bought), auto_reload (a low balance bought), or settlement (a charge for what a credit-billed company owes, with any auto-reload top-up).

balance_cents
integer
required

The credit balance after the purchase

duplicate
boolean
required

Whether this returns a purchase already made with the same key.

next_action
object | null
required

Set while credit_purchase.action_required: confirm the payment with the cardholder's bank. Null otherwise, and when Stripe could not be read (then GET the purchase's authentication).