POST
/hyax-api/v1/checkout-sessionsCreate a checkout session
Creates a checkout bound to one buyer and returns the URL to send them to. The product must be published and fixed-price (`SINGLE`). If it has several variants, pass `variantId`. `url` is null when the store has no public domain or subdomain yet — the `path` is still valid on any host that serves the store.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
email | Required | The buyer's email. Locked on the checkout page; the server refuses any other email. |
externalUserId | No | Your own user id for this buyer. Returned on `order.created` as `data.externalUserId`. |
name | No | Buyer's display name |
productId | Required | Product ID or slug |
variantId | No | Variant ID or SKU code. Required when the product has more than one variant. |
quantity | No | Integer 1–99 (default 1) |
allowedPaymentMethods | No | Array of `"card"` | `"crypto"`. Restricts the picker; default is every method the store has enabled. |
successUrl | No | https URL the buyer is sent to after paying |
cancelUrl | No | https URL for "go back" on the checkout and on expired/canceled pages |
metadata | No | Up to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500). Echoed unchanged on `order.created` as `data.metadata`. |
expiresInMinutes | No | Integer 15–10080. Default 1440 (24 hours). |
Request
curl -X POST 'https://platform.hyax.com/hyax-api/v1/checkout-sessions' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"externalUserId": "user_8f3a",
"productId": "pro-credits-1000",
"successUrl": "https://kinku.com/billing?status=paid",
"cancelUrl": "https://kinku.com/billing",
"metadata": {
"plan": "pro"
}
}'Response
{
"success": true,
"data": {
"id": "cs_clx…",
"url": "https://shop.example.com/pay/cs_3nW…",
"path": "/pay/cs_3nW…",
"status": "OPEN",
"email": "[email protected]",
"name": null,
"externalUserId": "user_8f3a",
"productId": "clx…",
"variantId": "clx…",
"quantity": 1,
"allowedPaymentMethods": [],
"successUrl": "https://kinku.com/billing?status=paid",
"cancelUrl": "https://kinku.com/billing",
"metadata": { "plan": "pro" },
"expiresAt": "2026-09-15T18:41:00.000Z",
"completedAt": null,
"createdAt": "2026-09-14T18:41:00.000Z",
"paymentPlatform": null,
"order": null
}
}