Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A contact session token, uk_ct_…. Belongs to one of the developer's own users, and reads only that user's data.

Headers

X-Customer-Id
string<uuid>

The customer this call is acting inside — the same arrangement as X-Organization-Id, one plane down. Switching customers is navigation, not a mutation: nothing is stored, you send a different header, and the membership JOIN behind it decides what you may do there. An id you are not a member of matches no row and answers 404. Absent, the contact's oldest membership answers.

Idempotency-Key
string

A key you choose that makes starting a checkout safe to retry, end to end.

A repeat under the same key does not start a second checkout: it answers the same subscription and the same gateway session as the first attempt, with Idempotent-Replay: true. That is what a lost response needs — the first attempt's session is live and payable, and the answer that went missing carries the only id tying a payment to a row.

The key names one act. Sent with a different customer, price or quantity it is refused (422, idempotency_key_reused), and once the checkout it started has been paid it is refused (409, checkout_already_completed) rather than putting a second session in front of somebody who is already subscribed. Send a fresh key per checkout you mean to start: two checkouts for one customer on one price are two real checkouts, and the key is the only thing that can say otherwise.

It is forwarded to the gateway as its idempotency key too, so the retry and the original arrive there as one request. Retry with the body unchanged — the gateway compares every parameter, including success_url and cancel_url, and answers a mismatch with a refusal of its own.

Maximum string length: 255

Body

application/json
price_id
string<uuid>
required

A price from the public pricing read.

success_url
string<uri>
required

Where the payer lands after paying. Required, http(s) only.

cancel_url
string<uri>

Where they land if they back out. Optional.

provider
enum<string>

Which gateway, only when the environment has more than one connected.

Available options:
stripe

Response

Where to send the browser. subscription is present for a recurring price and absent for a one-time purchase — a payment has no subscription behind it.

subscription
object

The pending subscription (status incomplete), for a recurring price only.

checkout
object