Subscription update checkouts use order_type: "update_subscription". The SDK detects this automatically and routes mutations through the subscription update API.
How it works
From a subscription management page, call initiateCheckout with order_type: "update_subscription" and a forSubscription reference.
The server creates an update checkout session and returns a checkoutId.
Redirect the subscriber to the update checkout page with the checkoutId.
On the offer selection page, use selectOfferForSubscriptionUpdate to let the subscriber pick a new plan.
The server resolves effective dates, proration, and next actions, then returns the updated basket.
Starting an update checkout
Use initiateCheckout with order_type: "update_subscription" and the subscription ID. This creates the server-side update session.
The forSubscription.id tells the server which subscription is being modified. The response includes the checkoutId used to track this update session.
Selecting a new offer
Once the update checkout session exists, use selectOfferForSubscriptionUpdate on the offer selection page. Only one offer can be active at a time — selecting a new offer resets the checkout and re-resolves server-side state.
Parameters:
Field
Type
Description
offer
ElasticOffer
The offer the subscriber is switching to
quantity
number
Quantity (typically 1 for plan changes)
Selecting a new offer drops all existing order items and sends the new selection to the server. The server returns updated next actions, effective dates, and any proration details.
Clearing items before re-selection
When the subscriber changes their mind and picks a different offer, call clearOrderItems() before selectOfferForSubscriptionUpdate. This ensures the server re-resolves everything cleanly for the new selection.
clearOrderItems is a synchronous operation that empties the local basket state. The subsequent selectOfferForSubscriptionUpdate call syncs with the server.
Quantity updates in subscription update checkouts
updateItemQuantity behaves differently in subscription update checkouts. Instead of calling the standard basket API, it routes through the subscription update API so the server can recalculate proration and effective dates.
You don't need to handle this routing yourself — the SDK detects order_type: "update_subscription" and uses the correct endpoint.
Notes
Start every update flow with initiateCheckout using order_type: "update_subscription" and forSubscription: { id }.
Always call clearOrderItems() before selecting a different offer to avoid stale server state.
The ownerId query parameter identifies which subscription is being updated — pass it through when redirecting.
Server-driven state means the basket response may include fields not present in standard checkouts (effective dates, next actions, proration details).
See Basket (Cart) for all other basket methods (adding items, promo codes, checkout navigation, etc.).
import React from "react"
import { useBasket } from "@limio/sdk"
const UpgradeOption = ({ offer, currentOfferId }) => {
const { selectOfferForSubscriptionUpdate, clearOrderItems, basketLoading } = useBasket()
const handleSelect = async () => {
// Clear existing items first — the server will re-resolve
// effective dates and side-effects for the new selection
if (currentOfferId && currentOfferId !== offer.id) {
clearOrderItems()
}
await selectOfferForSubscriptionUpdate({
offer,
quantity: 1
})
// Redirect to the update checkout page
const params = new URLSearchParams(window.location.search)
const checkoutId = params.get("basket")
const ownerId = params.get("ownerId")
window.location.assign(`/update?basket=${checkoutId}&ownerId=${ownerId}`)
}
return (
<button onClick={handleSelect} disabled={basketLoading}>
Select {offer.data.attributes.display_name__limio}
</button>
)
}
const { clearOrderItems, selectOfferForSubscriptionUpdate } = useBasket()
// User changed their mind — clear and re-select
clearOrderItems()
await selectOfferForSubscriptionUpdate({ offer: newOffer, quantity: 1 })
const { updateItemQuantity } = useBasket()
// In a subscription update checkout, this automatically
// uses the subscription update API under the hood
await updateItemQuantity(itemId, 3)