This endpoint doesn’t directly cancel the subscription. Instead, it creates a portal session URL where users can manage their subscription themselves through Stripe’s hosted portal.
Authentication
Requires a valid JWT token in the Authorization header.Response
The URL to redirect the user to access the Stripe Customer Portal. This URL is valid for a limited time.
Success message.
Portal Features
The Customer Portal allows users to:- Cancel their subscription
- Update payment methods
- View billing history and invoices
- Change subscription plans
- Update billing information
Example Request
cURL
Example Response
Usage Flow
- Call this endpoint to get the portal URL
- Redirect the user to the returned URL
- User manages their subscription in the Stripe portal
- After completion, user is redirected back to your app
- Webhook updates are automatically processed
Error Responses
Unauthorized - Invalid or missing JWT token.
Bad request - No active subscription found. Only users with paid subscriptions can access the portal.Error message: “No hay suscripción activa” - User must have an active subscription to access the portal.
Internal server error or Stripe API error.
Users on the FREE plan cannot access the Customer Portal since they don’t have a Stripe subscription. They need to upgrade to a paid plan first.