Affiliate Object
An affiliate contains information about their account, performance metrics, and nested account details:Key Fields
id: Store affiliate public ID (prefixed withsaff_)status: Current status (activeorsuspended)source: How the affiliate joined (e.g.,invitation,network)total_visits: Number of referral link visitstotal_sales: Number of completed sales from referralstotal_earnings: Total commission earned with formatted amountaccount: Nested affiliate account details including user informationaccount.user: The affiliate’s user profile (name, email, etc.)account.pseudo: Display name used by the affiliateaccount.country: The affiliate’s country (name, ISO codes, dial code, currency and flag)suspended_at: Timestamp when suspended (null if active)suspended_reason: Reason for suspension (null if active)
Affiliate Statuses
Getting an Affiliate
Retrieve a specific affiliate using their unique referral code:- Validating an affiliate code before applying commissions
- Displaying affiliate information on your website
- Building affiliate dashboards
Sending Affiliate Invitations
Invite potential affiliates to join your programme by sending invitation emails:Batch Invitations
You can send up to 25 invitations in a single request. The API will:- Create and send invitations for valid new emails
- Skip emails that are already registered affiliates
- Skip emails that have pending invitations
- Lower-case the addresses and drop duplicates
data only holds the invitations created, and is empty when every address was skipped. The message reads Invitation sent successfully. for one invitation and N invitations sent successfully. otherwise.
Response
Invitation Object
An invitation contains information about its status and expiration:Invitation Statuses
Webhook Events
When an affiliate joins your store, whether through an invitation or the affiliate network, a webhook event is triggered via Pulses. The event is signed and recorded like every other Pulse event; see the Pulses guide for the payload details.affiliate.joined
Triggered when a new affiliate joins your store.Implementation Example
Here’s a complete example of managing affiliates in your application:API Endpoints Summary
Best Practices
Affiliate Code Validation
- Always validate affiliate codes before applying commissions
- Check the affiliate status is
active - Cache affiliate data to reduce API calls
Invitation Management
- Use batch invitations for efficiency (up to 25 emails)
- Handle skipped emails gracefully
- Implement retry logic for failed invitations
Webhook Integration
- Set up webhooks to receive
affiliate.joinedevents - Use webhooks to trigger onboarding workflows
- Store affiliate data when they join for faster lookups
Commission Tracking
- Track affiliate referrals accurately
- Provide affiliates with real-time statistics
- Implement proper attribution windows
Related Resources
Pulses Guide
Set up webhooks for affiliate events
Get Affiliate API
View the Get Affiliate API reference
Send Invitations API
View the Send Invitations API reference
Sales Guide
Track affiliate sales