Schedule an end-of-period subscription plan change via Stripe Subscription Schedules
POST
/v1/portal/subscriptions/{id}/change-plan
const url = 'https://api.extport.dev/api/v1/portal/subscriptions/example/change-plan';const options = { method: 'POST', headers: { cookie: 'extport_buyer_session=<extport_buyer_session>', 'Content-Type': 'application/json' }, body: '{"planId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.extport.dev/api/v1/portal/subscriptions/example/change-plan \ --header 'Content-Type: application/json' \ --cookie extport_buyer_session=<extport_buyer_session> \ --data '{ "planId": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
planId
required
string
Examplegenerated
{ "planId": "example"}Responses
Section titled “ Responses ”Plan change scheduled (or reverted to current plan)
Invalid target plan, subscription state, or Stripe not connected
No buyer session
Subscription or target plan not found
Stripe API unavailable