Skip to content

Open Stripe-hosted payment, invoice, and subscription management

POST
/v1/billing/customer-portal
curl --request POST \
--url https://api.vocapable.com/v1/billing/customer-portal \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "flow": "manage" }'

Mint a customer-scoped Stripe portal session for the authenticated tenant.

We resolve the customer and subscription from the tenant database rather than accepting either ID from the browser. Otherwise a tenant that guessed another cus_ or sub_ identifier could be handed a management link for someone else’s account.

Media typeapplication/json
CustomerPortalRequest

The one action the customer wants Stripe to foreground.

object
flow
Flow
string
default: manage
Allowed values: manage payment_method subscription_update subscription_cancel

Successful Response

Media typeapplication/json
CustomerPortalSession

A one-use-at-a-time redirect target, not a persisted customer credential.

object
url
required
Url
string
flow
required
Flow
string
Allowed values: manage payment_method subscription_update subscription_cancel
Example
{
"flow": "manage"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}