Create a plan
POST
/v1/plans
const url = 'https://api.extport.dev/api/v1/plans';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"extensionId":"example","tier":"example","entitlementType":"perpetual","billingInterval":"one_time","maxActivations":1,"currency":"example","amount":1,"stripeProductId":"example","stripePriceId":"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/plans \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "extensionId": "example", "tier": "example", "entitlementType": "perpetual", "billingInterval": "one_time", "maxActivations": 1, "currency": "example", "amount": 1, "stripeProductId": "example", "stripePriceId": "example" }'One plan per (extension, tier, entitlementType, billingInterval) — each plan maps 1:1 to a Stripe Price under the extension Stripe Product. Creates or reuses the Stripe Product and creates the Stripe Price automatically via your connected Stripe account.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
extensionId
required
string
tier
required
string
entitlementType
string
billingInterval
string
maxActivations
integer
currency
string
amount
required
integer
stripeProductId
string
stripePriceId
string
Responses
Section titled “ Responses ”Created
Invalid input or Stripe account not connected
Extension not found
Plan already exists for this extension
Stripe API unavailable