Skip to main content
POST
/
v1
/
checkouts
Create a checkout session
curl --request POST \
  --url https://api.kyren.top/v1/checkouts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "productId": "prod_abc123",
  "successUrl": "https://example.com/success",
  "cancelUrl": "https://example.com/cancel",
  "customerEmail": "customer@example.com",
  "metadata": {
    "userId": "user_456"
  }
}
'
{
  "code": 0,
  "message": "success",
  "data": {
    "id": "cs_xyz789",
    "productId": "prod_abc123",
    "amount": 9.99,
    "currency": "USD",
    "status": "OPEN",
    "url": "https://payment.kyren.io/checkout/cs_xyz789",
    "expiresAt": "2026-01-15T11:00:00Z",
    "createdAt": "2026-01-15T10:30:00Z"
  }
}

Authorizations

x-api-key
string
header
required

Your API key. Use kyren_live_* for production and kyren_test_* for testing.

Body

application/json
productId
string
required

The ID of the product to create a checkout for

successUrl
string<uri>
required

URL to redirect the customer to after successful payment

cancelUrl
string<uri>

URL to redirect the customer to if they cancel the payment

customerEmail
string<email>

Pre-fill the customer's email on the checkout page

customerName
string

Pre-fill the customer's name on the checkout page

metadata
object

Arbitrary key-value pairs attached to the checkout and resulting order

Response

Checkout session created successfully

code
integer
Example:

0

message
string
Example:

"success"

data
object