Skip to main content

Subscription Management

The Subscription Management feature allows admins to create and manage individual subscriptions that learners can activate.
Each subscription is linked to a subscription package (Free, Pro, Premium, etc.).


Fields

FieldTypeRequiredNotes
StatusEnumYesActive (available) or Inactive (disabled).
CodeStringYesUnique identifier for the subscription (e.g., SUB_FREE01, SUB_PRO01).
NameStringYesDisplay name for the subscription (e.g., Free Trial Jan 2025).
PackageSelectYesReference to a Subscription Package (e.g., Free, Pro, Premium).

1. Create Subscription

Steps:

  1. Go to Backoffice → Subscriptions.
  2. Click New Subscription.
  3. Fill in the required fields (status, code, name, package).
  4. Save to create.

Example Request:

{
"status": "active",
"code": "SUB_PRO2025",
"name": "Pro Plan 2025",
"package": "PRO"
}
Response:

json
Copy code
{
"success": true,
"message": "Subscription created successfully"
}
2. View Subscriptions (Table)
All subscriptions are listed in the Subscription Table:

Code Name Package Status Actions
SUB_FREE01 Free Trial FREE Active Edit / Delete
SUB_PRO01 Pro Plan 2025 PRO Active Edit / Delete
SUB_PREM01 Premium 2025 PREM Inactive Edit / Delete

3. Update Subscription
Steps:

Go to Subscription Table.

Click Edit ✏️ on a subscription.

Update the fields (e.g., change package or rename).

Save changes.

Example Update:

json
Copy code
{
"subscriptionId": "sub-123",
"status": "inactive",
"code": "SUB_PRO2025",
"name": "Pro Plan 2025 (Archived)",
"package": "PRO"
}
Response:

json
Copy code
{
"success": true,
"message": "Subscription updated successfully"
}
4. Delete Subscription
Steps:

Go to Subscription Table.

Click Delete 🗑️.

Confirm deletion in the dialog box.

Example Delete:

json
Copy code
{
"subscriptionId": "sub-123",
"action": "delete"
}
Response:

json
Copy code
{
"success": true,
"message": "Subscription deleted successfully"
}
⚠️ Deletion is permanent. If unsure, use Inactive status instead.

Best Practices
Use codes that match package codes (e.g., SUB_PRO2025 for Pro).

Keep names descriptive (e.g., include year/month for limited plans).

Link each subscription to the correct package for feature consistency.

Prefer Inactive over deletion when retiring old subscriptions.