Skip to main content
POST
cURL
Give a shopper who hasn’t joined your program a set of referral links to share. Use this to offer referrals to a visitor before they enrol, for example from a “refer a friend” form that only asks for their name and email. The response carries referral_urls, the same set of channel links an enrolled customer has. The shopper is not enrolled by this request: they get a customer record so their referrals have somewhere to be attributed, and if they later enrol with the same email, their referrals carry over. The request is only available when guest referrals are turned on in your referral settings, and your program has an active referral rule. Otherwise it is rejected with guest_referrals_not_enabled. The ip_address must be the shopper’s own address, the one that reached your server, never your server’s. Each shopper is rate limited on it, so sending your own address gives every shopper you have one shared allowance. A 429 means that shopper, or your site as a whole, has registered too many guests in a short window: wait and retry. It’s safe to retry: registering an address that already holds links returns the same links rather than a second set. If the address belongs to an enrolled member, they keep their membership and the response says nothing about it. When a guest’s friend claims the incentive, the claim needs the friend’s email address, because there is no membership to attribute the referral to. See referee_email_required on Claim Referee Incentive.

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

email
string<email>
required

The email address of the shopper taking a referral link. It is what their referrals are attributed to, and what a later enrollment is matched against

Repeating the request with an address that already holds links returns the same ones rather than a second set

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

"referrer@example.com"

first_name
string
required

The shopper's first name, recorded on the customer created for them. Applied only on creation: an address that already belongs to a customer keeps the name it has

Minimum string length: 1
Example:

"Ada"

ip_address
required

The IP address of the shopper taking the link — the one that reached your server, not your server's own. It is the bucket an individual shopper is rate limited on, so sending your own address throttles every shopper you have to a single shared allowance

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"

Response

The shopper holds referral links. The response is the same whether the address was new or already belonged to a customer, and says nothing about which — a shopper who is already a member keeps the membership they have, and is not enrolled or re-enrolled by this

The shopper holds referral links. The response is the same whether the address was new or already belonged to a customer, and says nothing about which — a shopper who is already a member keeps the membership they have, and is not enrolled or re-enrolled by this

referral_urls
object
required

The links this shopper shares, one per channel — the same set an enrolled customer's referral_urls carries