Conversion
Learn how the Conversions work
Description
Conversions are the core of the referral system, representing successful actions taken by referred users that trigger rewards for partners. A conversion occurs when a referred user performs a specific action (like making a purchase or subscribing) that meets the criteria defined in your reward rules.
Conversion Types
Currently, the system supports two main types of conversions:
Purchase Conversion
Purchase conversions track when a referred user makes a purchase. The payload includes:
product_id
(required): Unique identifier for the purchased productamount
(required): The purchase amount (numeric)currency
: The currency of the purchasecategory
: Product categoryquantity
: Number of items purchased (defaults to 1)user_agent
: Browser/client informationsource
: Where the purchase originatedmeta
: Additional metadata about the purchase
Subscription Conversion
Subscription conversions track when a referred user subscribes to a service. The payload includes:
plan
: The subscription plan nameamount
(required): The subscription amount (numeric, minimum 0)currency
: The currency of the subscriptionsubscription_id
: Unique identifier for the subscriptionuser_agent
: Browser/client informationsource
: Where the subscription originatedmeta
: Additional metadata about the subscription
Conversion Status
Conversions can have one of the following statuses:
- Pending: Initial state when a conversion is created
- Accepted: Conversion has been approved and rewards will be processed
- Rejected: Conversion has been rejected and no rewards will be given
- Suspicious: Flagged by the fraud detection system for review
How Conversions Work
- When a conversion occurs, the system creates a new conversion record with the relevant data
- The conversion is processed asynchronously through the
ProcessReferralConversion
job - The system checks for applicable reward rules based on:
- The conversion type
- The amount
- Any specific conditions defined in the rules
- If rules match, rewards are calculated and transactions are created
- The conversion status is updated accordingly
Tracking Conversions
You can track conversions using the API endpoint /v1/convert
or through the SDK:
For more details about the API endpoints and payload structure, check the API Reference.
Fraud Detection
The system automatically collects metadata for fraud detection, including:
- IP addresses
- User agent information
- Request headers
- Geographic data
- Device information
This data is used to identify potentially suspicious conversions and protect your referral program from abuse.
Reward Calculation
Rewards for conversions can be calculated in two ways:
- Fixed Amount: A specific reward amount is given for each conversion
- Percentage: A percentage of the conversion amount is given as reward
The system automatically handles the calculation based on your reward rule settings, including any maximum caps you've defined.