POST /api/private/v1/subscriptions/activate
直接为任意客户激活或延长某个套餐。
请求体
{
"customer": "customer_001",
"plan": "pro",
"duration": "P30D"
}
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
customer | string | 是 | 客户用户名 |
plan | string | 是 | 套餐标识(slug) |
duration | string | 否 | ISO-8601 时长字符串,可空 |
成功响应
HTTP 状态码 201:
{
"ok": true,
"requestId": "req_123",
"data": {
"id": 10,
"customer": { "id": 1, "username": "customer_001" },
"plan": { "id": 2, "slug": "pro", "name": "Pro" },
"validFrom": "2026-03-21T00:00:00.000Z",
"validTo": "2026-04-21T00:00:00.000Z",
"status": "ACTIVE"
}
}
可能错误
404 CUSTOMER_NOT_FOUND404 PLAN_NOT_FOUND