Update Subscription
SDK methods for subscription update (change plan) checkouts in the Limio SDK.
How it works
Starting an update checkout
import React from "react"
import { useBasket } from "@limio/sdk"
const SubscriptionUpdateButton = ({ subscription, updatePageUrl = "/update" }) => {
const { initiateCheckout, basketLoading } = useBasket()
const handleUpdate = async () => {
const basket = await initiateCheckout({
order: {
order_type: "update_subscription",
forSubscription: {
id: subscription.id
}
}
})
const checkoutId = basket.order.checkoutId
window.location.href = `${updatePageUrl}?basket=${checkoutId}`
}
return (
<button onClick={handleUpdate} disabled={basketLoading}>
Change plan
</button>
)
}Selecting a new offer
Field
Type
Description
Clearing items before re-selection
Adding items to a subscription update checkout
Field
Type
Description
Scenario
Method
Quantity updates in subscription update checkouts
Removing an offer from a subscription
Field
Type
Description
Notes
Last updated
Was this helpful?

