Open Stripe-hosted payment, invoice, and subscription management
POST
/v1/billing/customer-portal
const url = 'https://api.vocapable.com/v1/billing/customer-portal';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"flow":"manage"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
CustomerPortalRequest
The one action the customer wants Stripe to foreground.
object
flow
Flow
string
Responses
Section titled “Responses”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
Example
{ "flow": "manage"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
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": {} } ]}