Skip to main content
POST
Create a checkout session

Authorizations

X-Suby-Api-Key
string
header
required

Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).

Body

application/json
mode
enum<string>
required
Available options:
payment,
subscription
successUrl
string<uri>
required
cancelUrl
string<uri>
required
productId
string
Example:

"pro_abc123"

lineItems
object[]
Required array length: 1 - 20 elements
amount
integer
Required range: x >= 1
currency
string
Pattern: ^[A-Z]{3}$
displayName
string
Maximum string length: 200
taxBehavior
enum<string>

MoR VAT: exclusive (default) adds VAT on top → the hosted page shows the TTC; inclusive treats the price as VAT-inclusive. Signed into the session.

Available options:
inclusive,
exclusive
customerId
string
Example:

"cus_abc123"

customerEmail
string<email>
customerFirstName
string
Maximum string length: 100
customerLastName
string
Maximum string length: 100
discountCode
string
Maximum string length: 40
metadata
object

Key-value pairs. ≤50 keys, keys ≤40 chars, values are strings ≤500 chars (or null to clear). Nested structures must be JSON-stringified into a single string value.

customFields
object[]

Extra fields collected on the hosted checkout page (max 10).

Maximum array length: 10
expiresIn
integer

Session TTL in seconds (default 24h, max 7d).

Required range: 60 <= x <= 604800

Response

Checkout session created

success
boolean
required
Example:

true

data
object
required

Endpoint-specific payload.

message
string