Installation
Configuration
string
default:"\"10\""
Default commission percentage applied to newly approved affiliates. For example,
"10" means 10% of the referred Order total.string
default:"\"50\""
Minimum payout amount in your store’s currency. Affiliates cannot receive a payout below this threshold.
string
default:"\"30\""
How long the referral tracking cookie persists (in days). Conversions attributed after this window are not credited to the affiliate.
How it works
1
Apply
Anyone submits an application via
POST /affiliates/apply with their name, email, and optional website. Their account starts in pending status.2
Approve
Review the application and approve it, optionally with a custom commission rate. The affiliate’s status moves to
approved.3
Create tracking links
Approved affiliates create tracking links via
POST /affiliates/links/create. Each link gets a unique 10-character slug for URL tracking.4
Track clicks
When a visitor clicks an affiliate link,
POST /affiliates/track records the click and increments both the link’s click count and the affiliate’s total click count.5
Record conversions
When a tracked visitor completes a purchase, the Module records a conversion and calculates commission as
orderAmount × (commissionRate / 100).6
Approve conversions
Review each conversion and approve it. Approval updates the affiliate’s aggregate totals: conversions, revenue, and commission.
7
Issue payouts
Create a payout up to the affiliate’s available balance (
totalCommission − totalPaid). Marking a payout complete updates totalPaid.Store endpoints
Submit an application (POST /affiliates/apply)
Admin endpoints
Payouts cannot exceed an affiliate’s available balance (
totalCommission − totalPaid). Attempting to create an overdraft returns null from the controller.