Skip to main content
GET
/
v2
/
customers
cURL
curl --request GET \
  --url https://api.loyaltylion.com/v2/customers \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.loyaltylion.com/v2/customers"

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', 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",
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"

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")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.loyaltylion.com/v2/customers")

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
{
  "customers": [
    {
      "id": 123,
      "merchant_id": "<string>",
      "email": "<string>",
      "points_approved": 123,
      "points_pending": 123,
      "points_spent": 123,
      "properties": {},
      "metadata": {
        "shopify_source_url": "<string>"
      },
      "rewards_claimed": 1,
      "blocked": true,
      "guest": true,
      "enrolled": true,
      "enrolled_at": "<string>",
      "referral_id": "<string>",
      "referred_by": {
        "id": 123,
        "merchant_id": "<string>"
      },
      "loyalty_tier_membership": {
        "started_at": "<string>",
        "expires_at": "<string>",
        "manual": true,
        "loyalty_tier": {
          "id": 123,
          "name": "<string>",
          "number": 2,
          "default": true,
          "hidden": true,
          "lower_bound": "<string>",
          "upper_bound": "<string>",
          "position": 1
        }
      },
      "birthday": "<string>",
      "referral_url": "<string>",
      "receipt_upload_url": "<string>",
      "loyalty_pass_url": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "linked_merchant_ids": [
        "<string>"
      ]
    }
  ],
  "cursor": {
    "prev": "<string>",
    "next": "<string>"
  }
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}

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

Query Parameters

since_id
integer

Return only resources whose id is after the specified id

Required range: x >= 0
limit
integer
default:100

Max number of resources to return per request

Required range: 1 <= x <= 500
page
integer
deprecated

Fetch another page of results. This field is deprecated and will be removed in a future version of the API. Use cursors for pagination instead

Required range: x >= 1
sort_field
enum<string>
Available options:
id,
updated_at
sort_direction
enum<string>
Available options:
asc,
desc
cursor
string

Fetch another page of results using a cursor returned in a previous response

email
string

Return only customers whose email contains the specified string

created_at_min
string

Return only customers created on or after the specified ISO 8601 datetime string

created_at_max
string

Return only customers created before the specified ISO 8601 datetime string

updated_at_min
string

Return only customers updated on or after the specified ISO 8601 datetime string

updated_at_max
string

Return only customers updated before the specified ISO 8601 datetime string

Response

200

customers
object[]
required
cursor
object
required

Cursors that can be used to fetch the previous or next page of results. If a cursor is null, it means there are no more results in that direction