Redeem a code
/billing/promotion-code
Gives the team (team_id) the code's offer: credits, discounts, Pro, features, limits and services. Only a team admin can redeem. All of it lands at once, or none. Codes are not case sensitive. Never refused for no card (credits switch on when the team saves one) or for credits the team already holds (credits add up). A later discount on the same thing replaces the earlier one. The same team redeeming the same code again gets its team offer back. Pro is turned on once: with no card it waits for one (pro_outcome no_card).
Request Body
STARTUPS-7KQ2MZ4PThe person ticked "Pro continues after the credits", for an offer that asks it.
The text of the box they ticked.
Or ?team_id=.
Response Body
An offer the team got, by a code or from Truto, and what it gives.
One credit grant, from one offer the team got (for example Truto for Startups). Kept apart from the prepaid balance. Credits pay usage past the free calls (never calls through Truto's own Google and QuickBooks apps), and Pro when the offer includes it. Locked until the team saves a card; they last valid_days from then.
19 properties
Credits given, in cents.
replaced only on grants from before credits added up.
expiredused_uprevokedenterprisereplaced
Pro is turned on, paid by the credits, when they switch on.
Credits left, in cents. 0 once ended.
startupsTruto for Startups2 properties
The most these credits pay of Pro. Null for no cap.
What is left of pro_cap_cents. Null for no cap, and once ended.
The card dialog asks whether Pro continues on the card after the credits end (pro_continue_consent).
This grant pays Pro now.
locked until the team saves a card.
lockedactiveended
18 properties
usage never covers calls through Truto's own Google and QuickBooks apps.
prousage
Pro: $249.50 a month until Mar 1, 2027, then $499oncerepeatingforever
expiredusedstaffreplaced
Null for a discount with no end (forever, or once until the charge that uses it).
For an offer that took features out of Pro: when they come back (full price means full Pro). The discount's end, or for a used once, the 1st after the month it paid; after that, when they came back. Null for any other discount, and while the end is not known (forever, once not used yet).
Startupsstaffcode
scheduledactiveended
What the offer gives, as blocks (credits, discount, pro, features, limits, services), copied when the team got it.
expiredstaffdone
Limits the offer sets while it is live. Null means no limit.
The same, in plain lines.
["50% off Pro for 3 months.","Pro without: Single sign-on (SSO)."]The offer turns Pro on.
no_card: Pro turns on when the team saves a card, within 30 days and while the offer is open. A card is then charged only if the team agreed Pro goes on its card; credits or a discount that pay all of the month need no agreement. needs_consent: the card would be charged and the team never agreed. expired: the 30 days passed or the offer closed. In both, the team can turn Pro on in Billing.
tryingalready_oncreditsno_cardonfailedneeds_consentexpired
When what the offer changed was put back, after it ended.
liveended
Errors
| Status | Description |
|---|---|
400 | The code does not apply. truto_error_code: credit_code_invalid (unknown or paused), code_expired (the link is past its redeem_by), credit_code_expired (the offer ended), credit_code_used_up, credit_code_locked (this link is for another email), credit_code_not_eligible (the offer is not for this team), promotion_closed (the offer is paused, not started, ended or full), credit_invoiced_team (an Enterprise team, paid by invoice), promotion_redeemed (the team already has this offer from another code). |
403 | Forbidden if the caller is not an admin of the team |
curl -X POST 'https://api.truto.one/billing/promotion-code' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"team_id": "your_team_id",
"code": "STARTUPS-7KQ2MZ4P",
"pro_continue_consent": true,
"pro_continue_consent_text": "your_pro_continue_consent_text"
}'const body = {
"team_id": "your_team_id",
"code": "STARTUPS-7KQ2MZ4P",
"pro_continue_consent": true,
"pro_continue_consent_text": "your_pro_continue_consent_text"
};
const response = await fetch('https://api.truto.one/billing/promotion-code', {
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/promotion-code"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"team_id": "your_team_id",
"code": "STARTUPS-7KQ2MZ4P",
"pro_continue_consent": True,
"pro_continue_consent_text": "your_pro_continue_consent_text"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())