curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/birthday \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/birthday \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/birthday");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": "1990-05-15T00:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
Customers
Get birthday
Get a customer’s date of birth.
GET
/
v1
/
customers
/
{identifier}
/
birthday
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/6789012345/birthday \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/birthday \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/birthday");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": "1990-05-15T00:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
Get the customer’s date of birth. The
identifier can be a Shopify customer ID or email.
Response
date_of_birth will be null if the customer has not provided their date of birth.
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/birthday \
--header 'Authorization: <api-key>'
curl --request GET \
--url https://api.mageloyalty.com/v1/customers/jane@example.com/birthday \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
{
method: "GET",
headers: { Authorization: "<api-key>" },
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/customers/6789012345/birthday",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/birthday");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": "1990-05-15T00:00:00.000Z"
}
}
}
{
"data": {
"type": "customer_birthday",
"id": "6789012345",
"attributes": {
"shopify_customer_id": "6789012345",
"email": "jane@example.com",
"date_of_birth": null
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Customer '6789012345' not found"
}
]
}
⌘I