curl --request GET \
--url 'https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20' \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions",
headers={"Authorization": "<api-key>"},
params={"page[number]": 1, "page[size]": 20},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": [
{
"type": "webhook_subscription",
"id": "whsub_abc123",
"attributes": {
"url": "https://example.com/webhooks/mage",
"events": ["points.earned", "customer.tier_upgrade"],
"is_active": true,
"description": "Production points + tier sync",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20,
"total_pages": 1
}
}
{
"errors": [
{
"status": "401",
"title": "Unauthorized",
"detail": "Invalid or revoked API key"
}
]
}
Managing Subscriptions
List webhook subscriptions
List all webhook subscriptions for the shop.
GET
/
v1
/
webhook-subscriptions
curl --request GET \
--url 'https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20' \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions",
headers={"Authorization": "<api-key>"},
params={"page[number]": 1, "page[size]": 20},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": [
{
"type": "webhook_subscription",
"id": "whsub_abc123",
"attributes": {
"url": "https://example.com/webhooks/mage",
"events": ["points.earned", "customer.tier_upgrade"],
"is_active": true,
"description": "Production points + tier sync",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20,
"total_pages": 1
}
}
{
"errors": [
{
"status": "401",
"title": "Unauthorized",
"detail": "Invalid or revoked API key"
}
]
}
List all webhook subscriptions for the shop, newest first. The signing secret is never included in this response.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page[number] | integer | Page number (default: 1) |
page[size] | integer | Results per page (default: 20, max: 100) |
Errors
| Status | Scenario |
|---|---|
401 | Missing or invalid API key |
429 | Rate limit exceeded (6 requests/second) |
curl --request GET \
--url 'https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20' \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions",
headers={"Authorization": "<api-key>"},
params={"page[number]": 1, "page[size]": 20},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions?page[number]=1&page[size]=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
],
]);
$data = json_decode(curl_exec($ch), true);
{
"data": [
{
"type": "webhook_subscription",
"id": "whsub_abc123",
"attributes": {
"url": "https://example.com/webhooks/mage",
"events": ["points.earned", "customer.tier_upgrade"],
"is_active": true,
"description": "Production points + tier sync",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20,
"total_pages": 1
}
}
{
"errors": [
{
"status": "401",
"title": "Unauthorized",
"detail": "Invalid or revoked API key"
}
]
}
⌘I