Skip to content
POST /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

codestring
Example: STARTUPS-7KQ2MZ4P
pro_continue_consentboolean

The person ticked "Pro continues after the credits", for an offer that asks it.

pro_continue_consent_textstring

The text of the box they ticked.

team_idstring · uuid

Or ?team_id=.

Response Body

resultobject

An offer the team got, by a code or from Truto, and what it gives.

codestring
code_idstring · uuid
created_atstring · date-time
credit_grantobject

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
activated_atstring · date-time
amount_centsinteger

Credits given, in cents.

end_reasonstring

replaced only on grants from before credits added up.

Possible values:
expiredused_uprevokedenterprisereplaced
ended_atstring · date-time
expires_atstring · date-time
granted_atstring · date-time
idstring · uuid
includes_proboolean

Pro is turned on, paid by the credits, when they switch on.

left_centsinteger

Credits left, in cents. 0 once ended.

offer_idstring · uuid
offer_keystring
Example: startups
offer_namestring
Example: Truto for Startups
pays_forobject
2 properties
proboolean
usageboolean
pro_cap_centsinteger

The most these credits pay of Pro. Null for no cap.

pro_cap_left_centsinteger

What is left of pro_cap_cents. Null for no cap, and once ended.

pro_continue_askboolean

The card dialog asks whether Pro continues on the card after the credits end (pro_continue_consent).

pro_paid_by_creditsboolean

This grant pays Pro now.

statusstring

locked until the team saves a card.

Possible values:
lockedactiveended
team_offer_idstring · uuid
discountsobject[]
18 properties
amount_off_centsinteger
applies_tostring

usage never covers calls through Truto's own Google and QuickBooks apps.

Possible values:
prousage
descriptionstring
Example: Pro: $249.50 a month until Mar 1, 2027, then $499
durationstring
Possible values:
oncerepeatingforever
duration_monthsinteger
end_reasonstring
Possible values:
expiredusedstaffreplaced
ended_atstring · date-time
ends_atstring · date-time

Null for a discount with no end (forever, or once until the charge that uses it).

features_back_atstring · date-time

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).

idstring · uuid
namestring
Example: Startups
offer_idstring · uuid
offer_namestring
percent_offinteger
sourcestring
Possible values:
staffcode
starts_atstring · date-time
statusstring
Possible values:
scheduledactiveended
team_offer_idstring · uuid
effectsobject[]

What the offer gives, as blocks (credits, discount, pro, features, limits, services), copied when the team got it.

end_reasonstring
Possible values:
expiredstaffdone
ended_atstring · date-time
ends_atstring · date-time
features_offstring[]
idstring · uuid
limitsRecord<string, any>

Limits the offer sets while it is live. Null means no limit.

linesstring[]

The same, in plain lines.

Example: ["50% off Pro for 3 months.","Pro without: Single sign-on (SSO)."]
offer_idstring · uuid
offer_keystring
offer_namestring
overrides_synced_atstring · date-time
pro_onboolean

The offer turns Pro on.

pro_outcomestring

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.

Possible values:
tryingalready_oncreditsno_cardonfailedneeds_consentexpired
restored_atstring · date-time

When what the offer changed was put back, after it ended.

starts_atstring · date-time
statusstring
Possible values:
liveended
team_idstring · uuid

Errors

StatusDescription
400The 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).
403Forbidden 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())