cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/orders"
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/orders', 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/orders",
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/orders"
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/orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/orders")
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{
"orders": [
{
"id": 123,
"merchant_id": "<string>",
"merchant_number": "<string>",
"total": "<string>",
"total_tax": "<string>",
"total_shipping": "<string>",
"total_discounts": "<string>",
"total_paid": "<string>",
"total_refunded": "<string>",
"payment_status": "not_paid",
"fulfillment_status": "fulfilled",
"refund_status": "not_refunded",
"cancellation_status": "cancelled",
"metadata": {
"shopify_source_url": "<string>",
"shopify_source_name": "<string>",
"shopify_location_id": 123
},
"created_at": "<string>",
"updated_at": "<string>",
"customer": {
"id": 123,
"merchant_id": "<string>",
"email": "<string>",
"points_pending": 123,
"points_approved": 123,
"points_spent": 123
}
}
],
"cursor": {
"prev": "<string>",
"next": "<string>"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Orders
List Orders
GET
/
v2
/
orders
cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/orders"
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/orders', 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/orders",
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/orders"
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/orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/orders")
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{
"orders": [
{
"id": 123,
"merchant_id": "<string>",
"merchant_number": "<string>",
"total": "<string>",
"total_tax": "<string>",
"total_shipping": "<string>",
"total_discounts": "<string>",
"total_paid": "<string>",
"total_refunded": "<string>",
"payment_status": "not_paid",
"fulfillment_status": "fulfilled",
"refund_status": "not_refunded",
"cancellation_status": "cancelled",
"metadata": {
"shopify_source_url": "<string>",
"shopify_source_name": "<string>",
"shopify_location_id": 123
},
"created_at": "<string>",
"updated_at": "<string>",
"customer": {
"id": 123,
"merchant_id": "<string>",
"email": "<string>",
"points_pending": 123,
"points_approved": 123,
"points_spent": 123
}
}
],
"cursor": {
"prev": "<string>",
"next": "<string>"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Retrieve orders for the program. LoyaltyLion will only hold orders that have
been created via the LoyaltyLion API or webhooks from an e-commerce platform.
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
Query Parameters
Return only resources whose id is after the specified id
Required range:
x >= 0Max number of resources to return per request
Required range:
1 <= x <= 500Fetch 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 >= 1Fetch another page of results using a cursor returned in a previous response