Create a portal session
Creates a new customer portal session, returning a token and URL to redirect the customer to their billing portal. The selected customer must have an email address because the signed session token is tied to that email.
Authorizations
The Server API Key obtained from the kelviq application. Pass as a Bearer token in the Authorization header. Example: 'Authorization: Bearer YOUR_API_KEY'
Body
The unique identifier of the customer for whom the portal session is being created. The customer must exist in the authenticated organization and have an email address.
"cust_789"
Response
Portal Session Created
The session token for authenticating the customer portal session.
"cpt-4f7c5dc4-da9f-447b-d447-6266dc35ed6d:23fca530-adeb-4685-b3d5-9928c6d38275"
The email address of the customer.
"geo@example.com"
The customerPortalUrl field contains the customer’s billing portal URL. This URL alone does not authenticate the customer session. To generate a signed portal link, append the token value from the same response as a query parameter using the following format:
${customerPortalUrl}?token=${token}
Example response:
Generated signed portal link:
https://www.kelviq.com/portal/aphelo/?token=cpt-4f7c5dc4-da9f-447b-d447-6266dc35ed6d:23fca530-adeb-4685-b3d5-9928c6d38275
The generated URL can be safely shared with the customer to provide direct access to their billing portal session.