L
LoyaltyDocs

Public Referral Forms

Letting referees sign themselves up from a web form — what the form sends, how it is authenticated, and one channel per form

A public referral form is a web page your marketing team can share — on WhatsApp, in a campaign, behind a QR code — where a referee enters their own details and the referral code they were given. Submitting the form captures the referee exactly as the front desk would, with one difference: the channel is fixed per form, so each form can have its own approval rule.

What a Form Sends

The form maps its fields onto a capture:

Form field

Becomes

Name

Referee name

Phone

Referee phone — the lead's identity

Referral code

The referrer's code; a link can pre-fill it from the URL

City and centre

The branch of the capture, and stored as lead attributes for reporting

Any other field you add — a patient ID, a preferred date

Lead attributes, named after your attribute keys

The form makes a single call — the capture — and shows its thank-you screen only when the capture succeeded. A wrong or retired code is reported to the referee on the spot, and nothing is recorded.

One Channel per Form

Every form is configured with a channel name from your tenant's list. Two forms for the same program can therefore behave differently:

Form

Channel

Program rule

Result

Consent form the referee fills in themselves

public_form

Accept immediately

The referral is accepted and the first milestone fires on submit

Ambassador form filled in on someone's behalf

public_form_referral

Needs approval

The referral waits in the review queue until a person checks it

Rejected captures still create the lead

The lead and its loyalty profile are created before the code is checked, so a submission with a bad code leaves a lead behind with no referral. Review the leads list for orphans if a campaign link is being shared with a mistyped code.

How the Form Is Authenticated

Public forms cannot carry a user's login. They authenticate with a static token issued for your tenant and identify themselves with two headers — the tenant and the agent the captured leads are assigned to. Treat the token as a secret of the form deployment; it is not a customer credential.

For developers

`POST /api/v1/public/loyalty/referral/captures` with `Authorization: Bearer <static token>`, `x-tenant-id` and `x-agent-id` headers, and the same body as the authenticated capture: `referee_phone`, `referral_code` (or `program_uuid`), `referee_name`, `capture_channel`, `branch`, optional `metadata` as `[{ key, value }]` pairs. The hosted forms are configured per slug — the channel name, the field mapping and the branding — and each new form needs its mapping added to that configuration.

Was this page helpful?

Last updated on

On this page