import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.plans.create({
planId: "free_plan",
name: "Free",
autoEnable: true,
items: [
{
featureId: "messages",
included: 100,
reset: {
interval: "month",
},
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.plans.create(
plan_id="free_plan",
name="Free",
group="",
add_on=False,
auto_enable=True,
items=[
{
"feature_id": "messages",
"included": 100,
"reset": {
"interval": "month",
},
},
],
create_in_stripe=True,
)curl --request POST \
--url https://api.useautumn.com/v1/plans.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"plan_id": "free_plan",
"name": "Free",
"auto_enable": true,
"items": [
{
"feature_id": "messages",
"included": 100,
"reset": {
"interval": "month"
}
}
]
}
'{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
Create a plan
Creates a new plan with optional base price and feature configurations.
Use this to programmatically create pricing plans. See How plans work for concepts.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.plans.create({
planId: "free_plan",
name: "Free",
autoEnable: true,
items: [
{
featureId: "messages",
included: 100,
reset: {
interval: "month",
},
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.plans.create(
plan_id="free_plan",
name="Free",
group="",
add_on=False,
auto_enable=True,
items=[
{
"feature_id": "messages",
"included": 100,
"reset": {
"interval": "month",
},
},
],
create_in_stripe=True,
)curl --request POST \
--url https://api.useautumn.com/v1/plans.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"plan_id": "free_plan",
"name": "Free",
"auto_enable": true,
"items": [
{
"feature_id": "messages",
"included": 100,
"reset": {
"interval": "month"
}
}
]
}
'{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
Plan Configuration
A plan consists of:- Base price - optional recurring charge for the plan itself
- Items - feature configurations defining what customers get and how they’re billed
Configuring Items
Each item in theitems array configures a single feature. There are two types:
Consumable features (API calls, messages, credits):
- Set
includedfor free units that reset each period - Set
reset.intervalto define when balance resets toincluded - Optionally add
pricefor usage beyond included amount
- Set
includedfor the base allocation - Do NOT set
reset- usage persists across billing cycles - Use
billing_method: "prepaid"for upfront payment per unit
Multiple Currencies
To sell a plan in currencies beyond your organization’s default, setadditional_currencies on the base price, a feature price, or each tier of a tiered price. Amounts are explicit per currency - no exchange rates are applied - and tier boundaries stay the same across currencies. See Plans for how customers are matched to a currency.
Common Use Cases
await autumn.plans.create({
planId: "free_plan",
name: "Free",
autoEnable: true, // Automatically attached on customer creation
items: [
{
featureId: "messages",
included: 100,
reset: { interval: "month" }
}
]
});
await autumn.plans.create({
planId: "pro_plan",
name: "Pro Plan",
price: { amount: 10, interval: "month" },
items: [
{
featureId: "messages",
included: 1000,
reset: { interval: "month" },
price: {
amount: 0.01,
interval: "month",
billingUnits: 1,
billingMethod: "usage_based"
}
}
]
});
await autumn.plans.create({
planId: "team_plan",
name: "Team Plan",
price: { amount: 49, interval: "month" },
items: [
{
featureId: "seats",
included: 5,
// No reset - seats persist across billing cycles
price: {
amount: 10,
interval: "month",
billingUnits: 1,
billingMethod: "prepaid"
}
}
]
});
await autumn.plans.create({
planId: "analytics_addon",
name: "Advanced Analytics",
addOn: true, // Can be attached alongside other plans
price: { amount: 20, interval: "month" }
});
await autumn.plans.create({
planId: "api_plan",
name: "API Plan",
items: [
{
featureId: "api_calls",
included: 1000,
reset: { interval: "month" },
price: {
tiers: [
{ to: 10000, amount: 0.001 },
{ to: 100000, amount: 0.0005 },
{ to: "inf", amount: 0.0001 }
],
interval: "month",
billingUnits: 1,
billingMethod: "usage_based"
}
}
]
});
await autumn.plans.create({
planId: "premium_plan",
name: "Premium",
price: { amount: 99, interval: "month" },
freeTrial: {
durationLength: 14,
durationType: "day",
cardRequired: true
}
});
Body Parameters
Response
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
The ID of the plan to create.
1^[a-zA-Z0-9_-]+$Display name of the plan.
1Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Optional description of the plan.
If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group.
If true, plan is automatically attached when a customer is created. Use for free tiers.
Base recurring price for the plan. Omit for free or usage-only plans.
Show child attributes
Show child attributes
Feature configurations for this plan. Each item defines included units, pricing, and reset behavior.
Show child attributes
Show child attributes
Plans offered as assignable licenses under this plan. The full set replaces existing links.
Show child attributes
Show child attributes
Free trial configuration. Customers can try this plan before being charged.
Show child attributes
Show child attributes
Miscellaneous plan-level configuration flags.
Show child attributes
Show child attributes
Plan-level billing controls used as customer defaults.
Show child attributes
Show child attributes
Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan.
Show child attributes
Show child attributes
Response
OK
A plan defines a set of features, pricing, and entitlements that can be attached to customers.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Show child attributes
Show child attributes
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Show child attributes
Show child attributes
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
sandbox, live Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
Show child attributes
Show child attributes
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Show child attributes
Show child attributes
Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.
User-facing version identity. Defaults to v{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Payment processors this plan is connected to. Omitted when unset.
Show child attributes
Show child attributes
Free trial configuration. If set, new customers can try this plan before being charged.
Show child attributes
Show child attributes
Plan-level billing controls used as customer defaults.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Details about how this variant relates to its latest base plan.
Show child attributes
Show child attributes