import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.previewMultiAttach({
customerId: "cus_123",
plans: [
{
planId: "pro_plan",
},
{
planId: "addon_seats",
featureQuantities: [
{
featureId: "seats",
quantity: 5,
},
],
},
],
});{
"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 Multi Attach
Previews the billing changes that would occur when attaching multiple plans, without actually making any changes.
Use this endpoint to show customers what they will be charged before confirming a multi-plan subscription.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.billing.previewMultiAttach({
customerId: "cus_123",
plans: [
{
planId: "pro_plan",
},
{
planId: "addon_seats",
featureQuantities: [
{
featureId: "seats",
quantity: 5,
},
],
},
],
});{
"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 plans to.
The list of plans to attach to the customer.
1Show child attributes
Show child attributes
The ID of the entity to attach the plans to.
Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
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.
Show child attributes
Show child attributes
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
URL to redirect to after successful checkout.
Additional parameters to pass into the creation of the Stripe checkout session.
Show child attributes
Show child attributes
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 Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
Customer details to set when creating a customer
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
OK
The ID of the customer.
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
Whether the customer will be redirected to a checkout page if attach is called.
The type of checkout that will be used if the customer is redirected to a checkout page.
stripe_checkout, autumn_checkout 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