Skip to main content
POST
cURL
Exchange an inbound referral id for the referee incentive — a discount voucher code you can display to the referred shopper. Use this when a shopper arrives at your storefront or app with an ll_ref_id query parameter, which is how our referral links identify who referred them. The referral_id is the value of that ll_ref_id parameter. The ip_address must be the referred shopper’s own address — the one that reached your server, never your server’s — as it powers referral fraud detection. Pass referee_email whenever you know the shopper’s email. It binds the voucher to them, and it’s what allows self-referrals and referrals of existing program members to be rejected (invalid_referee). If the referrer isn’t an enrolled member, the email is required, and you’ll receive a referee_email_required error until you supply it — collect the shopper’s email and retry. It’s safe to retry: claiming again with the same referral and referee returns the same code rather than issuing a new one. To present the offer alongside the code (“Get 10% off your first order, up to $30”), use the referee_incentive object from Get Configuration, which carries localized display text and the structured discount details. When the shopper later places their first order using the voucher, the referral completes automatically — the shopper is linked to their referrer and your referral rule triggers. See the referrals guide for the end-to-end flow.

Authorizations

Authorization
string
header
required

An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header

Path Parameters

site_id
number
required

Your LoyaltyLion Site ID

Body

application/json

Body

referral_id
string
required

The referral the shopper arrived with. This is the value of the ll_ref_id query parameter on the URL the referral link redirects to

Minimum string length: 1
Example:

"jRq0X"

ip_address
required

The IP address of the shopper claiming the incentive — the one that reached your server, not your server's own. It is what detects referral fraud when the program restricts referrals to distinct IP addresses, and it is the bucket we would rate-limit an individual shopper on

Send a single address. A forwarded-for list is rejected: take the client entry from it yourself

Pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$
Example:

"203.0.113.42"

user_agent
string | null
required

The user agent of the shopper claiming the incentive, recorded alongside the referral for fraud analysis. Send null where the caller genuinely has none, such as a native mobile app

referee_email
string<email>

The email address of the shopper claiming the incentive. Pass it whenever you know it: it binds the voucher to that shopper, and it is what lets us reject a shopper who is referring themselves or who is already a member of the program

It is only required when the referrer is not enrolled in the program. A request that needs it and omits it is rejected with referee_email_required, so you can retry with the address once you have collected it

Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:

"referee@example.com"

Response

The incentive was claimed. Repeating the request with the same referral_id and referee_email returns the same code. kind discriminates this from any further success outcome added later — switch on it rather than assuming a code is present

The incentive was claimed. Repeating the request with the same referral_id and referee_email returns the same code. kind discriminates this from any further success outcome added later — switch on it rather than assuming a code is present

kind
string
required
Allowed value: "incentive"
incentive
object
required