curl --request GET \
--url https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123");
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"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Webhook subscription 'whsub_abc123' not found"
}
]
}
Managing Subscriptions
Retrieve a webhook subscription
Retrieve a single webhook subscription by its ID.
GET
/
v1
/
webhook-subscriptions
/
{id}
curl --request GET \
--url https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123");
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"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Webhook subscription 'whsub_abc123' not found"
}
]
}
Retrieve a single webhook subscription by its ID. The signing secret is never included in this response.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The webhook subscription ID |
Errors
| Status | Scenario |
|---|---|
401 | Missing or invalid API key |
404 | No subscription with this ID exists for the shop |
429 | Rate limit exceeded (6 requests/second) |
curl --request GET \
--url https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123 \
--header 'Authorization: <api-key>'
const response = await fetch(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
{
method: "GET",
headers: {
Authorization: "<api-key>",
},
}
);
const data = await response.json();
import requests
response = requests.get(
"https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123",
headers={"Authorization": "<api-key>"},
)
data = response.json()
<?php
$ch = curl_init("https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123");
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"
}
}
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Webhook subscription 'whsub_abc123' not found"
}
]
}
⌘I