Skip to main content
POST
Buy top-up with saved card

Authorizations

Authorization
string
header
required

Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.

Headers

Idempotency-Key
string

A key you generate for this purchase, sent instead of or with the idempotency_key field.

Required string length: 8 - 100

Body

application/json

Request model for confirming a top-up purchase with a saved payment method.

payment_method_id
string
required

ID of the saved payment method to charge, from default_card_payment_method_id or payment_methods[].id in Get billing info.

Required string length: 1 - 200
Example:

"pm_1QxYz2AbCdEf3GhIjKlMnOpQ"

message_credits
integer
default:0

Message credits to buy: a multiple of 50, up to 400. Defaults to 0.

Example:

100

integration_credits
integer
default:0

Integration credits to buy: a multiple of 1,000, up to 8,000. Defaults to 0.

Example:

1000

idempotency_key
string | null

A key you generate for this purchase. Send a new one for every purchase. Required unless you send the Idempotency-Key header instead.

Required string length: 8 - 100
Example:

"topup-2026-10-25-7f3c9a1e"

Response

The card was charged, or the card owner has to pay through checkout instead.

status
enum<string>
required

charge_accepted when the payment went through. The credits are added shortly after. fallback_required when the card couldn't be charged without the card owner. Nothing is charged, and the card owner can pay with Create top-up checkout.

Available options:
charge_accepted,
fallback_required
Example:

"charge_accepted"

invoice_id
string

ID of the invoice for this purchase. Present only when status is charge_accepted.

Example:

"in_1QxYz2AbCdEf3GhIjKlMnOpQ"

reason
string

Why the card couldn't be charged. Present only when status is fallback_required. payment_confirmation_failed when the card was declined or the bank asked the card owner to authenticate. Otherwise it's the invoice's status, such as open.

Example:

"payment_confirmation_failed"