Available events
Registering a webhook
Create a webhook by sending aPOST request with an admin-role API key:
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
- analysis.completed
- analysis.failed
- task.created
- task.updated
- task.completed
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.Signature verification
Every webhook request includes anX-Shelfforce-Signature header that you should verify to ensure the request is authentic and has not been tampered with.
The header format is:
t— Unix timestamp of when the webhook was sentv1— HMAC-SHA256 signature
How to verify
- Extract the
t(timestamp) andv1(signature) values from the header. - Construct the signed payload:
{timestamp}.{raw_json_body} - Compute HMAC-SHA256 of that payload using your webhook secret.
- Compare your computed signature with the
v1value using a constant-time comparison. - 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:- Go to webhook.site and copy the unique URL.
- Register it as a webhook endpoint with
events: ["*"]. - Submit a test analysis via the API.
- 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.