Demo docs: examples are illustrative.
Referral API

Reward ledger

A double-entry record of every reward, payout, and reversal.

Why a ledger

Rewards change after they're created. A customer refunds, a payment is disputed, or someone on your team adjusts a balance. Instead of editing a number in place, Referral API writes a new entry for each change. Your balance is always the sum of the entries.

Double entry

Every entry moves value between two accounts, so the books always balance:

∑debits=∑credits\sum \text{debits} = \sum \text{credits}
EventDebitCredit
Reward createdReferral expenseRewards payable
Reward paidRewards payableCash
Reward reversedRewards payableReferral expense

Refunds and disputes

A partial refund reduces the reward in proportion. For a reward RR on a payment pp with refund qq:

Rnew=R×p−qpR_{\text{new}} = R \times \frac{p - q}{p}

A dispute always reverses the full reward, whatever your refund rules say.

If the reward was already paid, the reversal leaves a negative balance. It's deducted from the referrer's next reward.

Exporting

Download the ledger as CSV from Reports, or query it with the reporting GraphQL API. Each row includes the entry ID, so you can reconcile it with your accounting system.

Changes in the October export format
  entry_id,reward_id,type,amount,currency,created_at
- rwd_5Gh8kLq1,credit,2000,usd,2026-09-30T12:00:00Z
+ led_9Zx1,rwd_5Gh8kLq1,credit,2000,usd,2026-10-01T12:00:00Z

How is this guide?