Skip to main content
POST
/
billing
/
api
/
v1
/
billing
/
checkout
Create checkout session
curl --request POST \
  --url https://www.closient.com/billing/api/v1/billing/checkout \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "organization_id": "<string>",
  "amount_cents": 501,
  "success_url": "<string>",
  "cancel_url": "<string>"
}
'
{
  "checkout_url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for opening a prepaid ad-balance Checkout session.

organization_id
string<shortuuid>
required

UUID of the organization the action targets. The caller must be a member of this organization (read endpoints) or hold the BILLING role / be an owner (write endpoints) — the API returns 403 otherwise.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
amount_cents
integer
required

Amount to add to the organization's prepaid ad balance, in the smallest currency unit (cents for USD). Minimum is 500 (USD $5.00); the API returns 400 for smaller amounts. Stripe Checkout enforces its own per-payment-method ceilings on top of this floor.

Required range: x >= 500
success_url
string
required

Absolute URL Stripe redirects the customer to after a successful payment or subscription start. May contain Stripe session-id placeholders such as {CHECKOUT_SESSION_ID} for downstream confirmation flows.

cancel_url
string
required

Absolute URL Stripe redirects the customer to if they abandon Checkout. Should land on a page that explains how to retry — Stripe does not automatically resume an abandoned session.

Response

200 - application/json

OK

Response for POST /billing/checkout and POST /billing/resolver/checkout.

checkout_url
string
required

Stripe-hosted Checkout URL the caller should redirect the end user to. Single-use; expires after 24 hours per Stripe's session policy.