Charge and provision an activation
POST
/api/v1/users/{id}/activation
Prices, charges and provisions in one operation. Funds are reserved first, then the plan is applied, and both halves are keyed off your request_id, so a retry after a crash re-runs neither the charge nor the grant.
The nested activation object is serialised with Go field names (UserID, NewSubscriptionEnd) and RFC3339 timestamps, unlike every other object on this API. Everything around it uses snake_case and yyyy-MM-dd HH:mm:ss. Do not write a parser that assumes one convention.
نظرة سريعة
- المصادقة
- رمز موظّف أو جلسة
- تتطلب أيًّا من
-
prm_users_activateprm_users_extend - حد المعدل
t_mutate- مفتاح عدم التكرار
request_id
المعاملات
| المعامل | الوصف |
|---|---|
idمطلوب
path · integer
|
Subscriber id. |
request_idمطلوب
body · string
|
Idempotency key, up to 255 characters, no colon or pipe. Reuse the same one on every retry of one intent. |
money_collected
body · boolean
|
Defaults to true. |
card_code
body · string
|
Required when method is card. The voucher must be in the caller's subtree. |
issue_invoice
body · boolean
|
Also record an invoice document. Skipped on a replay so a retry never double-issues. |
الأخطاء
| الرمز | متى تُرجَع |
|---|---|
ERR_VALIDATION400
|
request_id missing, too long, or in a reserved namespace |
ERR_CONFLICT409
|
the request_id is already bound to an activation of a different subscriber |
ERR_FORBIDDEN403
|
the body's operation needs a permission the caller does not hold |