請求頭
| 請求頭 | 必填 | 說明 |
|---|---|---|
Authorization | ✓ | Bearer YOUR_ACCESS_TOKEN,帳號訪問令牌(控制台登入態,非 sk- API Key) |
GET /api/user/topup/info
回傳當前站點的充值設定:可用支付方式、最低充值額、快捷金額、折扣,以及各類在線支付/兌換碼開關。前端充值頁據此渲染;發起在線支付(POST /api/user/pay)前先調用此介面拿到 pay_methods[].type。
curl "https://bearlab.ai/api/user/topup/info" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
"success": true,
"message": "",
"data": {
"enable_online_topup": true,
"enable_stripe_topup": false,
"enable_creem_topup": false,
"enable_waffo_topup": false,
"enable_waffo_pancake_topup": false,
"enable_redemption": true,
"payment_compliance_confirmed": true,
"payment_compliance_terms_version": 1,
"pay_methods": [
{ "name": "支付寶", "type": "alipay", "color": "rgba(var(--semi-blue-5), 1)", "min_topup": "1" },
{ "name": "微信", "type": "wxpay", "color": "rgba(var(--semi-green-5), 1)", "min_topup": "1" }
],
"waffo_pay_methods": null,
"creem_products": null,
"min_topup": 1,
"stripe_min_topup": 1,
"waffo_min_topup": 1,
"waffo_pancake_min_topup": 1,
"amount_options": [10, 30, 50, 100, 300],
"discount": { "100": 0.95, "300": 0.9 },
"topup_link": ""
}
}
| 欄位 | 類型 | 說明 |
|---|---|---|
enable_online_topup | boolean | 是否開啓易支付(在線掃碼)充值 |
enable_stripe_topup / enable_creem_topup | boolean | 是否開啓 Stripe / Creem 充值 |
enable_waffo_topup / enable_waffo_pancake_topup | boolean | 是否開啓 Waffo / Waffo Pancake 全球支付 |
enable_redemption | boolean | 是否允許使用兌換碼(POST /api/user/topup) |
payment_compliance_confirmed | boolean | 管理員是否已確認支付合規條款(未確認時 pay_methods 為空) |
payment_compliance_terms_version | number | 當前合規條款版本號 |
pay_methods | array | 易支付可用支付方式列表,每項 { name, type, color, min_topup } |
pay_methods[].type | string | 支付方式識別碼,發起支付時作為 payment_method 傳入,例如 alipay、wxpay |
pay_methods[].min_topup | string | 該支付方式的最低充值額(字串,與頂層 min_topup 整數不同) |
waffo_pay_methods | array | null | Waffo 支付子方式;未開啓 Waffo 時為 null |
creem_products | array | null | Creem 商品列表;未設定時為 null |
min_topup | integer | 易支付最低充值額度數量(低於此值 POST /api/user/amount 報錯) |
stripe_min_topup / waffo_min_topup / waffo_pancake_min_topup | integer | 對應渠道的最低充值額 |
amount_options | number[] | 充值頁快捷金額按鈕 |
discount | object | 階梯折扣表 { 額度: 折扣系數 },乘在實付金額上 |
topup_link | string | 外部充值跳轉鏈接(為空表示用站內充值) |