import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.previewUpdate({
customerId: "cus_123",
planId: "pro_plan",
featureQuantities: [
{
featureId: "seats",
quantity: 15,
},
],
});{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
Preview Update
Previews the billing changes that would occur when updating a subscription, without actually making any changes.
Use this endpoint to show customers prorated charges or refunds before confirming subscription modifications.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.previewUpdate({
customerId: "cus_123",
planId: "pro_plan",
featureQuantities: [
{
featureId: "seats",
quantity: 15,
},
],
});{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
Body Parameters
Response
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
The ID of the plan to update. Optional if subscription_id is provided, or if the customer has only one product.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
Show child attributes
Show child attributes
The version of the plan to attach.
Customize the plan to attach. Can override the price, items, free trial, or a combination.
Show child attributes
Show child attributes
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method.
Show child attributes
Show child attributes
How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
prorate_immediately, none Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
always, if_required, never A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
Show child attributes
Show child attributes
Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
cancel_immediately, cancel_end_of_cycle, uncancel Reset the billing cycle anchor immediately with 'now'
If true, the subscription is updated internally without applying billing changes in Stripe.
Controls whether balances should be recalculated during the subscription update.
Show child attributes
Show child attributes
Response
OK
The ID of the customer.
List of line items for the current billing period.
Show child attributes
Show child attributes
The total amount in cents before discounts and tax for the current billing period.
The final amount in cents after discounts and tax for the current billing period.
The three-letter ISO currency code (e.g., 'usd').
Products or subscription changes being added or updated.
Show child attributes
Show child attributes
Products or subscription changes being removed or ended.
Show child attributes
Show child attributes
update_plan, update_quantity, cancel_immediately, cancel_end_of_cycle, uncancel, none Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.
Show child attributes
Show child attributes
Expand the response with additional data.
Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
Show child attributes
Show child attributes
Stripe customer invoice credits preview.
Show child attributes
Show child attributes