User Subscription Management
The User Subscription feature allows admins to assign, track, and manage subscriptions for individual learners.
Each subscription is linked to a package and price, with detailed status and time tracking.
Fields
| Field | Type | Required | Notes |
|---|---|---|---|
| User Email | Select | Yes | Search and select a registered user. |
| Subscription Package | Select | Yes | Choose from available subscription packages (e.g., Free, Pro, Premium). |
| Subscription Price | Select | Yes | Choose from defined prices (monthly, yearly, trial, etc.). |
| Status | Enum | Yes | Active, Inactive, or Cancelled. |
| Cancelled At | DateTime | Optional | When the subscription was cancelled (if applicable). |
| Trial Ends At | DateTime | Optional | When the free trial period ends. |
| Start Date | DateTime | Yes | Subscription activation date. |
| End Date | DateTime | Optional | Expiration date (for time-bound subscriptions). |
| Description | Text | Optional | Notes or details about the subscription. |
1. Create User Subscription
Steps:
- Go to Backoffice → User Subscriptions.
- Click New User Subscription.
- Select User Email, Package, and Price.
- Fill in dates and status.
- Save to assign the subscription.
Example Request (JSON):
{
"userEmail": "alice@example.com",
"subscriptionPackage": "PRO",
"subscriptionPrice": "PRO_MONTHLY",
"status": "active",
"trialEndsAt": "2025-02-10T23:59:59Z",
"startDate": "2025-02-01T00:00:00Z",
"endDate": "2025-03-01T00:00:00Z",
"description": "Assigned Pro Monthly subscription with 7-day trial."
}
Response:
json
Copy code
{
"success": true,
"message": "User subscription created successfully"
}
2. View User Subscriptions (Table)
User Email Package Price Status Trial Ends Start Date End Date Actions
alice@example.com PRO PRO_MONTHLY Active 2025-02-10 2025-02-01 2025-03-01 Edit / Cancel
bob@example.com FREE FREE_TRIAL Cancelled — 2025-01-01 2025-01-15 View
carol@example.com PREM PREM_YEARLY Active — 2025-01-20 2026-01-20 Edit / Cancel
3. Update User Subscription
Steps:
Go to User Subscriptions Table.
Click Edit ✏️.
Update fields such as status, dates, or description.
Save changes.
Example Update Request:
json
Copy code
{
"subscriptionId": "usersub-101",
"status": "cancelled",
"cancelledAt": "2025-02-05T12:00:00Z",
"description": "Cancelled by admin due to payment failure."
}
Response:
json
Copy code
{
"success": true,
"message": "User subscription updated successfully"
}
4. Delete User Subscription
⚠️ Deletion should only be used for test data or mistakes.
Normally, subscriptions should be cancelled instead of deleted.
Example Request:
json
Copy code
{
"subscriptionId": "usersub-101",
"action": "delete"
}
Response:
json
Copy code
{
"success": true,
"message": "User subscription deleted successfully"
}
Best Practices
Always set Start and End Dates clearly for recurring subscriptions.
Use Trial Ends At to automatically transition from trial → paid.
Prefer Cancelled status instead of deletion to keep records.
Use Description for internal notes (e.g., why a subscription was cancelled).
Regularly audit subscriptions to ensure learners are billed correctly.