POST
/
billingAccounts
/
{billingAccountId}
/
portalSession
curl --request POST \
  --url https://api.withampersand.com/v1/billingAccounts/{billingAccountId}/portalSession \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "redirectUrl": "https://dashboard.withampersand.com/the-current-page",
  "timeout": 3600
}'
{
  "url": "https://billing.portal.com/customer/session"
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

billingAccountId
string
required

Body

application/json
redirectUrl
string
required

The URL to redirect to once a portal session is exited.

Example:

"https://dashboard.withampersand.com/the-current-page"

timeout
integer

The number of seconds before the portal session expires.

Example:

3600

Response

200
application/json
OK
url
string
required

The URL to redirect to in order to start the portal session.

Example:

"https://billing.portal.com/customer/session"