API · Billing
A Stripe Checkout page for a credit pack.
POST /v1/billing/checkout
| Request | POST /v1/billing/checkout |
| Operation id | billing.checkout |
| Cost | Free |
| Auth | Dashboard session: Authorization: Bearer <session_token>. API keys are refused. |
Signed in: send account_id (you must be an owner or admin). With an API key: buys for the key’s own account, so an agent can pass the URL to its human. Credits are added when Stripe confirms payment.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | no | The account to buy for. Optional with an API key (its own account). |
pack | string | yes | One of starter, builder, scale, volume. |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | Open url to pay. | CheckoutSession |
400 | Unknown pack, or account_id missing. | Error |
401 | Not signed in, or an invalid API key. | Error |
403 | Not an owner or admin, or a key buying for another account. | Error |
404 | No such account among yours, or card purchases are off. | Error |
CheckoutSession fields
| Field | Type | Description |
|---|---|---|
url | string | Stripe Checkout page. Open it, or hand it to a person. |
session_id | string | |
pack | string | |
credits | integer | |
usd | string |
Errors use one shape everywhere; see Errors for every code and what to do.