Get a profile's loyalty page link
- Path
/loyalty-link- Auth
- Secret key · server only
const url = 'https://releva.ai/api/v0/loyalty-link?email=maria%40example.com&phoneNumber=%2B15555550199';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Email of an existing profile. Case-insensitive.
Example
maria@example.comPhone 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
+15555550199Responses
Section titled “Responses”The link was created.
object
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.
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.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "Authorization header is missing."}{ "message": "Authorization header is malformed. It should look like `Bearer <string>`."}{ "message": "Authorization header contains an invalid Bearer token."}{ "message": "Domain with the provided secret key cannot be found."}{ "message": "At least one of email or phoneNumber is required."}{ "message": "Please provide either an email or phoneNumber, not both."}{ "message": "The 'email' field must be a valid e-mail."}{ "message": "The 'email' field must not be empty."}{ "message": "phoneNumber must be a valid telephone number starting with + and international code, e.g. +1. Got 0888000101 instead."}{ "message": "The object '' contains forbidden keys: 'id'."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}No profile has this email or phone number.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Profile not found for this email or phone number."}