跳转到主要内容
常用启润支付 API 操作的多语言完整代码示例。

创建产品

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": "充值 1000 个 AI API 额度",
    "price": 9.99,
    "currency": "USD",
    "metadata": {
      "credits": "1000"
    }
  }'

创建 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"
    }
  }'

查询订单列表

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

查询账户余额

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

验证 Webhook 签名

请参阅 Webhook 签名验证 页面,获取 Node.js、Python 和 Go 的完整验证示例。