Two referral programs in one system: Tenant Referrals (your customers referring friends) and Platform Referrals (existing PewPros/CoachPros customers referring new platform subscribers).
- Go to Admin > Site Settings > Payments tab
- Scroll to Referral Program section
- Enter the Tenant Referral Credit Amount in cents (e.g.
1000= $10.00) - Click Save Settings
- Setting this to
0or leaving it empty disables the tenant referral program
- Same Payments tab, same Referral Program section
- Enter the Platform Referral Credit Amount in cents (e.g.
5000= $50.00) - Click Save Settings
- This controls credits given when someone refers a new PewPros/CoachPros subscriber
Platform referrers are people (existing customers, affiliates, partners) who can share a referral link for PewPros/CoachPros subscriptions.
- Go to Admin > Referrals
- Click the Platform Referrals tab
- Under Platform Referrers, enter a Name and Email
- Click Add Referrer
- A unique referral code is auto-generated
- Share the referral link with that person:
https://yoursite.com/pricing?ref=THEIR_CODE
Who: A registered user on your tenant site (e.g. detroitarms.com) refers a friend.
-
User gets their referral link
- User logs in and goes to their Dashboard (
/dashboard) - Scrolls to the "Refer a Friend" card at the bottom
- Clicks "Get My Referral Link" (generates a unique 8-character code)
- Copies the link (e.g.
https://detroitarms.com?ref=ab3kx7mn)
- User logs in and goes to their Dashboard (
-
Friend clicks the link
- Friend visits
https://detroitarms.com?ref=ab3kx7mn - The
refcode is captured in their browser session - They can browse the site normally
- Friend visits
-
Friend registers
- Friend creates an account (web registration or mobile app)
- On registration, the system:
- Looks up the referrer by code
- Sets
referred_by_user_idon the new user - Creates a pending referral record
- Clears the referral code from the session
-
Friend makes their first purchase
- Friend buys an event ticket, course, membership, or shop item
- After Stripe checkout completes, the system enqueues a referral credit job
- The job:
- Checks if the referral program is enabled (credit amount > 0)
- Finds the pending referral for this user
- Gets/creates a Stripe customer for the referrer
- Applies a negative balance transaction (credit) to the referrer's Stripe account
- Marks the referral as "credited"
- Creates an in-app notification for the referrer
-
Referrer sees the credit
- Referrer gets a notification: "You earned a $10.00 credit from your referral"
- The credit appears on their Stripe customer balance
- Next time they make a purchase, Stripe automatically applies the balance
- One credit per referred user (even if they make multiple purchases)
- Self-referral is blocked (can't use your own code)
- If Stripe is not configured on the tenant, tracking still works but credit issuance fails gracefully (status = "failed")
- Referral codes are generated lazily (only when the user clicks "Get My Referral Link")
Who: An existing PewPros customer or partner refers someone to buy a PewPros/CoachPros subscription.
-
Admin creates a platform referrer (see Setup step 3 above)
- Referrer gets a code like
q9wm4t2k - Their referral link:
https://pewpros.com/pricing?ref=q9wm4t2k
- Referrer gets a code like
-
Prospect clicks the referral link
- Prospect visits
https://pewpros.com/pricing?ref=q9wm4t2k - The
refcode is captured in their session - They see the normal pricing page (Annual $1,250/yr or Monthly $125/mo)
- Prospect visits
-
Prospect selects a plan and checks out
- Clicks "Get Started" on Annual or Monthly
- Redirected to
/pricing/checkout?plan=annual - The referral code is passed as metadata in the Stripe Checkout session
- The code is cleared from the browser session
- Prospect completes payment on Stripe's hosted checkout page
-
Purchase completes (webhook)
- Stripe sends
checkout.session.completedwebhook - System creates a
PlatformPurchaserecord - System looks up the referral code from the Stripe metadata
- Finds the matching platform referrer
- Creates a pending platform referral record
- Enqueues a platform referral credit job
- Stripe sends
-
Credit is applied
- The job:
- Gets/creates a Stripe customer for the referrer (by email)
- Applies a negative balance transaction (credit) to the referrer
- Marks the platform referral as "credited"
- The job:
-
Referrer benefits
- Credit shows on their Stripe customer balance
- Applied automatically to their next invoice/purchase
- One credit per platform purchase (unique constraint)
- Platform referrers must be created by an admin (they're not self-service)
- The referral code travels through Stripe metadata, so it survives the redirect to Stripe's checkout page and back
- Works for both PewPros and CoachPros brands
Who: A user registers through the mobile app with a referral code.
- Referrer shares their link or code with a friend
- Friend opens the mobile app and registers
- The app sends
referral_codeas a parameter in the registration API call:POST /api/v1/auth/register { "email": "friend@example.com", "password": "securepassword", "first_name": "Jane", "last_name": "Doe", "date_of_birth": "1990-01-15", "referral_code": "ab3kx7mn" } - The API links the referral (same as web flow)
- Credit is earned on their first purchase
- Go to Admin > Referrals (
/admin/referrals) - Tenant Referrals tab shows:
- Stats cards: Total, Pending, Credited, Total Credits ($)
- Filterable table with: Referrer, Referred user, Status, Credit amount, Purchase type, Date
- Platform Referrals tab shows:
- Stats cards for platform referrals
- Platform referrers list with their codes
- Add new platform referrers form
- Platform referrals table with: Referrer, Customer email, Plan, Status, Credit, Date
| Status | Meaning |
|---|---|
| Pending | Referred user registered but hasn't made a purchase yet |
| Credited | Credit was successfully applied to the referrer's Stripe balance |
| Failed | Credit could not be applied (e.g. Stripe error, no Stripe configured) |
- Credits are applied as negative customer balance transactions
- Stripe automatically applies customer balance to future invoices/payments
- The credit description shows as "Referral credit" or "Platform referral credit"
- Credits are in USD by default
- Referrers must have a Stripe customer record (auto-created if needed)
| Type | Format | Example |
|---|---|---|
| Tenant (any page) | https://yoursite.com?ref=CODE |
https://detroitarms.com?ref=ab3kx7mn |
| Tenant (specific page) | https://yoursite.com/events?ref=CODE |
Works on any page |
| Platform (pricing) | https://pewpros.com/pricing?ref=CODE |
https://pewpros.com/pricing?ref=q9wm4t2k |
| Platform (landing) | https://pewpros.com?ref=CODE |
Also works from the landing page |
The ?ref= parameter is captured on any page that uses the agency, landing, or pricing pipeline. The code persists in the session until registration (tenant) or checkout (platform).
Q: What happens if a referred user never makes a purchase? A: The referral stays in "pending" status indefinitely. No credit is issued.
Q: Can a user be referred more than once?
A: No. The referred_id has a unique constraint. Only the first referral link used at registration counts.
Q: What if the referral credit amount is changed after a referral is pending? A: The credit amount is read at the time of purchase processing, not at registration. So the current setting applies.
Q: Can I disable the referral program? A: Yes. Set the credit amount to 0 in Site Settings. The referral card will hide from the dashboard, and pending referrals won't earn credits.
Q: Does the referral code expire? A: No. Codes are permanent once generated. The session-stored code persists until the user registers or the session expires (browser close).
Q: What if Stripe isn't configured? A: Referral tracking still works (pending records are created), but credit issuance will fail gracefully and the referral status will be set to "failed".