Skip to main content
POST
/
api
/
v1
/
checkout
/
sessions
Create Checkout Session
curl --request POST \
  --url https://api.example.com/api/v1/checkout/sessions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "success_url": "<string>",
  "cancel_url": "<string>",
  "customer_email": "jsmith@example.com",
  "customer_name": "<string>",
  "metadata": {}
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "code": "<string>",
  "checkout_url": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z"
}

Headers

x-api-key
string
required

Body

application/json
plan_id
string<uuid>
required
success_url
string
required
cancel_url
string
required
customer_email
string<email> | null
customer_name
string | null
metadata
Metadata · object | null

Response

Successful Response

id
string<uuid>
required
code
string
required
checkout_url
string
required
status
enum<string>
required
Available options:
PENDING,
COMPLETED,
EXPIRED,
CANCELLED
expires_at
string<date-time>
required
plan_id
string<uuid>
required
created_at
string<date-time>
required