import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.plans.update({
planId: "pro_plan",
name: "Pro Plan (Updated)",
price: {
amount: 15,
interval: "month",
},
});{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"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
}
}
Update a plan
Updates an existing plan. Creates a new version unless disableVersion is set.
Use this to modify plan properties, pricing, or feature configurations. See Adding features to plans for item configuration.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.plans.update({
planId: "pro_plan",
name: "Pro Plan (Updated)",
price: {
amount: 15,
interval: "month",
},
});{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"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
}
}
Updating Items
When updatingitems, you must provide the complete items array. The new array replaces the existing configuration entirely.
To update a single feature’s configuration while keeping others unchanged, include all existing items with the modified values.
Common Use Cases
await autumn.plans.update({
planId: "pro_plan",
price: { amount: 15, interval: "month" }
});
Body Parameters
Response
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"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
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
The ID of the plan to update.
1^[a-zA-Z0-9_-]+$Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Display name of the plan.
1Whether the plan is an add-on.
Whether the plan is automatically enabled.
The price of the plan. Set to null to remove the base price.
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
The free trial of the plan. Set to null to remove the free trial.
Show child attributes
Show child attributes
Miscellaneous plan-level configuration flags.
Show child attributes
Show child attributes
The new ID to use for the plan. Can only be updated if the plan has not been used by any customers.
1^[a-zA-Z0-9_-]+$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.
If this is a variant, the ID of the base plan it was created from.
Miscellaneous plan-level configuration flags.
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
Show child attributes
Show child attributes