POST /api/subscription/create-checkout
Creates a Stripe Checkout session to upgrade or subscribe to a paid plan (BASIC or PRO). Returns a session ID and URL to redirect the user to complete payment.Authentication
This endpoint requires authentication. Include your access token in the request cookies.Request Body
Plan to subscribe to. Options:
BASIC, PROPromotional code for discounts (3-50 characters). Will be converted to uppercase
Billing period. Options:
monthly, annualResponse
Stripe Checkout session ID
URL to redirect the user to complete the checkout process
Success message
Example Request
Example Response
Usage Flow
- Call this endpoint to create a checkout session
- Redirect the user to the returned
url - User completes payment on Stripe’s hosted checkout page
- User is redirected back to your success URL
- Stripe webhook updates the subscription status
Error Responses
Authentication required or token expired
Invalid request parameters
User already has an active subscription to the requested plan
Server or Stripe error occurred
The checkout session expires after 24 hours. Users must complete payment within this timeframe.