Skip to main content
Webhooks let you receive HTTP POST notifications when events occur in your Shelfforce account. Instead of polling for analysis results, register a webhook URL and Shelfforce will notify you as soon as results are ready.

Available events

Registering a webhook

Create a webhook by sending a POST request with an admin-role API key:
Response:
The webhook secret is returned only once at creation. Store it securely — you will need it to verify webhook signatures.

Webhook delivery format

Every webhook delivery is an HTTP POST to your registered URL. Here is the full shape of what hits your endpoint.

HTTP headers

JSON body structure

Every webhook body follows the same top-level structure:

Payload examples by event type

Fired when a shelf analysis finishes successfully.
The externalId and metadata fields are included when they were provided at submission time. Use the id to fetch the full analysis with products:

Webhook receiver examples

Copy-paste these handlers to get a working webhook receiver. They verify the signature and handle each event type.
Your webhook endpoint should return a 200 response as quickly as possible. Perform heavy processing (fetching full analysis results, updating your database, etc.) asynchronously after acknowledging receipt.

Signature verification

Every webhook request includes an X-Shelfforce-Signature header that you should verify to ensure the request is authentic and has not been tampered with. The header format is:
Where:
  • t — Unix timestamp of when the webhook was sent
  • v1 — HMAC-SHA256 signature

How to verify

  1. Extract the t (timestamp) and v1 (signature) values from the header.
  2. Construct the signed payload: {timestamp}.{raw_json_body}
  3. Compute HMAC-SHA256 of that payload using your webhook secret.
  4. Compare your computed signature with the v1 value using a constant-time comparison.
  5. Optionally, reject requests where the timestamp is more than 5 minutes old to prevent replay attacks.

Standalone verification functions

If you already have a web server and just need the verification logic:

Retry behavior

If your webhook endpoint returns a non-2xx status code or is unreachable, Shelfforce retries the delivery up to 3 times with exponential backoff: After all retries are exhausted, the webhook delivery is marked as failed. You can view failed deliveries in the Developers page in the dashboard.

Managing webhooks

List webhooks

Delete a webhook

Testing

Use a tool like webhook.site to get a temporary URL for testing:
  1. Go to webhook.site and copy the unique URL.
  2. Register it as a webhook endpoint with events: ["*"].
  3. Submit a test analysis via the API.
  4. Watch the event appear on webhook.site with the full payload and headers.
Remember to delete test webhooks when you are done testing to avoid unnecessary deliveries.