pk_) or secret (lk_) key, so they’re safe to call from the
browser.
Enroll a referrer
POST /api/v1/referrals/enroll — enroll a user as a referrer and mint their referral link.
Idempotent on (workspace, external_user_id).
Body parameters
Response
Report a signup
POST /api/v1/referrals/report-signup — tell TrackRev that a referred user signed up, so the
referrer earns their reward. Idempotent per new user.
Body parameters
The referrer is resolved in order:ref_code → _vid → referrer_external_user_id. TrackRev runs
self-referral checks; blocked grants are recorded as revoked and no
reward webhook fires.
Response
If no referrer matches, the response is
{ "matched": false } with a 200 status — a signup with
no referrer isn’t an error.Report a purchase
POST /api/v1/referrals/report-purchase — tell TrackRev a user paid, so their referrer earns the
purchase-side reward: a cash commission at the program’s affiliate terms when the referrer is in
affiliate mode, the qualifying-sale credit on credit programs, and multi-tier fan-out where enabled.
Only needed when your billing is not a connected provider — Stripe, Paddle Billing, Polar,
Lemon Squeezy, Creem and Dodo Payments report purchases automatically through their webhooks and never need this call.
Requires a secret key (this mints money). Idempotent per order_id: replays return the same
order and never double-credit.
Body parameters
The referrer is resolved from the buyer’s reported signup (report-signup), so report signups
first — a purchase by a user whose signup was never reported returns { "matched": false }.
Response
Present when the referral matched but nothing was written because of the plan:
plan_has_no_commission_tracking (free plan — commission tracking needs a paid plan). No paid plan caps commission, so there is no other plan-related reason.Get referral stats
GET /api/v1/referrals/stats — a user’s referral link, windowed stats, lifetime rewards and a
daily series. This is the endpoint behind the dashboard embed.
Auto-enrolls the user if they aren’t a referrer yet (idempotent — same as
enroll).
Query parameters
Response
All-time rewards:
cash (currency, pending, paid, total, in major currency units —
e.g. dollars) and credits
(per kind: earned, delivered, pending).How this user is currently rewarded:
referrer (credits) or affiliate (cash commissions).
See Set the reward mode.Affiliate-mode details:
allowed (whether the program offers the upgrade), min_payout
(major currency units, same as lifetime.cash; the threshold of the campaign the user is paid
under), payout_methods (the methods the program offers: any of paypal, payoneer, wise),
payout_method (the saved choice, { method, email, paypal_email } with the address masked, or null),
recent_commissions (date, type, amount, earnings, status) and payouts
(date, amount, status).Errors use the standard envelope — e.g.
401 unauthorized for a missing
or invalid key, 400 bad_request for invalid parameters such as a missing external_user_id.Set the reward mode
POST /api/v1/referrals/reward-mode — switch a user between referrer mode (earn credits)
and affiliate mode (earn cash commissions at the program’s commission rate). Powers the
toggle in the dashboard embed. The switch
affects future conversions only — credits already earned are kept — and is reversible.
Body parameters
Response
Errors use the standard envelope —
403 forbidden when the program
doesn’t allow the affiliate upgrade, 400 bad_request for an invalid mode or missing
external_user_id.Set the payout method
POST /api/v1/referrals/payout-method — save where an affiliate-mode user gets paid. Only
accepted while the enrollment is in affiliate mode (403 forbidden otherwise). The address is
stored on the user’s enrollment in your program: it never changes how other merchants pay
the same affiliate, and it takes precedence over the address the affiliate set in their own
partner-portal settings when you export payouts.
Body parameters
paypal, payoneer or wise — and one your program offers (400 method_not_offered otherwise). Bank transfers aren’t available yet.The email on the user’s account for that method.
paypal_email is accepted as an alias.
