VIP Subscriptions
Manage VIP subscriptions that provide premium features and enhanced access to the application. VIP subscriptions offer additional benefits and exclusive content.
Get VIP Subscription History
Retrieve the user's VIP subscription history.
Endpoint
- Method: GET
- URL:
/api/vip-subscriptions
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer YOUR_API_TOKEN | Yes |
Success Response
{
"success": true,
"message": "Data retrieved successfully",
"data": [
{
"id": 1,
"package_name": "Premium Package",
"package_id": 1,
"status": "ongoing",
"start_date": "16/02/2025",
"end_date": "16/03/2025",
"price": 99.99,
"can_resubscribe": false,
"is_free": false
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | VIP subscription ID |
| package_name | string | Name of the VIP package |
| package_id | integer | ID of the VIP package |
| status | string | Current status of the subscription |
| start_date | string | Start date in format dd/mm/yyyy |
| end_date | string | End date in format dd/mm/yyyy |
| price | number | Price of the VIP package |
| can_resubscribe | boolean | Whether user can resubscribe to this package (false if user has active subscription or if package is free) |
| is_free | boolean | Whether this is a free subscription |
Error Responses
Unauthorized
{
"success": false,
"message": "Unauthenticated.",
"data": null,
"status_code": 401
}
Implementation Notes
- The
can_resubscribefield is calculated based on two conditions:- It will be false if the user has an active VIP subscription (
alreadySubscribed) - It will be false if the subscription is free (
subscription->is_free) - It will be true only if both conditions above are false
- It will be false if the user has an active VIP subscription (
Check Subscription Status
Check if the user has an active VIP subscription.
Endpoint
- Method: GET
- URL:
/api/vip-subscriptions/get-status
Request Headers
| Header | Value | Required |
|---|---|---|
| Accept | application/json | Yes |
| Authorization | Bearer YOUR_API_TOKEN | Yes |
Success Response
{
"success": true,
"message": "Data retrieved successfully",
"data": {
"has_active_subscription": true
}
}
Error Responses
Unauthorized
{
"success": false,
"message": "Unauthenticated.",
"data": null,
"status_code": 401
}
Example Implementation Flow
- System checks user's VIP subscription status
- System returns boolean indicating if user has active VIP subscription
- Application can use this status to enable/disable VIP features
Check Subscription Status Response Examples
Success Response (With Active Subscription)
{
"success": true,
"message": "Data retrieved successfully",
"data": {
"has_active_subscription": true
}
}
Success Response (Without Active Subscription)
{
"success": true,
"message": "Data retrieved successfully",
"data": {
"has_active_subscription": false
}
}
Error Response
{
"success": false,
"message": "Unauthenticated.",
"data": null,
"status_code": 401
}
Key Differences between Regular and VIP Subscriptions
-
Scope:
- Regular subscriptions are feature-specific (EmotionalMap, Challenge)
- VIP subscriptions provide premium access across all features
-
Duration:
- Regular subscriptions continue until completed or failed
- VIP subscriptions have a fixed duration based on the package
-
Pricing:
- Regular subscriptions are included with basic account
- VIP subscriptions require package purchase
-
Features:
- Regular subscriptions provide basic feature access
- VIP subscriptions unlock premium features and benefits