Create a portal session
POST
Creates a short-lived link to a customer's portal, where they can see and pay their invoices, update their billing information, and cancel subscriptions, as the configuration allows. Use flow_data to send them straight to one task.
apiKeyHeaderheader
x-api-key<token>API key for authentication. Generate from the dashboard or via POST /v1/api-keys.
x-api-key*stringAPI key for authentication
Length
1 <= length- body
customer*stringThe ID of an existing customer.
return_url?stringWhere the portal's “Return to …” link goes. Defaults to the configuration's default_return_url.
Format
uriLength
length <= 2048flow_data?locale?stringLength
length <= 10expires_in?numberSeconds until the URL stops working. 300 to 86400.
Range
300 <= value <= 86400Default
3600Response for status 200
application/json- response
id*stringobject*stringconfiguration*stringcreated*numberUnix seconds
expires_at*numberUnix seconds
customer*stringflow*unknown|nulllivemode*booleanlocale*string|nullreturn_url*string|nullurl*stringThe short-lived portal URL. Send the customer here; it stops working at expires_at.
curl -X POST 'https://api.tryaccess.xyz/api/v1/billing_portal/sessions' \ -H 'x-api-key: string' \ -H 'Content-Type: application/json' \ -d '{ "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1"}'{ "id": "bps_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "object": "billing_portal.session", "configuration": "string", "created": 0, "expires_at": 0, "customer": "string", "flow": null, "livemode": true, "locale": "string", "return_url": "string", "url": "string"}How is this guide?