Skip to main content

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

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer YOUR_API_TOKENYes

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

FieldTypeDescription
idintegerVIP subscription ID
package_namestringName of the VIP package
package_idintegerID of the VIP package
statusstringCurrent status of the subscription
start_datestringStart date in format dd/mm/yyyy
end_datestringEnd date in format dd/mm/yyyy
pricenumberPrice of the VIP package
can_resubscribebooleanWhether user can resubscribe to this package (false if user has active subscription or if package is free)
is_freebooleanWhether this is a free subscription

Error Responses

Unauthorized

{
"success": false,
"message": "Unauthenticated.",
"data": null,
"status_code": 401
}

Implementation Notes

  • The can_resubscribe field 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

Check Subscription Status

Check if the user has an active VIP subscription.

Endpoint

  • Method: GET
  • URL: /api/vip-subscriptions/get-status

Request Headers

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer YOUR_API_TOKENYes

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

  1. System checks user's VIP subscription status
  2. System returns boolean indicating if user has active VIP subscription
  3. 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

  1. Scope:

    • Regular subscriptions are feature-specific (EmotionalMap, Challenge)
    • VIP subscriptions provide premium access across all features
  2. Duration:

    • Regular subscriptions continue until completed or failed
    • VIP subscriptions have a fixed duration based on the package
  3. Pricing:

    • Regular subscriptions are included with basic account
    • VIP subscriptions require package purchase
  4. Features:

    • Regular subscriptions provide basic feature access
    • VIP subscriptions unlock premium features and benefits