Skip to main content
POST
/
v1
/
sdk
/
checkout-sessions
Create a checkout session
curl --request POST \
  --url https://api.example.com/v1/sdk/checkout-sessions \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerRef": "cus_3C4D5E6F",
  "productRef": "prd_1A2B3C4D",
  "planRef": "pln_2b3c4d5e",
  "returnUrl": "<string>"
}
'
{
  "checkoutUrl": "<string>",
  "sessionId": "<string>"
}

Body

application/json
customerRef
string
required

Customer reference

Example:

"cus_3C4D5E6F"

productRef
string
required

Product reference

Example:

"prd_1A2B3C4D"

planRef
string

Plan reference (optional — shows plan selector if omitted)

Example:

"pln_2b3c4d5e"

returnUrl
string

URL to redirect after checkout

Response

Checkout session created

checkoutUrl
string

URL to redirect the customer to

sessionId
string

Checkout session ID