Managing Subscriptions
Create a webhook subscription
Register a URL to receive loyalty event notifications and get a signing secret.
POST
Register an HTTPS endpoint to receive webhook deliveries for the events you select. Mage Loyalty signs every delivery with the signing secret returned here, so you can verify that requests are genuine.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The HTTPS endpoint that will receive deliveries. Must be a valid URL |
events | string[] | Yes | A non-empty array of events to subscribe to. Valid events: points.earned, points.redeemed, customer.tier_upgrade, customer.tier_downgrade |
description | string | No | Optional label to help you identify the subscription |
Response
Returns201 Created with the new subscription, including the secret.
Errors
| Status | Scenario |
|---|---|
400 | url missing, url not a valid URL, events empty or missing, one or more events invalid, or invalid JSON |
401 | Missing or invalid API key |
403 | The API key is read-only and cannot perform write operations |
429 | Rate limit exceeded (6 requests/second) |