Billing

Buy a credit pack (Stripe Checkout)

POST /v1/billing/checkout

Creates a Stripe Checkout session for a credit pack; open the returned url to pay. Credits are added when payment completes.

Example

cURL
curl -X POST 'https://staging.socialtap.dev/v1/billing/checkout' \
  -H "x-api-key: $SOCIALTAP_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "pack": "20k"
}'
x-api-keystringheaderrequired

Your API key. Authentication

NameTypeDescriptionExample
idempotency-key optionalstringOn any POST: your unique key for the request (1–255 printable ASCII characters; a UUID is ideal), kept 24 hours. Retrying with the same key and body never repeats the work: the answer is the first request's result, in its current state.—

On any POST: your unique key for the request (1–255 printable ASCII characters; a UUID is ideal), kept 24 hours. Retrying with the same key and body never repeats the work: the answer is the first request's result, in its current state.

Body

application/json

JSON. Fields marked nullable may be null; optional ones may be left out.

FieldTypeDescription
packstringPack ID.
One of 20k, 80k, 400k, 2m
packstring

Pack ID.

One of20k80k400k2m

Response

application/json

200

Checkout session

FieldTypeDescription
id?string
url?string
id?string
url?string

400

400 Bad Request.

CodeHTTPRetryMeaningWhat to do
invalid_input400NoThe request parameters are missing or malformed, or the URL is not a supported link for this endpoint.Fix the parameter named in param (the message says how); for a link of the wrong kind, call the endpoint the message names.

The request parameters are missing or malformed, or the URL is not a supported link for this endpoint.

Fix the parameter named in param (the message says how); for a link of the wrong kind, call the endpoint the message names.

401

401 Unauthorized.

CodeHTTPRetryMeaningWhat to do
unauthorized401NoThe x-api-key header is missing, unknown or revoked (or, on the dashboard's routes, the session cookie is missing or expired).Send a valid API key in the x-api-key header; without one, get a key at details.signup_url (AI agents: POST details.agent_signup_url).
unauthorizedNo retry

The x-api-key header is missing, unknown or revoked (or, on the dashboard's routes, the session cookie is missing or expired).

Send a valid API key in the x-api-key header; without one, get a key at details.signup_url (AI agents: POST details.agent_signup_url).

409

409 Conflict.

CodeHTTPRetryMeaningWhat to do
idempotency_key_in_progress409Yes, laterA request with this Idempotency-Key is still running.Retry after the number of seconds in the retry-after header to get that request's result.

A request with this Idempotency-Key is still running.

Retry after the number of seconds in the retry-after header to get that request's result.

422

422 Unprocessable.

CodeHTTPRetryMeaningWhat to do
idempotency_key_reused422NoThe Idempotency-Key was already used with a different request (another route, or another body).Send a new Idempotency-Key for a different request; reuse a key only to retry the identical request.

The Idempotency-Key was already used with a different request (another route, or another body).

Send a new Idempotency-Key for a different request; reuse a key only to retry the identical request.

A test key gets a placeholder session (no Stripe call, nothing to pay).

operationId billing.checkout.create