Skip to main content
Use this flow when the customer picks a different plan on your page while the checkout is already mounted — for example, switching from a monthly to a yearly plan on a paywall. The checkout reads the session — amount, plan, and available payment methods — once, when it mounts. Updating the session on your server doesn’t change a checkout that is already on screen, and 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.
If you skip the remount, the checkout keeps showing the previous price. Apple Pay and Google Pay open their payment sheets with that previous amount, so the customer may approve a price that differs from the updated session.

Steps

  1. Pause payments. Call checkout.setPaymentsEnabled(false) so the customer can’t start a payment while the session is changing.
  2. Update the session on your server. Call PATCH /client-session/{id} with the new plan. The session ID stays the same.
  3. Remount the checkout. Call await checkout.unmount(), then mount() again with the same clientToken. The checkout loads the updated session and shows the new price.
Remounting clears the form, so anything the customer has typed — such as card details — is lost.

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
The response is the updated session, in the same format as the create response.
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:
The remount takes paymentsEnabled from config, so payments work again after it — unless your config sets paymentsEnabled: false to gate them behind your own UI.
Instead of updating the session, you can also create a new session for the new plan and mount the checkout with its ID. Updating keeps the same session ID, so you don’t need to replace the token you stored.