Skip to main content

Session Management

Update the Client Session

When cart details change, update the client session with checkout.setSession().

async function updateSession(newSession) {
return checkout.setSession(newSession);
}
When should you update the client session?
  • When you handle payment methods outside of the checkout widget
  • When you update the cart details like amount, delivery options, etc.
  • When the session has expired

Set a Wallet Session

To manage saved payment methods, create a WalletSession using checkout.setWalletSession().

async function setWalletSession(walletSession) {
return checkout.setWalletSession(walletSession);
}
For V2 API users

A WalletSession is automatically created when you initialize the checkout. No need to call setWalletSession.