Top-ups and payments

POST /api/user/stripe/preview

Native access token · POST /api/user/stripe/preview

读取 Stripe 商品实时单价并计算预计到账积分(1 USD = 100 积分),Cache-Control: no-store,PAT 需具备 wallet:read。请求体须二选一提供 amount(整数购买单位数 1–10000)或 amount_usd_cents(正整数字符串 50–99999999)。仅用于充值前只读报价,不创建订单、不冻结资金。

POST/api/user/stripe/preview

Authorizations

Authorizationstringrequired

Use a native login access_token (or a scoped PAT where supported); required access: Native access token.

Authorization: Bearer $ONEASTER_ACCESS_TOKEN

Body · application/json

amountinteger

购买数量(整数 quota-USD 单位,1–10000;与 amount_usd_cents 二选一)

amount_usd_centsstring

支付本金美元分(50–99999999;与 amount 二选一)

JSON Schema
{
  "type": "object",
  "oneOf": [
    {
      "required": [
        "amount"
      ],
      "not": {
        "required": [
          "amount_usd_cents"
        ]
      }
    },
    {
      "required": [
        "amount_usd_cents"
      ],
      "not": {
        "required": [
          "amount"
        ]
      }
    }
  ],
  "properties": {
    "amount": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000,
      "description": "购买数量(整数 quota-USD 单位,1–10000;与 amount_usd_cents 二选一)"
    },
    "amount_usd_cents": {
      "type": "string",
      "pattern": "^[1-9][0-9]{0,7}$",
      "description": "支付本金美元分(50–99999999;与 amount 二选一)"
    }
  },
  "additionalProperties": false
}