A valid request URL is required to generate request examples{
"balances": [
{
"referral_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"active": true,
"owner_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_name": "<string>",
"owner_email": "<string>",
"currency": "<string>",
"earned_minor": 123,
"reversed_minor": 123,
"owed_minor": 123,
"entry_count": 123
}
],
"entries": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"kind": "earned",
"amount_minor": 123,
"currency": "<string>",
"basis_minor": 123,
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referred_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"payouts_are_manual": true
}{
"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"
}
}What the referral programme owes
Requires billing:read. Per code and currency: what was earned, what came back, and the fold between them — plus the lines behind the number.
A balance is SUM(amount_minor) over an append-only table, never a stored figure, and it is grouped by currency because adding two currencies would be inventing an exchange rate. A refund appends a negative line rather than removing the positive one: the payment did happen, and the money going back is a second thing that happened.
payouts_are_manual is true and says so on purpose. Nothing in this system transfers money to an affiliate; this report is what somebody pays from.
A valid request URL is required to generate request examples{
"balances": [
{
"referral_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"active": true,
"owner_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_name": "<string>",
"owner_email": "<string>",
"currency": "<string>",
"earned_minor": 123,
"reversed_minor": 123,
"owed_minor": 123,
"entry_count": 123
}
],
"entries": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referral_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"kind": "earned",
"amount_minor": 123,
"currency": "<string>",
"basis_minor": 123,
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"referred_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"payouts_are_manual": true
}{
"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"
}
}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 Commission lines per page.
x <= 200Commission lines to skip.