Skip to main content
This page explains the concepts. To turn it on step by step, follow the gifts & referrals setup guide.

The Referral Lifecycle

Recurso’s referral system lets you incentivize existing customers to bring in new users. The platform handles the full lifecycle from code generation to reward payout:
  • Code generation — unique, shareable referral codes per customer
  • Referral tracking — link referrers to referred customers automatically
  • Qualification rules — mark referrals as qualified once conditions are met
  • Reward distribution — credit the referrer’s account after qualification

Referral Object

Referral Statuses

Generate a Referral Code

Each customer can have a unique referral code. Use the generate-code endpoint to create one.
Share the generated code via email, in-app banners, or your customer portal. Codes are unique per customer and reusable across multiple referrals.

Create a Referral

When a referred customer signs up using a referral code, create the referral record to link both parties.

Default Values

Two validation rules are enforced on creation:
  • Self-referral (ErrSelfReferral): A customer cannot refer themselves. referrer_id and referred_id must differ.
  • Duplicate referral (ErrAlreadyReferred): A customer can only be referred once. If referred_id already has a referral on file, the request is rejected.

Qualify a Referral

Once the referred customer meets your qualification criteria (e.g., completes their first payment, remains active for 30 days), mark the referral as qualified.
Qualification is a one-way transition. Once a referral is qualified, it cannot revert to pending. The qualified_at timestamp is set automatically by the server.

List Referrals

Retrieve all referrals with pagination support.

Pagination Parameters

Reward Distribution

After a referral moves to qualified, Recurso automatically credits the referrer. The reward is applied as account credit on the referrer’s next invoice.
The reward lifecycle:
  1. Referral is qualified via the /qualify endpoint
  2. Recurso creates an account credit for the referrer
  3. The referral status transitions to rewarded
  4. Credit is automatically applied on the referrer’s next invoice

Webhooks

Subscribe to referral events to trigger downstream actions like email notifications or analytics updates.

Example Webhook Payload

Use Cases

Double-Sided Rewards

Give both the referrer and the referred customer a discount. Create a coupon for the referred user and use the referral reward for the referrer.

Tiered Programs

Increase reward amounts based on referral count. After 5 successful referrals, bump the reward from 5to5 to 10.

Partner Programs

Use referral codes for affiliate and partner tracking with custom reward amounts per partner.

Growth Campaigns

Run time-limited referral campaigns with boosted rewards during launch periods.

Best Practices

Listen for subscription.created or payment.succeeded events and automatically call the /qualify endpoint when the referred customer completes their first payment. This removes manual intervention from the reward flow.
Keep reward amounts proportional to your customer acquisition cost. A 55-10 credit works well for most SaaS products. For high-value plans, consider percentage-based rewards instead.
Recurso blocks self-referrals and duplicate referrals at the API level. Additionally, consider rate-limiting code generation and monitoring for unusual patterns like bulk signups from the same IP.
Send email notifications at each stage — when a code is generated, when someone signs up with their code, and when the reward is credited. Use the webhook events to trigger these emails.
Use the list endpoint with pagination to build dashboards showing referral conversion rates, top referrers, and total rewards distributed. Export this data periodically for business reviews.

Next steps

Set up gifts & referrals

Enable both growth features

Coupons

The reward mechanism behind referral credits