Premiums API
Manage user premium subscriptions
Premiums API
Manage user premium subscriptions via action-based POST requests and GET queries
GET /api/users/user/[userId]/premiums?action=status
Get basic premium status for a user.
/api/users/user/[userId]/premiums?action=statusGET https://api.wecompleteapp.com/api/users/user/USER_ID/premiums?action=status
Headers:
Content-Type: application/json{
"isPremium": true,
"source": "direct",
"partnerId": null,
"message": "Direct premium access"
}GET /api/users/user/[userId]/premiums?action=subscription
Get full subscription details including start date, end date, plan, and other subscription information.
/api/users/user/[userId]/premiums?action=subscriptionGET https://api.wecompleteapp.com/api/users/user/USER_ID/premiums?action=subscription
Headers:
Content-Type: application/json{
"success": true,
"isPremium": true,
"subscription": {
"plan": "9.99",
"startDate": 1718000000000,
"endDate": 1720600000000,
"isActive": true,
"isPartnerInherited": false,
"revenueCatId": "rc_abc123",
"platform": "ios",
"lastRenewed": 1718000000000,
"cancelled": false,
"meta": {}
}
}GET /api/users/user/[userId]/premiums?action=limits
Get comprehensive user limits and premium status details.
/api/users/user/[userId]/premiums?action=limitsGET https://api.wecompleteapp.com/api/users/user/USER_ID/premiums?action=limits
Headers:
Content-Type: application/json{
"isPremium": true,
"limits": {
"projects": 50,
"storage": "10GB"
}
}GET /api/users/user/[userId]/premiums?action=check&feature=FEATURE_NAME
Quick check to see if a user has premium access to a specific feature.
/api/users/user/[userId]/premiums?action=check&feature=FEATURE_NAMEGET https://api.wecompleteapp.com/api/users/user/USER_ID/premiums?action=check&feature=export_pdf
Headers:
Content-Type: application/json{
"hasAccess": true
}POST /api/users/user/[userId]/premiums (create)
Create or update a premium subscription for a user. Use `action: create` when the user first buys premium.
/api/users/user/[userId]/premiumscurl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/premiums \
-H "Content-Type: application/json" \
-d '{
"action": "create",
"plan": "9.99",
"startDate": 1718000000000,
"endDate": 1720600000000,
"revenueCatId": "rc_abc123",
"platform": "ios",
"meta": {}
}'{
"success": true,
"created": true
}POST /api/users/user/[userId]/premiums (subscribe)
Alias for `create` — also creates or updates a premium subscription. Used when subscribing via an external provider.
/api/users/user/[userId]/premiumscurl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/premiums \
-H "Content-Type: application/json" \
-d '{
"action": "subscribe",
"plan": "9.99",
"startDate": 1718000000000,
"endDate": 1720600000000,
"revenueCatId": "rc_xyz789",
"platform": "android",
"meta": { "promoCode": "SUMMER2025" }
}'{
"success": true,
"created": true
}POST /api/users/user/[userId]/premiums (update)
Update an existing premium subscription (change plan, renew, extend, etc). Fails if no premium exists.
/api/users/user/[userId]/premiumscurl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/premiums \
-H "Content-Type: application/json" \
-d '{
"action": "update",
"plan": "19.99",
"endDate": 1723200000000
}'{
"success": true,
"updated": true
}POST /api/users/user/[userId]/premiums (cancel)
Deactivate a user's premium subscription. Sets `isActive` to false.
/api/users/user/[userId]/premiumscurl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/premiums \
-H "Content-Type: application/json" \
-d '{ "action": "cancel" }'{
"success": true,
"deactivated": true
}POST /api/users/user/[userId]/premiums (deactivate)
Same as cancel — deactivates a premium subscription.
/api/users/user/[userId]/premiumscurl -X POST https://api.wecompleteapp.com/api/users/user/USER_ID/premiums \
-H "Content-Type: application/json" \
-d '{ "action": "deactivate" }'{
"success": true,
"deactivated": true
}📌 Notes:
GET Endpoints:
- action=status - Basic premium status (isPremium, source, partnerId)
- action=subscription or action=details - Full subscription details with dates
- action=limits - Comprehensive limits and usage information
- action=check&feature=FEATURE_NAME - Quick feature access check
POST Endpoints:
- All POST requests must include an action field in the body.
- action can be: create, subscribe, update, cancel, or deactivate.
- plan is a string representing the price (e.g., "9.99").
- Dates (startDate / endDate) are in milliseconds since epoch.
- create / subscribe will create or update a premium plan.
- update modifies an existing premium plan without creating one.
- cancel / deactivate turn off premium access.
- Optional fields: revenueCatId, platform, meta.