Create a session
Call this from your backend with your API key.
Pass the session token to the browser. Don’t pass your API key.
Call portal endpoints
Send the portal token as a Bearer token:Endpoints
Show the plan-change preview before the customer confirms a change.