Webhooks Reference

Looking to learn more about our Platform integration? See the Purple Dot Overview.

This reference documents available webhook subcriptions.

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.

You can configure webhook subscriptions on the Integration page of the Merchant Portal.

Webhooks

Product Availability Changed

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.

Webhook Headers

FieldUseExample
X-PD-TimestampISO formatted UTC timestamp of the event that triggered this webhook"2022-04-23T12:18:16.340Z"
X-PD-Api-KeyYour Purple Dot store's Public API Key, as shown on the Integration page of the Merchant Portal"ceb8adfd-efc1-4927-a0d9-c14e7aa1ebac"
X-PD-Hmac-Sha256HMAC-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 page of the Merchant Portal
"2bxOXTiAa3OsPw0Ck/sgOLhWwwNUP+QWlUpj5k75NkA="
Content-TypeAlways set to "application/json""application/json"

Webhook Body

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
}]
}
}