Create a billing portal session
POST
/api/workspaces/{workspaceId}/billing/portal
const url = 'http://localhost:8080/api/workspaces/example/billing/portal';const options = { method: 'POST', headers: {cookie: 'auth_session=<auth_session>', 'Content-Type': 'application/json'}, body: '{"successUrl":"https://example.com","cancelUrl":"https://example.com","returnUrl":"https://example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/workspaces/example/billing/portal \ --header 'Content-Type: application/json' \ --cookie auth_session=<auth_session> \ --data '{ "successUrl": "https://example.com", "cancelUrl": "https://example.com", "returnUrl": "https://example.com" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
successUrl
string format: uri
cancelUrl
string format: uri
returnUrl
string format: uri
Example generated
{ "successUrl": "https://example.com", "cancelUrl": "https://example.com", "returnUrl": "https://example.com"}Responses
Section titled “Responses”Stripe-hosted URL to redirect the user to.
Media typeapplication/json
object
url
required
string format: uri
Example generated
{ "url": "https://example.com"}Invalid request
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Authentication required
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Forbidden
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Not found
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Conflict
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Internal server error
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}