curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/anniversary \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/anniversary \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/anniversary");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": "2023-03-10T09:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
Customers
Get anniversary
Get a customer’s loyalty anniversary date.
GET
/
v1
/
customers
/
{identifier}
/
anniversary
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/anniversary \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/anniversary \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/anniversary");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": "2023-03-10T09:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
Get the date the customer created their Shopify account, used as their loyalty anniversary. The
identifier can be a Shopify customer ID or email.
Response
anniversary_date will be null if the Shopify account creation date has not been synced.
Errors
| Status | Scenario |
|---|---|
404 | Customer not found |
429 | Rate limit exceeded (6 requests/second) |
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/anniversary \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/anniversary \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/anniversary",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/anniversary");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": "2023-03-10T09:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_anniversary",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"anniversary_date": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
⌘I