checkout.update() can’t change it either: it updates only display settings such as locale and theme. To show the new price, update the session and then remount the checkout.
Steps
- Pause payments. Call
checkout.setPaymentsEnabled(false)so the customer can’t start a payment while the session is changing. - Update the session on your server. Call
PATCH /client-session/{id}with the newplan. The session ID stays the same. - Remount the checkout. Call
await checkout.unmount(), thenmount()again with the sameclientToken. The checkout loads the updated session and shows the new price.
Update the Session
Send only the objects you want to change. Each top-level object you send —plan, customer, subscription, payment, options — replaces that object in the session as a whole. Objects you don’t send stay as they are.
cURL
Because
plan is replaced as a whole, a custom plan.price you set earlier is dropped unless you send it again. A custom price is supported for one-off plans only.Remount the Checkout
Call your server endpoint from the client, then remount with the same token:paymentsEnabled from config, so payments work again after it — unless your config sets paymentsEnabled: false to gate them behind your own UI.
Related
- Update Configuration at Runtime — what
checkout.update()can change without a remount - Handle Expired Sessions — create a new session when the current one expires