Webhooks

Receive real-time notifications when events happen in a store.

Overview

Webhooks allow your application to receive HTTP POST notifications when events occur in a Whatalo store. Instead of polling the API, your server receives data automatically.

How Webhooks Work

1. An event occurs (e.g., new order placed)
2. Whatalo sends a POST request to your registered URL
3. Your server processes the payload and returns 2xx
4. If delivery fails, Whatalo retries with exponential backoff

Managing Webhook Endpoints

List Webhooks

GET /v1/webhooks

Required scope: read:webhooks

Create Webhook

POST /v1/webhooks
{
  "url": "https://your-server.com/webhooks/whatalo",
  "events": ["order.created", "order.updated"]
}
FieldTypeRequiredDescription
urlstringYesHTTPS endpoint URL (must be HTTPS)
eventsstring[]YesEvent types to subscribe to
secretstringNoCustom signing secret (auto-generated if omitted)

Webhook URLs must use HTTPS. HTTP endpoints are rejected.

Required scope: write:webhooks

Update Webhook

PATCH /v1/webhooks/:id

Required scope: write:webhooks

Delete Webhook

DELETE /v1/webhooks/:id

Required scope: write:webhooks


Event Types

EventTrigger
order.createdNew order placed
order.updatedOrder status or data changed
product.createdNew product created
product.updatedProduct data changed
product.deletedProduct deleted
customer.createdNew customer registered
customer.updatedCustomer data changed

Webhook Payload

All webhook payloads follow this structure:

{
  "event": "order.created",
  "timestamp": "2026-03-01T15:00:00Z",
  "data": {
    "id": "ord_abc123",
    "order_number": 1042,
    "status": "pending",
    "total": 8997
  }
}

Webhook Security

Every webhook delivery includes an X-Whatalo-Signature header containing an HMAC-SHA256 signature. Verify this to ensure the payload was sent by Whatalo.

Verification Example

Node.js
import crypto from "crypto";

function verifyWebhookSignature(payload, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(payload)
    .digest("hex");

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}
Python
import hmac
import hashlib

def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(
        secret.encode(), payload, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected)

Retry Policy

If your endpoint returns a non-2xx status code, Whatalo retries with exponential backoff:

AttemptDelay
1st retry1 minute
2nd retry5 minutes
3rd retry30 minutes
4th retry2 hours
5th retry12 hours

After 5 failed attempts, the webhook delivery is marked as failed. You can retry manually from the Developer Dashboard.

On this page