服务端 API(Private API)
服务端 API(Private API)基址为 /api/private/v1,用于服务端接入。
鉴权
Authorization: Bearer <PRIVATE_API_KEY>
仅接受 PRIVATE 类型 API Key,也就是服务端 API Key。
适用范围
服务端 API 支持项目级操作,包括:
- 访问项目内任意客户
- 创建、修改、删除客户
- 激活、删除任意订阅
- 扣减、返还或直接设置任意客户的计量用量
- 为任意客户兑换卡密
请仅在可安全保管密钥的服务端环境中使用。
端点列表
GET /api/private/v1/infoPOST /api/private/v1/entitlementsPOST /api/private/v1/usagePOST /api/private/v1/redemptionsGET /api/private/v1/customersPOST /api/private/v1/customersGET /api/private/v1/customers/:usernamePATCH /api/private/v1/customers/:usernameDELETE /api/private/v1/customers/:usernameGET /api/private/v1/plansGET /api/private/v1/subscriptionsGET /api/private/v1/subscriptions/:subscriptionIdDELETE /api/private/v1/subscriptions/:subscriptionIdPOST /api/private/v1/subscriptions/activatePOST /api/private/v1/codes/redeem
接口文档
- GET /api/private/v1/info
- POST /api/private/v1/entitlements
- POST /api/private/v1/usage
- POST /api/private/v1/redemptions
- GET|POST /api/private/v1/customers
- GET|PATCH|DELETE /api/private/v1/customers/:username
- GET /api/private/v1/plans
- GET /api/private/v1/subscriptions
- GET|DELETE /api/private/v1/subscriptions/:subscriptionId
- POST /api/private/v1/subscriptions/activate
- POST /api/private/v1/codes/redeem