curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "reward_history_entry",
"id": "cr_abc123",
"attributes": {
"reward_id": "reward_abc",
"reward_name": "£5 off your next order",
"reward_discount_type": "fixed",
"points_spent": 500,
"discount_code": "MAGE-ABC123",
"status": "active",
"is_refunded": false,
"discount_code_redeemed_at": null,
"redeemed_at": "2024-06-01T12:00:00.000Z",
"expires_at": "2024-07-01T12:00:00.000Z",
"created_at": "2024-06-01T12:00:00.000Z",
"updated_at": "2024-06-01T12:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Reward history entry 'cr_abc123' not found"
}
]
}
Customers
Get reward history entry
Get a single reward redemption entry.
GET
/
v1
/
customers
/
{identifier}
/
reward-history
/
{id}
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "reward_history_entry",
"id": "cr_abc123",
"attributes": {
"reward_id": "reward_abc",
"reward_name": "£5 off your next order",
"reward_discount_type": "fixed",
"points_spent": 500,
"discount_code": "MAGE-ABC123",
"status": "active",
"is_refunded": false,
"discount_code_redeemed_at": null,
"redeemed_at": "2024-06-01T12:00:00.000Z",
"expires_at": "2024-07-01T12:00:00.000Z",
"created_at": "2024-06-01T12:00:00.000Z",
"updated_at": "2024-06-01T12:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Reward history entry 'cr_abc123' not found"
}
]
}
Get a single reward history entry by its ID. Validates that the entry belongs to the given customer and shop.
Response
Returns a single reward history entry object.Errors
| Status | Scenario |
|---|---|
404 | Entry or customer not found |
429 | Rate limit exceeded (6 requests/second) |
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/reward-history/cr_abc123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "reward_history_entry",
"id": "cr_abc123",
"attributes": {
"reward_id": "reward_abc",
"reward_name": "£5 off your next order",
"reward_discount_type": "fixed",
"points_spent": 500,
"discount_code": "MAGE-ABC123",
"status": "active",
"is_refunded": false,
"discount_code_redeemed_at": null,
"redeemed_at": "2024-06-01T12:00:00.000Z",
"expires_at": "2024-07-01T12:00:00.000Z",
"created_at": "2024-06-01T12:00:00.000Z",
"updated_at": "2024-06-01T12:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Reward history entry 'cr_abc123' not found"
}
]
}
⌘I