Redeem a promo code
curl --request POST \
--url https://api.capibo.work/v1/billing/promo-codes/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "CAL_HACKS"
}
'import requests
url = "https://api.capibo.work/v1/billing/promo-codes/redeem"
payload = { "code": "CAL_HACKS" }
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: 'CAL_HACKS'})
};
fetch('https://api.capibo.work/v1/billing/promo-codes/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"transaction": {
"id": "TXN-81009",
"kind": "credit",
"description": "Promo code CAL_HACKS redeemed",
"amount": 50000,
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z"
},
"balance": 68420.55
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key."
}
}{
"error": {
"type": "not_found",
"code": "promo_code_invalid",
"message": "\"CALHACKS\" isn't a valid promo code."
}
}{
"error": {
"type": "conflict",
"code": "promo_code_redeemed",
"message": "CAL_HACKS has already been redeemed on this account."
}
}Billing
Redeem a promo code
Adds the code’s credit to your balance. Each code can be redeemed once per organization.
POST
/
billing
/
promo-codes
/
redeem
Redeem a promo code
curl --request POST \
--url https://api.capibo.work/v1/billing/promo-codes/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "CAL_HACKS"
}
'import requests
url = "https://api.capibo.work/v1/billing/promo-codes/redeem"
payload = { "code": "CAL_HACKS" }
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: 'CAL_HACKS'})
};
fetch('https://api.capibo.work/v1/billing/promo-codes/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"transaction": {
"id": "TXN-81009",
"kind": "credit",
"description": "Promo code CAL_HACKS redeemed",
"amount": 50000,
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z"
},
"balance": 68420.55
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key."
}
}{
"error": {
"type": "not_found",
"code": "promo_code_invalid",
"message": "\"CALHACKS\" isn't a valid promo code."
}
}{
"error": {
"type": "conflict",
"code": "promo_code_redeemed",
"message": "CAL_HACKS has already been redeemed on this account."
}
}Authorizations
An API key from Settings → API keys, e.g. cpb_live_… or cpb_test_….
Body
application/json
Case-insensitive.
Example:
"CAL_HACKS"