Skip to content

Create billing portal session

POST
/billing/portal

Creates a billing portal session. The portal allows customers to view usage, manage subscriptions, update payment methods, and view invoices. The portal URL is valid for a limited time. Redirect the user to the returned URL. Required role: any.

Request body for creating a billing portal session.

object
return_url

URL to redirect to after the customer exits the portal.

string | null

Portal session created

Response containing the billing portal URL.

object
url
required

URL to redirect the customer to for accessing the billing portal.

string

Unauthorized

Billing not configured

Error response for billing operations.

object
error
required

Error message.

string

Server error

Error response for billing operations.

object
error
required

Error message.

string

Billing service unavailable

Error response for billing operations.

object
error
required

Error message.

string