Skip to content

Catalog Webhook Events

Catalog webhooks deliver real-time notifications when your product catalog changes. Each HTTP POST request to your registered endpoint contains a single event signed with HMAC-SHA256.

For setup instructions and configuration, see the Catalog Webhooks Guide.

Event Types

EventResourceDescription
product.createdproductsNew product added
product.updatedproductsProduct details changed
product.deletedproductsProduct deactivated
option.createdoptionsNew option added
option.updatedoptionsOption details changed
option.deletedoptionsOption deactivated
category.createdcategoriesNew category added
category.updatedcategoriesCategory details changed
category.deletedcategoriesCategory deactivated
group.createdgroupsNew group added
group.updatedgroupsGroup details changed
group.deletedgroupsGroup deactivated

Payload Format

json
{
  "type": "product.updated",
  "resource": "products",
  "id": "CELCOM10",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "data": {
    "product_code": "CELCOM10",
    "product_category_code": "MOBILE_PREPAID",
    "name": "Celcom Prepaid",
    "display_name": "Celcom Prepaid Reload",
    "image_url": "https://dashboard.iimmpact.com/img/CELCOM10.png",
    "processing_time": "instant",
    "is_active": true
  }
}
FieldTypeDescription
typestringEvent type (e.g. product.updated, option.created)
resourcestringResource kind: products, options, categories, groups
idstringIdentifier of the affected resource
timestampstringISO 8601 timestamp of when the change occurred
dataobject|nullFull resource data, or null for delete events

Delete Events

For *.deleted events, the data field is null. Use the id field to remove the resource from your local store.

Request Headers

Each webhook request includes these headers:

HeaderDescription
Content-Typeapplication/json
X-Webhook-SignatureHMAC-SHA256 signature: sha256=<hex>

Signature Verification

All webhook requests include an X-Webhook-Signature header. Always verify the signature before processing the event to confirm it originated from IIMMPACT and was not tampered with.

The header format is sha256=<hex_digest>, computed as HMAC-SHA256 of the raw request body using your webhook secret.

typescript
import crypto from "crypto";

function verifyWebhookSignature(
  rawBody: string,
  signature: string | null,
  secret: string,
): boolean {
  if (!signature) return false;

  const providedSig = signature.startsWith("sha256=")
    ? signature.slice(7)
    : signature;

  const expectedSig = crypto
    .createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex");

  try {
    return crypto.timingSafeEqual(
      Buffer.from(providedSig, "hex"),
      Buffer.from(expectedSig, "hex"),
    );
  } catch {
    return false;
  }
}

Use Raw Body

Verify the signature against the raw request body bytes, not a parsed-and-re-serialized JSON object. Re-serializing can change key order or whitespace, causing a mismatch.

IIMMPACT API Documentation