GET /api/subscription
Retrieves the subscription details for the authenticated user, including plan information, status, billing period, and plan limits.
Authentication
This endpoint requires authentication. Include your access token in the request cookies.
Response
Current plan name. Options: FREE, BASIC, PRO, ENTERPRISE
Subscription status. Options: ACTIVE, CANCELLED, EXPIRED, PAST_DUE, UNPAID, TRIALING
Monthly price of the plan in the currency (e.g., MXN)
Start date of the current billing period (ISO 8601 format). Null for FREE plan
End date of the current billing period (ISO 8601 format). Null for FREE plan
Whether the subscription will be cancelled at the end of the current period
Stripe customer ID. Null for FREE plan
Stripe subscription ID. Null for FREE plan
Plan limits and features
Maximum number of RFC profiles allowed. Null means unlimited
Maximum XML files per month. Null means unlimited
Maximum expenses per month. Null means unlimited
Whether PDF export is enabled
Whether Excel export is enabled
Level of reports available. Options: basic, complete, advanced
Type of support available. Options: none, email, priority
Whether API access is enabled
SAT basic searches per month. Null means unlimited
SAT AI-powered searches per month. Null means unlimited
Maximum results per SAT search. Null means no limit
Whether AI explanations are available for SAT searches
Whether search history is enabled
Whether favorites feature is enabled
Whether alerts feature is enabled
Example Request
curl -X GET "https://api.contafy.com/api/subscription" \
-H "Cookie: access_token=your_access_token"
Example Response
{
"plan": "PRO",
"status": "ACTIVE",
"planPrice": 599,
"currentPeriodStart": "2024-03-01T00:00:00Z",
"currentPeriodEnd": "2024-04-01T00:00:00Z",
"cancelAtPeriodEnd": false,
"stripeCustomerId": "cus_123456789",
"stripeSubscriptionId": "sub_987654321",
"limits": {
"profiles": null,
"invoicesPerMonth": null,
"expensesPerMonth": null,
"exportPDF": true,
"exportExcel": true,
"reports": "advanced",
"support": "priority",
"apiAccess": true,
"satBasicSearchesPerMonth": null,
"satAISearchesPerMonth": 500,
"satMaxResults": null,
"satHasAIExplanations": true,
"satHasHistory": true,
"satHasFavorites": true,
"satHasAlerts": true
}
}
Error Responses
Authentication required or token expired{
"error": "Unauthorized",
"message": "Authentication required"
}
500 Internal Server Error
Server error occurred{
"error": "Internal Server Error",
"message": "An unexpected error occurred"
}