Affiliates
Affiliate enrollment, referrals, commissions, and withdrawals.
Description
The affiliate program lets any user enroll, generate a referral code, and earn a commission (2%–5% depending on tier) on subscriptions purchased through their referrals. Payouts are reviewed and marked paid manually by an admin out-of-band (bank transfer, PayPal, etc) — Dodo Payments only exposes a read-only settlements API today, not an outbound transfer API.
Off by default in production
The entire group is gated behind a feature flag (config.growth.affiliateProgramEnabled), which
defaults off in production until explicitly enabled. Every route in this group — including the
public ones — returns 503 while the flag is off.
Authentication
| Method | Access Level | Requirement |
|---|---|---|
POST /affiliates/click, GET /affiliates/leaderboard | Public | None. |
| All other routes | Authenticated | Session cookie only — no API key support. |
Available Endpoints
POST /affiliates/click— Track Affiliate ClickGET /affiliates/leaderboard— Get Affiliate LeaderboardGET /affiliates/me— Get My Affiliate DashboardPOST /affiliates/enroll— Enroll As AffiliatePOST /affiliates/referral— Apply Affiliate Referral CodePOST /affiliates/withdrawals— Request Affiliate Withdrawal
Create Extra Credit Pack CheckoutPOST
Creates a one-time Dodo Payments checkout session for an extra AI credit pack, on top of any subscription. Session-authenticated only; blocked for non-admins in production during the current rollout phase.
Track Affiliate ClickPOST
Public, unauthenticated endpoint. Records a click against an affiliate's referral code. Entire affiliate program is gated behind a feature flag (`config.growth.affiliateProgramEnabled`) that defaults off in production until explicitly enabled — every route in this group, including this one, returns `503` while the flag is off.