建立產品
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"