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,
},
],
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.billing.preview_multi_attach(
customer_id="cus_123",
plans=[
{
"plan_id": "pro_plan",
},
{
"plan_id": "addon_seats",
"feature_quantities": [
{
"feature_id": "seats",
"quantity": 5,
},
],
},
],
redirect_mode="if_required",
)curl --request POST \
--url https://api.useautumn.com/v1/billing.preview_multi_attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123",
"plans": [
{
"plan_id": "pro_plan"
},
{
"plan_id": "addon_seats",
"feature_quantities": [
{
"feature_id": "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,
},
],
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.billing.preview_multi_attach(
customer_id="cus_123",
plans=[
{
"plan_id": "pro_plan",
},
{
"plan_id": "addon_seats",
"feature_quantities": [
{
"feature_id": "seats",
"quantity": 5,
},
],
},
],
redirect_mode="if_required",
)curl --request POST \
--url https://api.useautumn.com/v1/billing.preview_multi_attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123",
"plans": [
{
"plan_id": "pro_plan"
},
{
"plan_id": "addon_seats",
"feature_quantities": [
{
"feature_id": "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
Unix timestamp in milliseconds for backdating every plan in this multi-attach.
0 <= x <= 9007199254740991Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
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
How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
prorate_immediately, none Pass 'now' to reset the billing cycle of every plan on the subscription to the time of this request.
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 before discounts and tax for the current billing period.
The final amount after discounts and tax for the current billing period.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for 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 True when this change clears the customer's usage balances, so the approver can see usage will reset.
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