This article shows sample use cases and flows you can implement. Use it as a starting point when you plan your implementation.
When a Wix user installs the Referral Program app, a referral program is created with status: "DRAFT" by default.
To edit and activate the referral program:
Call Get Referral Program to retrieve the existing referral program and review its current configuration.
Call Update Referral Program to configure your program settings such as rewards for referred friends and referring customers, and to set successful referral actions.
When you're ready to make the referral program live, call Update Referral Program again and set status: "ACTIVE".
When you have a customer who wants to participate in referrals, call Generate Referring Customer For Contact to create a referring customer record and generate the referral code.
Share the generated referral code with the referring customer so they can distribute it to friends.
When someone uses a referral code (for example, during a purchase, booking, event registration, or other qualifying action), validate the referral code and create the connection between the referring customer and the referred friend to ensure you can track referrals and distribute rewards correctly.
To process friend signups:
When a friend provides a referral code, call Query Referring Customers and filter by the referral code, to validate that it's a real referral code and which customer is associated with it. The response includes the referringCustomerId that you'll need in step 3:
If the code is valid, get the contact ID of the friend who used the referral code (this could be from a contact you create, an existing contact, or a contact associated with a purchase, booking, or other action). Then call Query Referred Friend to check if this contact is already a referred friend:
If the contact is already a referred friend, stop here. If the contact isn't already a referred friend, call Create Referred Friend to link the contact as a referred friend to the referring customer. Use the referringCustomerId from step 1.
To monitor your referral program and understand which customers are your best referrers and how well your program is performing, run these queries regularly. This information can guide decisions about program adjustments or customer outreach.
Call Query Referring Customers to get all customers participating in referrals:
Call Query Referred Friend to get all referred friends, sorted by referringCustomerId. Then count how many referrals each customer has made:
Call Query Referral Rewards to analyze reward distribution over a specific time period:
Calculate key performance metrics such as total referrals, conversion rates, and average rewards per customer.