Skip to content
POST /billing/portal-session

Returns a short-lived Stripe Customer Portal URL where the team can update its card, billing address, email and tax IDs and download invoices. Redirect the browser to url; Stripe sends the user back to return_url.

Request Body

return_urlstring

Must be a URL on this deployment's app origin. Defaults to the Billing settings page.

team_idstring · uuid

Response Body

urlstring
Example: https://billing.stripe.com/p/session/test_abc

Errors

StatusDescription
400return_url is not on the app origin
403Forbidden if the caller is not an admin of the team
404The team has no Stripe customer yet
503Billing is not configured on this deployment (STRIPE_SECRET_KEY unset)
curl -X POST 'https://api.truto.one/billing/portal-session' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "team_id": "your_team_id",
  "return_url": "your_return_url"
}'
const body = {
  "team_id": "your_team_id",
  "return_url": "your_return_url"
};

const response = await fetch('https://api.truto.one/billing/portal-session', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/billing/portal-session"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "team_id": "your_team_id",
    "return_url": "your_return_url"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())