A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"owner_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": true,
"referred_count": 123,
"rate_basis_points": 123,
"fixed_amount_minor": 123,
"fixed_currency": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "referral_code_taken",
"message": "this environment already has a referral code with that string"
}
}Issue a referral code
Requires billing:write. Gives one of your own users a code to share, and states what you will owe for it.
Exactly one of rate_basis_points (a share of what the referred team pays) or fixed_amount_minor with fixed_currency (a flat bounty). There is no environment-wide default to fall back on: a code with no terms is a payout nobody agreed to.
Codes are issued here rather than minted by the person who holds them — a code anybody can mint for themselves is a code an attacker mints in a loop and attaches to sign-ups they control.
A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"owner_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": true,
"referred_count": 123,
"rate_basis_points": 123,
"fixed_amount_minor": 123,
"fixed_currency": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "referral_code_taken",
"message": "this environment already has a referral code with that string"
}
}Autorizações
A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.
Cabeçalhos
The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.
Parâmetros de consulta
Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.
live, test Corpo
Whose code this is, resolved inside the environment above. A contact from the other environment answers 404.
What goes in the ?ref= link. Trimmed and upper-cased before it is stored and before it is looked up, so ana and ANA are one code.
A share of what the referred team actually pays: 3000 is 30%. Between 1 and 10000.
A flat bounty in minor units, proportional to what stays paid after refunds.
Required with fixed_amount_minor. A payment in another currency is refused rather than converted — an exchange rate is not something this system holds.
Resposta
The code, ready to be shared.
A code one of your users shares, and the terms you promised for it. Exactly one of rate_basis_points and fixed_amount_minor is set; the other reads null rather than being omitted, so a reader cannot mistake an absent field for one they never heard of.
What goes in the ?ref= link, upper-cased.
Whose code it is.
Whether it still attributes new sign-ups. Turning it off touches nothing already attributed.
How many contacts this code brought in.
A share of what the referred team pays: 3000 is 30%.
A flat bounty in minor units, earned in proportion to what stays paid after refunds.
The currency of the flat bounty. A payment in another currency is refused rather than converted.