StableOps
API 参考

创建商户订阅

为商户用户创建 StableOps 订阅并绑定所选套餐,读取首期账单或试用状态,再为需要付款的用户准备独立支付流程。订阅按周期开票,用户仍需主动用钱包付款,自动开票不代表自动扣款。商户应结合账单结算、当前账期及订阅状态管理服务权限,不依赖前端返回判断成功。

POST/v1/merchant/subscriptions

Authorization

bearerAuth
AuthorizationBearer <token>

Paste your API key from the dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/merchant/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "plan_id": "string",    "merchant_user_id": "string"  }'
{
  "subscription": {
    "id": "string",
    "merchant_user_id": "string",
    "plan_id": "string",
    "status": "incomplete",
    "current_period_start": "2019-08-24T14:15:22Z",
    "current_period_end": "2019-08-24T14:15:22Z",
    "cancel_at_period_end": true,
    "pending_plan_id": "string",
    "pending_plan_change_at": "2019-08-24T14:15:22Z",
    "trial_ends_at": "2019-08-24T14:15:22Z",
    "canceled_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "invoice": {
    "id": "string",
    "subscription_id": "string",
    "merchant_user_id": "string",
    "kind": "first",
    "period_start": "2019-08-24T14:15:22Z",
    "period_end": "2019-08-24T14:15:22Z",
    "amount": "string",
    "asset": "USDC",
    "status": "open",
    "payment_order_id": "string",
    "target_plan_id": "string",
    "due_at": "2019-08-24T14:15:22Z",
    "paid_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}

这篇文档怎么样?

最后更新