Create a customer session
Create the session on your server, for the signed-in user:- The
tokenstarts withpolar_mst_and expires after one hour (expires_at). Create a new one when it runs out. - For a team customer, pass
member_idorexternal_member_idto act as a specific member. Without it, the session is for the customer’s owner. What a member can do depends on their role. - The token only grants access to that customer’s data, so it’s safe to use in the browser. Your access token never is.
Creating customer sessions is API only. Not available from the CLI or MCP server.
2026-10.
Call the Customer Portal API
Use the session token as the bearer token. With the SDKs, create a second client with it:
See the Customer Portal API group in the API reference for every endpoint.
Portal settings apply here too
Your portal settings are enforced in this API, not only in the hosted portal. With Enable subscription plan changes off, for example, a plan change through the Customer Portal API fails with403. Hide those actions in your UI when the matching setting is off.
The exception is Show metered usage: it only hides the hosted Usage page. The meters endpoints keep working.
Your backend isn’t limited by these settings. The merchant endpoints, like Update Subscription, work whatever the portal allows.
Recover failed payments
When a renewal fails, the customer needs a working default payment method. Two ways to give them one in your app:- A new card. Open the Embedded Payment Method with the session token. The card is attached and becomes the default unless you pass
setAsDefault: false. Card details never touch your servers. - A saved card. Set
default_payment_method_idwith Update Customer to switch to a card the customer already saved.

