Set automatic top-up
import requests
url = "https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up"
payload = {
"enabled": True,
"threshold_cents": 123,
"amount_cents": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, threshold_cents: 123, amount_cents: 123})
};
fetch('https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold_cents": 123,
"amount_cents": 123
}
'{
"configured": true,
"enabled": true,
"live": true,
"threshold_micros": 123,
"threshold_display": "<string>",
"amount_cents": 123,
"daily_cap_cents": 123,
"monthly_cap_cents": 123,
"platform_max_daily_cents": 123,
"platform_max_monthly_cents": 123,
"card_on_file": true,
"activated_at": "2023-11-07T05:31:56Z",
"suspended_at": "2023-11-07T05:31:56Z",
"suspended_reason": "<string>",
"consecutive_failures": 123,
"last_succeeded_at": "2023-11-07T05:31:56Z",
"attempts": [
{}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Billing
Set automatic top-up
Turns automatic top-up on or off for the organisation the token acts in and sets the balance threshold that triggers it, the amount it buys and its daily and monthly caps (caps left out take a default derived from the amount, bounded by the platform ceilings). It charges the card already on file; no card data passes through this API. Requires billing.manage, checked against the token’s scopes and then against the member’s role whatever the authorisation rollout state; a token pinned to a project is refused, since billing has no per-project form.
PUT
/
api
/
v1
/
org
/
billing
/
wallet
/
auto-top-up
Set automatic top-up
import requests
url = "https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up"
payload = {
"enabled": True,
"threshold_cents": 123,
"amount_cents": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, threshold_cents: 123, amount_cents: 123})
};
fetch('https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/billing/wallet/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold_cents": 123,
"amount_cents": 123
}
'{
"configured": true,
"enabled": true,
"live": true,
"threshold_micros": 123,
"threshold_display": "<string>",
"amount_cents": 123,
"daily_cap_cents": 123,
"monthly_cap_cents": 123,
"platform_max_daily_cents": 123,
"platform_max_monthly_cents": 123,
"card_on_file": true,
"activated_at": "2023-11-07T05:31:56Z",
"suspended_at": "2023-11-07T05:31:56Z",
"suspended_reason": "<string>",
"consecutive_failures": 123,
"last_succeeded_at": "2023-11-07T05:31:56Z",
"attempts": [
{}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Headers
Body
application/json
Response
The automatic top-up settings