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; GET /v1/billing/checkout/{id} follows it.

Example

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

Your API key. Authentication

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.

packstring

Pack ID.

One of1k30k250k2mstarter_topupgrowth_topupscale_topup

Response

application/json

200

Checkout session

id?string
url?string

400

400 Bad Request.

A parameter is missing or malformed, or the link is not one this endpoint takes.

Fix the parameter named in param as the message says. For a link of the wrong kind, call an endpoint listed in details.endpoints, when there is one.

401

401 Unauthorized.

unauthorizedNo retry

The x-api-key header is missing, or its key is unknown or revoked. On the dashboard's routes: the session cookie is missing or expired.

Send a valid API key in the x-api-key header. No key yet? A person gets one at details.signup_url; an AI agent follows details.agent_auth_url.

409

409 Conflict.

A request with this Idempotency-Key is still running.

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

422

422 Unprocessable.

This Idempotency-Key was already used for a different request (another route or body). Or it was used for this same request, which ran and returned a secret we no longer keep (details.reason answer_expired): running it again would create another.

Use a new Idempotency-Key for a different request, and reuse a key only to retry the identical request. With reason answer_expired, check what the first request created (GET /v1/api_keys, GET /v1/webhook_endpoints) before sending it again under a new key.

operationId billing.checkout.create