Redeem a credit code
import requests
url = "https://platform.ankra.app/api/v1/org/billing/wallet/redeem"
payload = { "code": "<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({code: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/billing/wallet/redeem', 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/wallet/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'{
"redemption_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"granted_micros": 123,
"granted_display": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"net_position_micros": 123,
"net_position_display": "<string>",
"promoted_to_payg": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Billing
Redeem a credit code
Redeems a promotional credit code into the wallet of the organisation the token acts in and answers the credit granted and the wallet’s new position. A service-account token is refused: a code is claimed by a person. 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.
POST
/
api
/
v1
/
org
/
billing
/
wallet
/
redeem
Redeem a credit code
import requests
url = "https://platform.ankra.app/api/v1/org/billing/wallet/redeem"
payload = { "code": "<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({code: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/billing/wallet/redeem', 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/wallet/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'{
"redemption_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"granted_micros": 123,
"granted_display": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"net_position_micros": 123,
"net_position_display": "<string>",
"promoted_to_payg": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}