Skip to main content
POST

Overview

Creates a Stripe checkout session for subscribing to a plan. Returns a URL where you should redirect the user to complete the payment. Requires session-based authentication (JWT access token).
For third-party integrations: Use POST /subscriptions/checkout/api with API Key authentication instead.

Authentication

string
required
Your JWT access token. Format: Bearer YOUR_ACCESS_TOKEN

Request Body

string
required
The plan identifier to subscribe to. Must be one of: starter, professional, business, or agency.
string
default:"monthly"
Billing frequency. Options: monthly or yearly.
string
URL to redirect to after successful payment. Defaults to application dashboard.
string
URL to redirect to if user cancels payment. Defaults to pricing page.

Response Fields

string
Stripe checkout session ID. Can be used to verify the session later.
string
URL to redirect the user to for payment. This is a Stripe-hosted checkout page.
object
Details of the selected plan.

Checkout Flow

  1. Create session: Call this endpoint with the desired plan
  2. Redirect user: Send user to the returned url
  3. Payment processing: User completes payment on Stripe
  4. Webhook: Stripe notifies your webhook endpoint
  5. Success redirect: User is redirected to successUrl
  6. Verify (optional): Check subscription status via /subscriptions/current

Error Responses

Bad Request - Invalid plan ID or user already has an active subscription.
Unauthorized - Invalid or missing token.
If the user already has an active subscription, they should use the billing portal (/subscriptions/portal) to change plans instead.

POST /subscriptions/checkout/api

Creates a Stripe checkout session using API Key authentication. Ideal for third-party integrations.

Authentication

Requires API Key authentication. Include your API key in the Authorization header:

Request Body

Same as /subscriptions/checkout above.

Response

Same as /subscriptions/checkout above.