Open the Stripe Customer Portal
POST
/billing/portal
const url = 'https://api.sloose.com/billing/portal';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"returnUrl":"example"}'};
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.sloose.com/billing/portal \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "returnUrl": "example" }'Where a customer changes their card, downloads invoices, or cancels. Everything the portal does reaches us back through the webhook.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
returnUrl
Where Stripe sends the browser afterwards.
string | null
key
additional properties
Examplegenerated
{ "returnUrl": "example"}Responses
Section titled “Responses”Send the browser here.
Media typeapplication/json
object
url
required
string
key
additional properties
Examplegenerated
{ "url": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
Media typeapplication/json
The error envelope every non-2xx answer uses.
object
error
required
Human-readable explanation.
string
code
Machine-readable reason. Absent on a few legacy 400s.
string
key
additional properties
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low, or it was issued for a different org.
Media typeapplication/json
The error envelope every non-2xx answer uses.
object
error
required
Human-readable explanation.
string
code
Machine-readable reason. Absent on a few legacy 400s.
string
key
additional properties
Examplegenerated
{ "error": "example", "code": "example"}This org is a sandbox. Billing is managed on its production org.
Media typeapplication/json
object
error
required
string
code
required
string
key
additional properties
Example
{ "code": "SANDBOX_ORG"}Stripe is not configured, or the org has no Stripe customer yet.
Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{ "error": "example"}