Skip to content

Webhooks

Webhooks let you receive HTTP callbacks when events occur in your Storelayer project.

EventDescription
customer.createdNew customer registered
customer.updatedCustomer data changed
wallet.creditedPoints added to wallet
wallet.debitedPoints removed from wallet
promotion.redeemedPromotion was used
referral.completedReferral successfully applied
event.processedLoyalty event was processed
{
"id": "whk_abc123",
"event": "wallet.credited",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"customerId": "cust_abc123",
"amount": 500,
"balance": 1500,
"reason": "Purchase reward"
}
}

All webhook requests include a signature header for verification:

X-Storelayer-Signature: sha256=abc123...

Verify the signature using your webhook secret:

import { createHmac } from 'crypto'
function verifyWebhook(payload, signature, secret) {
const expected = createHmac('sha256', secret)
.update(payload)
.digest('hex')
return `sha256=${expected}` === signature
}

Failed webhook deliveries are retried with exponential backoff:

  • 1st retry: 1 minute
  • 2nd retry: 5 minutes
  • 3rd retry: 30 minutes
  • 4th retry: 2 hours
  • 5th retry: 24 hours

After 5 failed attempts, the webhook is marked as failed and can be manually retried from the dashboard.