← Home
POST/hyax-api/v1/checkout-sessions

Create 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

FieldRequiredDescription
email Required The buyer's email. Locked on the checkout page; the server refuses any other email.
externalUserIdNoYour own user id for this buyer. Returned on `order.created` as `data.externalUserId`.
nameNoBuyer's display name
productId Required Product ID or slug
variantIdNoVariant ID or SKU code. Required when the product has more than one variant.
quantityNoInteger 1–99 (default 1)
allowedPaymentMethodsNoArray of `"card"` | `"crypto"`. Restricts the picker; default is every method the store has enabled.
successUrlNohttps URL the buyer is sent to after paying
cancelUrlNohttps URL for "go back" on the checkout and on expired/canceled pages
metadataNoUp to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500). Echoed unchanged on `order.created` as `data.metadata`.
expiresInMinutesNoInteger 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
  }
}