Skip to main content
Complete code examples for common Kyren Pay API operations in multiple languages.

Create a Product

curl -X POST https://api.kyren.top/v1/products \
  -H "Content-Type: application/json" \
  -H "x-api-key: kyren_live_xxxxxxxxxxxx" \
  -d '{
    "name": "1000 AI Credits",
    "description": "Top up 1000 credits for AI API usage",
    "price": 9.99,
    "currency": "USD",
    "metadata": {
      "credits": "1000"
    }
  }'

Create a Checkout Session

curl -X POST https://api.kyren.top/v1/checkouts \
  -H "Content-Type: application/json" \
  -H "x-api-key: kyren_live_xxxxxxxxxxxx" \
  -d '{
    "productId": "prod_abc123",
    "successUrl": "https://yoursite.com/success",
    "cancelUrl": "https://yoursite.com/cancel",
    "customerEmail": "customer@example.com",
    "metadata": {
      "userId": "user_456"
    }
  }'

List Orders

curl https://api.kyren.top/v1/orders?status=PAID&page=1&size=10 \
  -H "x-api-key: kyren_live_xxxxxxxxxxxx"

Get Account Balance

curl https://api.kyren.top/v1/balance \
  -H "x-api-key: kyren_live_xxxxxxxxxxxx"

Verify Webhook Signature

See the Webhook Signatures page for complete verification examples in Node.js, Python, and Go.