---
title: "Buy a credit pack"
method: POST
path: "/v1/billing/checkout"
tags: ["billing"]
---

# Buy a credit pack

`POST /v1/billing/checkout`

## Request

- Base URL: `https://api.xdataapi.io`
- URL: `https://api.xdataapi.io/v1/billing/checkout`
- Auth: one of:
  - API key in header `x-api-key`
  - OAuth 2 (authorization code, authorization URL `https://xdataapi.io/oauth/authorize`, token URL `https://xdataapi.io/api/oauth/token`, scopes: `read`)

Returns a Stripe Checkout URL. Open it in a browser; after payment the credits land in the wallet of the
key's account within seconds. The rate limit follows the total paid over the account's life and only
goes up (see `rate_limits` on `/v1/billing/packs`). Credits never expire.

## Request body

- object
  - `pack` 'starter' | 'builder' | 'growth' | 'scale', required

## Response `200`

Checkout URL

- object
  - `url` string, uri
  - `pack` string
  - `usd` integer
  - `credits` integer
  - `request_id` string

## Other responses

- `400`: The request itself is wrong: a bad parameter, cursor or body. Free.
- `401`: Missing or invalid key. Free.
- `429`: Per-account rate limit. Free. Retry after `Retry-After` seconds.
- `500`: A fault on our side. Free. Quote `request_id` if it persists.
- `503`: Card checkout not open yet.

---

[API](https://skmtc.dev/xdataapi/apis/xdataapi-io-api.md) · [All operations](https://skmtc.dev/xdataapi/apis/xdataapi-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/xdataapi/apis/xdataapi-io-api/revisions/90cd2c0db55a?raw)
