Skip to main content
POST
/
v1
/
billing.multi_update
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.billing.multiUpdate({
  customerId: "cus_123",
  updates: [
    {
      planId: "pro_plan",
      cancelAction: "cancel_end_of_cycle",
    },
    {
      planId: "addon_seats",
      cancelAction: "cancel_end_of_cycle",
    },
  ],
});
from autumn_sdk import Autumn

autumn = Autumn(secret_key="am_sk_test...")

res = autumn.billing.multi_update(
customer_id="cus_123",
updates=[
{
"plan_id": "pro_plan",
"cancel_action": "cancel_end_of_cycle",
},
{
"plan_id": "addon_seats",
"cancel_action": "cancel_end_of_cycle",
},
],
)
curl --request POST \
--url https://api.useautumn.com/v1/billing.multi_update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123",
"updates": [
{
"plan_id": "pro_plan",
"cancel_action": "cancel_end_of_cycle"
},
{
"plan_id": "addon_seats",
"cancel_action": "cancel_end_of_cycle"
}
]
}
'
{
  "customer_id": "cus_123",
  "invoice": {
    "status": "paid",
    "stripe_id": "in_1234",
    "total": -20,
    "currency": "usd",
    "hosted_invoice_url": "https://invoice.stripe.com/..."
  },
  "payment_url": null
}
The multi update endpoint applies updates to multiple plans in a single, atomic request. It currently supports cancel actions. For updating a single plan (like changing quantities or customizing items), use update instead.

Common Use Cases

const response = await autumn.billing.multiUpdate({
    customerId: "cus_123",
    updates: [
        { planId: "pro_plan", cancelAction: "cancel_end_of_cycle" },
        { planId: "addon_seats", cancelAction: "cancel_end_of_cycle" },
    ],
});

Body Parameters

Response

{
  "customer_id": "cus_123",
  "invoice": {
    "status": "paid",
    "stripe_id": "in_1234",
    "total": -20,
    "currency": "usd",
    "hosted_invoice_url": "https://invoice.stripe.com/..."
  },
  "payment_url": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.3.0
required

Body

application/json
customer_id
string
required

The ID of the customer to update plans for.

updates
object[]
required

The list of plan updates to apply to the customer.

Minimum array length: 1
entity_id
string

The ID of the entity to update plans for. Individual updates can override this with their own entity_id.

Response

200 - application/json

OK

customer_id
string
required

The ID of the customer.

payment_url
string | null
required

URL to redirect the customer to complete payment. Null if no payment action is required.

entity_id
string

The ID of the entity, if the plan was attached to an entity.

invoice
object

Invoice details if an invoice was created. Only present when a charge was made.

required_action
object

Details about any action required to complete the payment. Present when the payment could not be processed automatically.