Open the Stripe billing portal
import requests
url = "https://platform.ankra.app/api/v1/org/billing/portal-session"
payload = { "return_url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({return_url: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/billing/portal-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/billing/portal-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_url": "<string>"
}
'{
"url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Billing
Open the Stripe billing portal
Creates a Stripe customer portal session for the organisation the token acts in and returns its URL, where payment methods, billing details and invoices are managed on Stripe’s own page. No card data passes through this API. Requires billing.manage, enforced whatever the authorisation rollout state.
POST
/
api
/
v1
/
org
/
billing
/
portal-session
Open the Stripe billing portal
import requests
url = "https://platform.ankra.app/api/v1/org/billing/portal-session"
payload = { "return_url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({return_url: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/billing/portal-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/billing/portal-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_url": "<string>"
}
'{
"url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Act in another organisation the token's owner is an active member of; defaults to the token's own organisation.
Body
application/json
return_url must be on the platform origin; it defaults to the organisation's billing page.
Response
The Stripe portal URL to open in a browser