Skip to content

Create customer portal session

POST
/v1/billing/portal

Create a Stripe customer portal session for managing subscription, payment methods, and billing history.

object
return_url

URL to return to after portal session (must be from allowed origin)

string format: uri
Example
https://app.hookbridge.io/billing
Example
{
"return_url": "https://app.hookbridge.io/billing"
}

Portal session created successfully

object
data
object
portal_url

URL to redirect user to Stripe customer portal

string format: uri
Example
https://billing.stripe.com/p/session/abc123
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"data": {
"portal_url": "https://billing.stripe.com/p/session/abc123"
},
"meta": {
"request_id": "req_xyz123"
}
}

Invalid return URL

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "INVALID_RETURN_URL",
"message": "Return URL not from allowed origin"
},
"meta": {
"request_id": "req_xyz123"
}
}

Unauthorized - Invalid or missing API key

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"meta": {
"request_id": "req_xyz123"
}
}

No subscription found

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "NO_SUBSCRIPTION",
"message": "No subscription found for tenant"
},
"meta": {
"request_id": "req_xyz123"
}
}
Personalize Examples

Enter your credentials to populate code examples throughout the docs.