Webhooks
If you are using our Shopify App, this section is irrelevant and you should follow Installing our Shopify App instead. See Purple Dot Overview for the comparison of our Shopify App vs. Platform integrations.
This reference documents available webhook subscriptions.
Webhooks allow you to stay in sync with Purple Dot store data or perform an action after a specific event occurs in a store.
Webhooks are a performant alternative to continuously polling for changes to a store's data.
This webhook is triggered whenever
- a new waitlist is created, or
- stock levels on any existing waitlist are updated, or
- shoppers make, change or cancel pre orders for a product on a live waitlist, or
- a waitlist is paused
Expected latency is a few seconds from when the relevant event occurs in the store. Each webhook delivery is attempted up to 3 times.
Field | Use | Example |
---|---|---|
X-PD-Timestamp | ISO formatted UTC timestamp of the event that triggered this webhook | "2022-04-23T12:18:16.340Z" |
X-PD-Api-Key | Your Purple Dot store's Public API Key, as shown at the bottom of the Integration settings page in the Merchant Portal | "ceb8adfd-efc1-4927-a0d9-c14e7aa1ebac" |
X-PD-Hmac-Sha256 | HMAC-based encoded signature to allow optional webhook request source verification.
The signature is created using the webhook body and your Purple Dot store's Shared Secret, as shown on the Integration settings page of the Merchant Portal | "2bxOXTiAa3OsPw0Ck/sgOLhWwwNUP+QWlUpj5k75NkA=" |
Content-Type | Always set to "application/json" | "application/json" |
When
- a new waitlist is created, or
- stock levels on any existing waitlist are updated, or
- shoppers make, change or cancel pre orders for a product on a live waitlist
{
"data": {
"id": "1000",
"product_code": "Your Awesome Product",
"available": true,
"available_stock": 77,
"variants": [{
"id": "1001",
"sku": “SKU-1”,
"available": true,
"available_stock": 19
}, {
"id": "1001",
"sku": “SKU-2”,
"available": true,
"available_stock": 58
}]
}
}
When
- a waitlist is paused
{
"data": {
"id": "1000",
"product_code": "Your Awesome Product",
"available": false,
"available_stock": 0,
“timestamp”: 1648473355610,
"variants": [{
"id": "1001",
"sku": “SKU-1”,
"available": false,
"available_stock": 0
}, {
"id": "1002",
"sku": “SKU-2”,
"available": false,
"available_stock": 0
}]
}
}
Last modified 2mo ago