curl --request GET \
--url https://api.mageloyalty.com/v1/vip-tiers/tier_gold \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/vip-tiers/tier_gold");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "vip_tier",
"id": "tier_gold",
"attributes": {
"name": "Gold",
"description": "Premium tier",
"threshold": 500,
"threshold_points": null,
"threshold_spend": null,
"threshold_orders": null,
"points_multiplier": 1.5,
"position": 2,
"badge_image_url": null,
"badge_color": "#FFD700",
"rewards": [
{
"id": "reward_abc",
"name": "£5 off your next order",
"description": null,
"discount_type": "fixed",
"reward_type": "vip",
"points_cost": 500,
"discount_amount": 5.00,
"minimum_spend": 20.00,
"is_active": true,
"max_redemptions": null,
"expiry_days": 30,
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
],
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "VIP tier 'tier_gold' not found"
}
]
}
VIP Tiers
Retrieve a VIP tier
Fetch a single VIP tier by ID.
GET
/
v1
/
vip-tiers
/
{id}
curl --request GET \
--url https://api.mageloyalty.com/v1/vip-tiers/tier_gold \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/vip-tiers/tier_gold");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "vip_tier",
"id": "tier_gold",
"attributes": {
"name": "Gold",
"description": "Premium tier",
"threshold": 500,
"threshold_points": null,
"threshold_spend": null,
"threshold_orders": null,
"points_multiplier": 1.5,
"position": 2,
"badge_image_url": null,
"badge_color": "#FFD700",
"rewards": [
{
"id": "reward_abc",
"name": "£5 off your next order",
"description": null,
"discount_type": "fixed",
"reward_type": "vip",
"points_cost": 500,
"discount_amount": 5.00,
"minimum_spend": 20.00,
"is_active": true,
"max_redemptions": null,
"expiry_days": 30,
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
],
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "VIP tier 'tier_gold' not found"
}
]
}
Fetch a single VIP tier by its ID.
Response
Returns the VIP tier object including itsthreshold, its position (1-indexed by threshold ascending), and any tier-exclusive rewards.
curl --request GET \
--url https://api.mageloyalty.com/v1/vip-tiers/tier_gold \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/vip-tiers/tier_gold",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/vip-tiers/tier_gold");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": {
"type": "vip_tier",
"id": "tier_gold",
"attributes": {
"name": "Gold",
"description": "Premium tier",
"threshold": 500,
"threshold_points": null,
"threshold_spend": null,
"threshold_orders": null,
"points_multiplier": 1.5,
"position": 2,
"badge_image_url": null,
"badge_color": "#FFD700",
"rewards": [
{
"id": "reward_abc",
"name": "£5 off your next order",
"description": null,
"discount_type": "fixed",
"reward_type": "vip",
"points_cost": 500,
"discount_amount": 5.00,
"minimum_spend": 20.00,
"is_active": true,
"max_redemptions": null,
"expiry_days": 30,
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
],
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "VIP tier 'tier_gold' not found"
}
]
}
Errors
| Status | Scenario |
|---|---|
404 | VIP tier not found |
⌘I