Referral record captures the lead that comes back in — and ties it to the resulting deal so you can attribute revenue to the original advocate.
A Referral is the per-referral ledger Winnerr was missing. The legacy Person.totalReferrals counter is still maintained as a cache, but Referral is now the source of truth: who referred whom, through which channel, what reward was offered, and which Deal the referral eventually produced.
Where referrals come from
| Channel | Source |
|---|---|
PUBLIC_PROFILE | The referral form on the agent’s public reputation profile. |
WIDGET | The embedded reviews widget on the agent’s site. |
MANUAL | Logged in-app by the agent. |
IMPORT | Bulk-imported from a prior system. |
Public capture endpoint
The public profile and widget post submissions to a single CORS-friendly endpoint:- Resolves the org and agent server-side from the published profile slug. Anything else returns a uniform
404. - Records the referrer as a
Person(creating one if it doesn’t exist). - Creates a
Referralrow withstatus: RECEIVEDand the resolvedagentUserId. - Emits
REFERRAL_RECEIVED, which fires the workflow that re-enters the new lead at the top of the pipeline withLeadSource.REFERRALandRelationshipStage.ADVOCATE. - Rate-limits the request and caps the body at 32 KB; all client strings are treated as data, validated with Zod.
Lifecycle
| Status | Meaning |
|---|---|
RECEIVED | Captured from the public endpoint or logged manually. Awaiting agent triage. |
CONTACTED | Agent has reached out to the referred person. |
QUALIFIED | The referred lead has been qualified. |
CONVERTED | The referral produced a real Deal (recorded on resultingDealId). |
LOST | Did not convert. |
resultingDealId so the referral is tied to actual revenue and the original advocate shows up in attribution reports.
What’s on a Referral
| Field | Purpose |
|---|---|
referrerPersonId | The advocate who sent the referral. |
referredPersonId | The new lead (linked once they become a Person). |
referredName, referredContact | Raw captured fields, used before linking to a Person. |
agentUserId | The agent the referral was sent to. |
channel | Where the referral came from (PUBLIC_PROFILE, WIDGET, MANUAL, IMPORT). |
resultingDealId | The Deal that closed from this referral. |
resultingLeadSource | Defaults to REFERRAL on the new lead. |
rewardType, rewardStatus, rewardValue | Optional reward tracking (e.g. gift_card, commission_share). |
notes | Free-form context. |
Managing referrals
List and create referrals via the authenticated API:Closing the loop
When a referral is captured publicly:Referralis created withstatus: RECEIVED.REFERRAL_RECEIVEDis emitted.- The downstream workflow creates or updates a
Personfor the referred lead withLeadSource.REFERRAL. - The new
Personenters the pipeline at the lead stage like any other inbound lead — visible in People and routed through your existing automations. - When that lead’s deal closes, set
Referral.resultingDealIdandReferral.status = CONVERTEDso revenue attributes back to the advocate.
Referral is a closing the flywheel produced.
Referral rewards
When a referral’s linked deal is won, Winnerr notifies the agent that a reward is ready to send. The agent fulfills it out of band and marks it sent from the Rewards queue, at which point the referrer is automatically thanked by email or SMS (consent-gated, per the org’s reward policy). See Referral rewards for the full guide.Related
- Overview — the full reputation flywheel.
- Public profile — the surface the referral CTA lives on.
- Referral rewards — reward queue and auto-thank policy.
- Reputation API — referrals — authenticated CRUD.
- Public referral endpoint — token-less public capture.