Endpoint
Authentication
This endpoint requires authentication. The user must have an active session with a valid JWT token.Request
No request body is required. Simply make a GET request to the endpoint with valid authentication cookies.Example Request
cURL
Response
object | null
The user’s subscription details, or
null if they don’t have an active subscription.Success Response (200)
No Subscription Response (200)
If the user doesn’t have a subscription, the response will be:Error Responses
500 Internal Server Error
500 Internal Server Error
Returned when an unexpected error occurs.
Implementation Details
The endpoint retrieves the most recently updated subscription for the authenticated user:Source Code Reference
The implementation can be found insrc/app/api/payments/subscription/route.ts:9-32.
Usage Examples
React Hook
Server Component
Subscription Status Values
active
Subscription is active and in good standing
trialing
Subscription is in trial period
past_due
Payment failed, subscription at risk
canceled
Subscription has been canceled
incomplete
Initial payment failed or pending