Skip to main content
POST
Switch subscription plan

Authorizations

X-API-Key
string
header
required

Query Parameters

dry_run
boolean
default:false

Report which Stripe page the switch would open, and open nothing.

Body

application/json

Request schema for switching subscription plan.

cancel_path
string
required

Partial path (e.g. /billing/plans) of where the stripe Checkout session should redirect the user if payment is cancelled.

Required string length: 1 - 255
new_product
enum<string>
required

The new product to switch to.

Available options:
free_plan,
team_plan,
pro_plan,
enterprise_plan
success_path
string
required

Partial path (e.g. /billing/complete) of where the stripe Checkout session should redirect the user if payment is successful.

Required string length: 1 - 255
billing_interval
enum<string>
default:month

The billing interval to subscribe with.

Available options:
month,
year
credit_tier_key
string | null

The credit tier to subscribe to (e.g. 'tier_20k'). Required for products with selectable credit tiers (the Team plan).

Required string length: 1 - 50

Response

Successful Response

Where to send the customer to complete the plan change.

There is no "completed" case: Stripe confirms every plan change, so this always carries a URL to leave for, except on a dry run.

redirect_url
string<uri> | null
required

The URL to redirect the customer to. Null on a dry run, which opens no Stripe page: type still says which one the real call would open.

Required string length: 1 - 2083
type
enum<string>
required

Which Stripe surface completes the change: 'checkout' for a first paid subscription, 'portal' for a change to an existing one.

Available options:
checkout,
portal