Create a duplicate-guarded Stripe Checkout Session for a subscription
POST
/v1/subscriptions/checkout
const url = 'https://api.extport.dev/api/v1/subscriptions/checkout';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"extensionId":"example","planId":"example","tier":"example","interval":"month","priceId":"example","externalUserId":"example","email":"hello@example.com","successUrl":"example","cancelUrl":"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/subscriptions/checkout \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "extensionId": "example", "planId": "example", "tier": "example", "interval": "month", "priceId": "example", "externalUserId": "example", "email": "hello@example.com", "successUrl": "example", "cancelUrl": "example" }'Resolves the active recurring plan and Stripe Price by planId or (extensionId, tier, interval) using the connected Stripe account. Checks if the user already has an entitled subscription for this extension and returns a one-click Extport Buyer Portal link instead of creating a duplicate. Defaults successUrl to the Extport checkout confirmation page when omitted.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
extensionId
required
string
planId
string
tier
string
interval
string
priceId
string
externalUserId
string
email
string format: email
successUrl
string
cancelUrl
string
Responses
Section titled “Responses”Checkout URL or Extport Buyer Portal redirect (already_subscribed)
Invalid input, disabled/missing plan/price, or Stripe not connected
Extension not found
Stripe API unavailable