Webhooks
Webhooks allow your system to receive real-time notifications when an event occurs in your Fynd account. Instead of polling the Orders API to check if a document is ready, Fynd can push a notification to your server as soon as the fulfillment is complete.
Configuration
You can manage your webhook settings from the Settings page.
- Select an API Client: Webhooks are configured per API Client.
- Endpoint URL: Provide a public HTTPS URL on your server where you want to receive POST requests (e.g.,
https://api.yourdomain.com/webhooks/fynd). - Enable Webhooks: Click Enable Webhooks to save the URL, turn delivery on, and generate a fresh webhook secret.
- Webhook Secret: Once webhooks are enabled, you can rotate the secret separately at any time. This secret is used to verify that requests are actually coming from Fynd.
If you disable webhooks later, Fynd keeps the saved endpoint URL and secret so you can re-enable the integration without re-entering them.
Security Note: Like API Keys, webhook secrets are shown only once upon generation. Store them securely in your environment variables or secret manager.
Supported Events
Fynd supports the following events:
order.fulfillment.completed
Sent when an order created via the API has been successfully fulfilled and the document is ready for download.
Payload Example:
Code
Use downloadPath as a relative path against the Fynd API base URL to retrieve the fulfilled document.
order.fulfillment.failed
Sent when an order item fails to fulfil.
Payload Example:
Code
Request Headers
Each webhook delivery includes the following HTTP headers:
| Header | Description |
|---|---|
X-Fynd-Signature | HMAC-SHA256 hex digest of the raw request body, signed with your Webhook Secret |
X-Fynd-Event | Event type, e.g. order.fulfillment.completed |
X-Fynd-Delivery-Id | UUID of the webhook delivery (same as eventId in the payload) |
X-Fynd-Timestamp | ISO 8601 timestamp of when the event occurred (same as occurredAt in the payload) |
Security & Signature Verification
Fynd signs every webhook payload to ensure authenticity. The signature is sent in the X-Fynd-Signature HTTP header.
Verifying the Signature
The signature is a HMAC-SHA256 hash of the raw request body using your Webhook Secret as the key.
To verify the signature in Node.js:
Code
Important: Always compare buffer lengths before calling
timingSafeEqual. If the lengths differ,timingSafeEqualwill throw rather than returnfalse.
Reliability & Retries
- HTTP Responses: Your endpoint should return a
2xxstatus code quickly to acknowledge receipt. - Timeouts: Fynd considers a request failed if your server does not respond within 10 seconds.
- Retries: If your server is down or returns an error, Fynd will automatically retry the delivery — up to 6 attempts in total.
- Monitoring: You can view recent delivery attempts and failure reasons in the Activity tab of the Settings screen.
Best Practices
- Idempotency: Webhooks may occasionally be delivered more than once. Ensure your implementation handles duplicate
eventIdvalues gracefully. - Secure Endpoint: Always use HTTPS for your webhook URL.
- Immediate Acknowledgment: Perform heavy processing (like downloading the document) asynchronously after returning a
200 OKto Fynd.
