CustomDomain™ docs
API referenceBilling

Record a completed plan checkout now (owners and admins)

POST
/billing/checkout:confirm

Called when Stripe returns the browser from a completed Checkout, so the subscription is recorded at once instead of when Stripe's checkout.session.completed event arrives. The session is read from Stripe, never trusted from the caller: it must belong to the caller's workspace (another workspace's session is a 404) and be complete and paid (a trial's "no payment required" counts); otherwise confirmed is false and nothing changes. Idempotent with the webhook. Requires billing:manage.

AuthorizationBearer <token>

Long-lived tenant API key, cd_live_… (production) or cd_test_… (staging, development), stored hashed. Keys created before the switch to cd_ start with sk_live_… / sk_test_… and are still accepted. Scoped to the owning application's tenant.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/billing/checkout:confirm" \  -H "Content-Type: application/json" \  -d '{    "session_id": "cs_test_a1B2c3"  }'
{  "confirmed": true,  "session_status": "complete",  "payment_status": "paid",  "billing": {    "tenant_id": "string",    "state": "trialing",    "reason": "string",    "restricted": true,    "first_domain_free": true,    "attention": true,    "setup_required": true,    "days_left": 0,    "price_cents": 0,    "currency": "string",    "trial_ends_at": "2019-08-24T14:15:22Z",    "grace_started_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "current_period_end": "2019-08-24T14:15:22Z",    "cancel_at_period_end": true,    "ended_at": "2019-08-24T14:15:22Z",    "comped": true,    "comped_until": "2019-08-24T14:15:22Z",    "payment_failed": true,    "payment_failed_at": "2019-08-24T14:15:22Z",    "has_billing_account": true,    "portal_available": true,    "can_change_plan": true,    "mode": "test",    "plan": {      "id": "starter",      "name": "string",      "price_cents": 0,      "public_price": true,      "domains_per_year": 0,      "domains_per_month": 0,      "hard_cap": true,      "retired": true    },    "next_charge": {      "at": "2019-08-24T14:15:22Z",      "amount_cents": 0,      "currency": "string"    },    "checkout": {      "available": true,      "trial_days": 0,      "trial_end": "2019-08-24T14:15:22Z",      "first_charge_at": "2019-08-24T14:15:22Z",      "default_plan": "starter"    },    "usage": {      "used": 0,      "quota": 0,      "period_start": "2019-08-24T14:15:22Z",      "period_end": "2019-08-24T14:15:22Z"    },    "payment_method": {      "type": "card",      "brand": "string",      "last4": "string",      "exp_month": 0,      "exp_year": 0,      "wallet": "apple_pay",      "email": "string"    }  }}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}