Skip to main content
POST
Create a portal session
Click the base URL in the API playground and select the Sandbox host for test data or the Production host for live data. Use credentials from the same environment.

Authorizations

Authorization
string
header
required

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

application/json
customerId
string
required

The unique identifier of the customer for whom the portal session is being created.

Example:

"cust_789"

Response

Portal Session Created

token
string

The session token for authenticating the customer portal session.

Example:

"cpt-4f7c5dc4-da9f-447b-d447-6266dc35ed6d:23fca530-adeb-4685-b3d5-9928c6d38275"

email
string<email>

The email address of the customer.

Example:

"geo@example.com"

customerPortalUrl
string<url>

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.