Skip to content

The signed-in ambassador's commission ledger

GET
/api/partner/ledger/
curl --request GET \
--url http://localhost:8000/api/partner/ledger/ \
--header 'Authorization: Bearer <token>'

Every money event on the ambassador’s ledger, newest first — the rows the partner tab’s table draws: a commission or a reversal from Stripe, an adjustment or a fixed fee entered by the programme’s operator. The customer appears as a stable code (Customer 3F2A1B), never a name — the same code the payout sheet shows. Paged with limit / offset; count is the whole ledger. 404 without an ambassador record; 401 without a session; 403 for a partner API key; 400 on a bad page. A platform admin passes ?ambassador=<slug> to read any ambassador’s page (#2517).

ambassador
string

A platform admin (the support account) reads THIS ambassador’s page, exactly as the ambassador sees it, and the read is written to the admin_action trail. Anyone else may pass only their own slug; any other value is the same 404 as having no record.

limit
integer

Rows per page, 1–500 (default 200).

offset
integer

Rows to skip (default 0).

Media typeapplication/json

GET /api/partner/ledger/ — the ambassador’s ledger, newest first.

object
rows
required
Array<object>

One money event on the ambassador’s ledger, as the partner tab lists it.

object
id
required
string format: uuid
paid_on
required

The day the customer paid (UTC) — or, for a hand entry, the day it applies to.

string format: date
month
required

YYYY-MM — the statement month the row belongs to (UTC calendar).

string
customer_ref
required

A stable code in place of the customer’s name — Customer 3F2A1B, the same code the Metabase view and the payout sheet show. Null on a programme-level row (a fee not tied to one customer).

string
nullable
entry_type
required

commission and reversal come from Stripe; adjustment and the one-off payouts fixed_fee, institutional_referral and conversion_bonus are entered by the programme’s operator.

  • commission - Commission
  • reversal - Reversal
  • adjustment - Adjustment
  • fixed_fee - Fixed fee
  • institutional_referral - Institutional referral
  • conversion_bonus - Conversion bonus
string
Allowed values: commission reversal adjustment fixed_fee institutional_referral conversion_bonus
plan_role
required

The customer’s plan tier on the invoice; blank on a hand entry.

string
billing_interval
required

month or year; blank on a hand entry.

string
member_month
required

Months since the customer’s first paid invoice, counting from 1 — what a tiered rate keys on. Null on a hand entry.

integer
nullable
net_cents
required

What the customer paid, excluding tax, USD cents; 0 on a hand entry.

integer
rate_pct
required

The rate applied, percent; 0 on a hand entry.

number format: double
commission_cents
required

Signed, USD cents: a reversal or a deduction is negative.

integer
zero_reason
required
One of:
  • `` - —
  • no_commission_code - No-commission code
string
Allowed values: no_commission_code
held
required

Accrued during a pause and held: joins the first statement after the pause ends.

boolean
statement_period
required

YYYY-MM of the statement the row is on; null until the month-end job has drafted it.

string
nullable
statement_status
required
One of:
  • draft - Draft
  • approved - Approved
  • paid - Paid
  • carried - Carried
string
Allowed values: draft approved paid carried
statement_due_date
required

That statement’s pay-by date (net-30); null when carried or not drafted yet.

string format: date
nullable
statement_paid_on
required

The day that statement was paid, UTC; null until then.

string format: date
nullable
count
required

Rows on the whole ledger, for paging.

integer
limit
required

The page size applied.

integer
offset
required

The offset applied.

integer

Examples

ExampleTwoInvoices,ARefundAndAFee

Two invoices, a refund and a fee

{
"rows": [
{
"id": "5f1c9e2a-1b3d-4c7e-9a6f-2d8b0c4e7a11",
"paid_on": "2026-09-14",
"month": "2026-09",
"customer_ref": "Customer 3F2A1B",
"entry_type": "commission",
"plan_role": "starter",
"billing_interval": "month",
"member_month": 3,
"net_cents": 3900,
"rate_pct": 15,
"commission_cents": 585,
"zero_reason": "",
"held": false,
"statement_period": null,
"statement_status": null,
"statement_due_date": null,
"statement_paid_on": null
},
{
"id": "0c7d4b1e-8a92-4f6b-b3e1-5a2c9d7e4f20",
"paid_on": "2026-08-30",
"month": "2026-08",
"customer_ref": "Customer 9B04CD",
"entry_type": "reversal",
"plan_role": "professional",
"billing_interval": "month",
"member_month": 2,
"net_cents": 9900,
"rate_pct": 15,
"commission_cents": -1485,
"zero_reason": "",
"held": false,
"statement_period": "2026-08",
"statement_status": "approved",
"statement_due_date": "2026-09-30",
"statement_paid_on": null
},
{
"id": "7a3e5c9d-2f4b-4d1a-8e6c-1b9f0a2d3c44",
"paid_on": "2026-08-01",
"month": "2026-08",
"customer_ref": null,
"entry_type": "fixed_fee",
"plan_role": "",
"billing_interval": "",
"member_month": null,
"net_cents": 0,
"rate_pct": 0,
"commission_cents": 5000,
"zero_reason": "",
"held": false,
"statement_period": "2026-08",
"statement_status": "approved",
"statement_due_date": "2026-09-30",
"statement_paid_on": null
}
],
"count": 3,
"limit": 200,
"offset": 0
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string

Example generated

{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string

Example generated

{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string

Example generated

{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string

Examples

ExampleNoAmbassadorRecordOnThisAccount

No ambassador record on this account

{
"detail": "No ambassador record is linked to this account."
}