Purchases a premium account for the authenticated user.
Permission | Description |
---|---|
payments.view_own | Access the payment system |
payments.buy_premium | Buy a premium account |
Name | Type | Required | Description | Example |
---|---|---|---|---|
plan | string | Yes | Name of the premium plan | "plus" |
months_count | int | Yes | Number of months (min 1, 12+ for discount) | 12 |
Use /prices
to get plan names and discount rates.
{
"plan": "plus",
"months_count": 12
}
Returns the created user premium subscription resource.
{
"id": 1,
"user_id": 42,
"plan": "plus",
"starts_at": "2025-01-01 00:00:00",
"expires_at": "2026-01-01 00:00:00"
}
For a full schema, see User Premium Subscription Resource.
Status | Description | Reference |
---|---|---|
400 | Already subscribed/Insufficient balance | N/A |
422 | Validation error | Validation error |
404 | Plan not found | N/A |
500 | Subscription failed | N/A |
401 | Unauthorized | Authentication error |