GuidesAPI ReferenceChangelog
Guides

Best Practices

The following guide describes some best practices for working with webhooks.

Respond promptly

After receiving a webhook, respond to the request with a 200 OK as quickly as possible. Responding with a 200 OK as soon as possible and let the Deel know about it. The payload is stored in a message queue for later processing and responding promptly, reducing the chance of the request getting timed out, and Deel Webhook delivery counting it as a failure.

Ignore duplicates

Don’t duplicate the webhook subscriptions. Webhook endpoints may occasionally receive the same event more than once. You are advised to guard against duplicated event receipts by making your event processing idempotent. You can do this by logging the events you’ve processed and not processing the already-logged events.

Stick to your needs

Only subscribe to the event you are using. For example, if you only need to know if the contract has been created, subscribe to that event only. You should make judicious use of the services.

Implement reconciliation jobs

You shouldn’t rely solely on receiving data from Deel webhooks, as delivery isn’t always guaranteed. We recommend that you also implement reconciliation jobs to fetch data from Deel periodically.

For example, if you are looking forward to the contract status updates, you should also implement a reconciliation job - pull data from Deel API periodically to ensure that you are getting all the updates.


What’s Next