Skip to content

Area: Developers

GET

Get a profile's loyalty page link

Path
/loyalty-link
Auth
Secret key · server only
GET
/loyalty-link
curl --request GET \
--url 'https://releva.ai/api/v0/loyalty-link?email=maria%40example.com&phoneNumber=%2B15555550199' \
--header 'Authorization: Bearer <token>'

Returns the personal link to the hosted loyalty page of the profile with this email or phone number. The page shows the profile’s points and the rewards they can buy. Show the link only to the logged-in shopper: anyone with it can see the balance and spend the points. Call it from your server only: it uses your secret key.

Send exactly one of email or phoneNumber. Every call returns a new link; earlier links keep working. Releva’s emails, SMS, Viber and WhatsApp messages insert the same link with the {{loyaltyLink}} merge tag, so you need this endpoint only for your own pages.

email
string format: email
>= 1 characters

Email of an existing profile. Case-insensitive.

Example

maria@example.com
phoneNumber
string
>= 2 characters <= 32 characters /^\+\d+$/

Phone number of an existing profile in E.164 format (+ followed by digits, 2-32 characters). URL-encode the + as %2B. National numbers are not converted on this endpoint.

Example

+15555550199

The link was created.

Media typeapplication/json
object
link
required

Personal loyalty page link with query parameters token (domain access token), i, p (encrypted profile id) and l (shop locale). Treat it as opaque. It does not expire.

string format: uri

Example

{
"link": "https://<loyalty-page-host>/loyalty?token=00000000-0000-4000-8000-000000000000&i=0f1e2d3c4b5a69788796a5b4c3d2e1f0&p=rlv1.EXAMPLE&l=en"
}

Authentication or validation error. Unknown query parameters are rejected.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"message": "Authorization header is missing."
}

The domain is disabled.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Domain is disabled. Please reach out to support@releva.ai to enable it."
}

No profile has this email or phone number.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Profile not found for this email or phone number."
}