Skip to main content
Retrieve the current subscription information for the authenticated user, including plan details, status, and usage limits.

Authentication

Requires a valid JWT token in the Authorization header.
Authorization: Bearer YOUR_JWT_TOKEN

Response

plan
string
Current subscription plan: “FREE”, “BASIC”, “PRO”, or “ENTERPRISE”.
status
string
Subscription status: “ACTIVE”, “CANCELLED”, “EXPIRED”, “PAST_DUE”, “UNPAID”, or “TRIALING”.
planPrice
number
Monthly price of the plan in MXN.
currentPeriodStart
string
Start date of the current billing period (ISO 8601 format, null for FREE plan).
currentPeriodEnd
string
End date of the current billing period (ISO 8601 format, null for FREE plan).
cancelAtPeriodEnd
boolean
Whether the subscription will be cancelled at the end of the current period.
stripeCustomerId
string
Stripe customer ID (only present for paid plans).
stripeSubscriptionId
string
Stripe subscription ID (only present for paid plans).
limits
object
Plan limits and features.
profiles
number
Maximum number of profiles allowed (null = unlimited).
invoicesPerMonth
number
Maximum invoices per month (null = unlimited).
expensesPerMonth
number
Maximum expenses per month (null = unlimited).
exportPDF
boolean
Whether PDF export is enabled.
exportExcel
boolean
Whether Excel export is enabled.
reports
string
Report level: “basic”, “complete”, or “advanced”.
support
string
Support level: “none”, “email”, “priority”, or “dedicated”.
apiAccess
boolean
Whether API access is enabled.

Example Request

cURL
curl -X GET https://api.tresacontafy.com/api/subscription \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response (FREE Plan)

{
  "plan": "FREE",
  "status": "ACTIVE",
  "planPrice": 0,
  "currentPeriodStart": null,
  "currentPeriodEnd": null,
  "cancelAtPeriodEnd": false,
  "limits": {
    "profiles": 1,
    "invoicesPerMonth": null,
    "expensesPerMonth": null,
    "exportPDF": false,
    "exportExcel": false,
    "reports": "basic",
    "support": "none",
    "apiAccess": false
  }
}

Example Response (PRO Plan)

{
  "plan": "PRO",
  "status": "ACTIVE",
  "planPrice": 799,
  "currentPeriodStart": "2024-03-01T00:00:00.000Z",
  "currentPeriodEnd": "2024-04-01T00:00:00.000Z",
  "cancelAtPeriodEnd": false,
  "stripeCustomerId": "cus_ABC123",
  "stripeSubscriptionId": "sub_XYZ789",
  "limits": {
    "profiles": 20,
    "invoicesPerMonth": null,
    "expensesPerMonth": null,
    "exportPDF": true,
    "exportExcel": true,
    "reports": "advanced",
    "support": "priority",
    "apiAccess": true
  }
}

Error Responses

401
error
Unauthorized - Invalid or missing JWT token.
500
error
Internal server error.

Build docs developers (and LLMs) love