跳到主要内容

POST /api/private/v1/subscriptions/activate

直接为任意客户激活或延长某个套餐。

请求体

{
"customer": "customer_001",
"plan": "pro",
"duration": "P30D"
}
字段类型必填说明
customerstring客户用户名
planstring套餐标识(slug)
durationstringISO-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_FOUND
  • 404 PLAN_NOT_FOUND