cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rewards": [
{
"id": 123,
"title": "<string>",
"title_template": "<string>",
"description": "<string>",
"sort_key": 123,
"content": {},
"point_cost": 123,
"method": "voucher",
"discount_type": "flat",
"discount_amount": 123,
"minimum_spend": 123,
"usage_limit": 123,
"min_redemption_amount": 1,
"max_redemption_amount": 1,
"max_free_shipping": null,
"site_id": 123,
"target_site": {
"id": 123,
"name": "<string>",
"url": "<string>"
},
"order_type": "subscription",
"target_type": "all",
"target_collections": [
{
"id": 123,
"url": "<string>",
"restriction_text": "<string>"
}
],
"target_products": [
{
"inventory_count": 123,
"sort_key": 123,
"id": 123,
"variant_id": 123,
"sku": "<string>",
"url": "<string>",
"image_url": "<string>",
"title": "<string>",
"handle": "<string>"
}
],
"session_options": null,
"auto_refund_seconds": null,
"expiry_options": {
"kind": "does_not_expire",
"seconds": null
},
"redeemable_expiry_options": null,
"supported_channels": [
"web"
],
"available_countries": [
"<string>"
],
"kind": "active_subscription_discount_voucher",
"recurring_cycle_limit": 123
}
]
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": "<string>"
}Customers
List Available Rewards
GET
/
v2
/
customers
/
{merchant_id}
/
available_rewards
cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/customers/{merchant_id}/available_rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rewards": [
{
"id": 123,
"title": "<string>",
"title_template": "<string>",
"description": "<string>",
"sort_key": 123,
"content": {},
"point_cost": 123,
"method": "voucher",
"discount_type": "flat",
"discount_amount": 123,
"minimum_spend": 123,
"usage_limit": 123,
"min_redemption_amount": 1,
"max_redemption_amount": 1,
"max_free_shipping": null,
"site_id": 123,
"target_site": {
"id": 123,
"name": "<string>",
"url": "<string>"
},
"order_type": "subscription",
"target_type": "all",
"target_collections": [
{
"id": 123,
"url": "<string>",
"restriction_text": "<string>"
}
],
"target_products": [
{
"inventory_count": 123,
"sort_key": 123,
"id": 123,
"variant_id": 123,
"sku": "<string>",
"url": "<string>",
"image_url": "<string>",
"title": "<string>",
"handle": "<string>"
}
],
"session_options": null,
"auto_refund_seconds": null,
"expiry_options": {
"kind": "does_not_expire",
"seconds": null
},
"redeemable_expiry_options": null,
"supported_channels": [
"web"
],
"available_countries": [
"<string>"
],
"kind": "active_subscription_discount_voucher",
"recurring_cycle_limit": 123
}
]
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": "<string>"
}Returns a list of the rewards currently available to this customer.
Rewards are available to a customer for the purposes of this API if:
- The reward is enabled
- If a customer is in a loyalty tier, the reward is available on that tier
- The reward is supported based on your platform (see table below)
Supported rewards by platform
| Platform | Supported rewards |
|---|---|
| Shopify | one-off discount rewards, custom rewards, checkout rewards, free product vouchers, seamless free products |
| Adobe Commerce (Magento) | one-off discount rewards, custom rewards, free product vouchers |
| BigCommerce | one-off discount rewards, custom rewards, free product vouchers |
| Custom | custom rewards |
Authorizations
ProgramApiKeySiteTokenSecret
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
The ID of the customer in your platform or ecommerce store
Query Parameters
By default this endpoint will return rewards across all sites in your program. If you have a multi-site program, you can specify a site ID here to return only rewards for that site
An ISO 3166-1 alpha-2 country code. When provided, only rewards available in this country are returned. Rewards with no country restriction are always included.
Response
200
rewards
(Active Subscription Discount Voucher · object | Product (cart) · object | Cart Discount Voucher · object | Checkout Redemption Reward · object | Collection Voucher · object | Custom Reward · object | Free Shipping Voucher · object | Gift Card · object | Product (voucher) · object | Product (subscription) · object)[]
required
- Active Subscription Discount Voucher
- Product (cart)
- Cart Discount Voucher
- Checkout Redemption Reward
- Collection Voucher
- Custom Reward
- Free Shipping Voucher
- Gift Card
- Product (voucher)
- Product (subscription)
Show child attributes
Show child attributes