If you do not have a webhook endpoint configured but want to explore the use of webhooks, you can use a tool such as Request Bin to quickly and easily set up a webhook listener endpoint to provide to /sandbox/public_token/create
. When directing webhook traffic to third-party tools, make sure you are using Plaid's Sandbox environment and not sending out live data.
If you would like to implement webhooks with Plaid, you need to follow these steps:
-
Set up a dedicated endpoint on your server: This endpoint should be able to receive POST requests. This is where Plaid will send the webhook notifications.
-
Provide the endpoint URL to Plaid: This is done via the
webhook
parameter of/link/token/create
when adding an Item. The URL must be in the standard format ofhttp(s)://(www.)domain.com/
. -
Handle the incoming webhooks: When Plaid sends a webhook to your endpoint, it will be a POST request with a raw JSON payload. You need to write code to handle these incoming requests. This could be as simple as writing the webhook into a queue or reliable storage, or it could involve more complex processing depending on your needs.
-
Test your webhooks: Plaid allows you to test webhooks in the Sandbox environment. You can use the
/sandbox/item/fire_webhook
endpoint to fire a webhook on demand for testing purposes. Note that not all webhook types are available to test in our Sandbox environment. See our Sandbox Overview for more details.
Remember to design your application to handle duplicate and out-of-order webhooks. Ensure idempotency on actions you take when receiving a webhook. If you drive application state with webhooks, ensure your code doesn't rely on a specific order of webhook receipt.
Additionally, for real-life examples of handling webhooks that illustrate how to handle sample transactions and Item webhooks, see handleTransactionsWebhook.js and handleItemWebhook.js These files contain webhook handling code for the Node-based Plaid Pattern sample app. You can learn more here.
For any more information please see the webhook section of our docs.