---
title: "Handle webhook events"
description: "Learn how to handle Adyen webhook events."
url: "https://docs.adyen.com/development-resources/webhooks/handle-webhook-events"
source_url: "https://docs.adyen.com/development-resources/webhooks/handle-webhook-events.md"
canonical: "https://docs.adyen.com/development-resources/webhooks/handle-webhook-events"
last_modified: "2026-06-01T15:33:16+02:00"
language: "en"
---

# Handle webhook events

Learn how to handle Adyen webhook events.

[View source](/development-resources/webhooks/handle-webhook-events.md)

Webhooks are important for keeping your system synchronized with events that happen on the Adyen side, such as payment status changes or user onboarding. Your webhook endpoint needs to handle these messages properly to prevent missed events and to ensure that your system is up-to-date with the latest information from Adyen. This involves [securing](#secure-webhooks), [accepting](#accept-webhooks), and [processing webhook](#process-webhooks) messages as you receive them. This page guides you through best practices for each of these steps.

## How it works

To begin receiving webhook messages, you need to [configure a webhook](/development-resources/webhooks/configure-and-manage/#configuring-a-webhook) in your Customer Area. Adyen then sends webhook messages to the webhook endpoint you configured. The endpoint needs to be publicly accessible without any redirects and have high availability to incoming requests.

When your endpoint receives a webhook message:

1. [Verify the webhook message](#verify-webhooks) by confirming that it was sent by Adyen, and was not modified during transmission. If the webhook message is not secure, we do not recommend accepting it.
2. Store the webhook message in your database or a queue so you can process it later.
3. [Accept the webhook message](#accept-webhooks) by responding with a [successful HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses), such as **200** or **202**.
4. [Process the data](#process-webhooks) and apply your business logic. Make sure that you acknowledge the webhook before applying any business logic, because errors in your business logic could lead to [failing webhooks](/development-resources/webhooks/troubleshoot/#retry-queue).

## Verify webhooks

You must verify that the webhook is a genuine message from Adyen and was not modified in transit. Methods like [domain and IP allowlisting](/development-resources/webhooks/secure-webhooks#domain-and-ip-addresses), or basic authentication provide a layer of security. Verifying message integrity using [HMAC signature verification](/development-resources/webhooks/secure-webhooks/verify-hmac-signatures) is another strong security measure. Always verify the HMAC signature before processing the payload and using its data. This ensures the data is authentic and allows you to discard any fraudulent or corrupt messages. If the webhook message is not secure, we do not recommend accepting it.

For more information about webhook security, see [Secure webhooks](/development-resources/webhooks/secure-webhooks).

## Accept webhooks

When you receive a webhook message from Adyen, you need to respond with a [successful HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses), such as **202**, to indicate successful delivery of the webhook message. Do not validate or process the data at this step. If Adyen does not receive this response within 10 seconds, for example because your server is down, we mark the webhook as Failing and put it in a [retry queue](/development-resources/webhooks/troubleshoot/#retry-queue).

## Process webhooks

After you accept and secure the webhook message, you can begin processing the data in the payload. This involves parsing the payload and using the data to update your systems.

### Webhook payload

A webhook consists of headers and a JSON body. The body contains the event data, including an `eventCode` or `type` describing what happened, and a timestamp that identifies when the event occurred. To ensure you are processing events in the correct chronological order, always check the timestamp. Some webhooks also contain unique identifiers such as `sequenceNumber` that you can also use to handle the data in the correct order.

### Using an Adyen library to parse the payload

One of the benefits of using the [Adyen server libraries](https://github.com/Adyen#server-side) is that you get access to tools that help you deserialize, verify, and parse data from webhook messages. This saves you from writing boilerplate code to parse the webhooks yourself, and gives you the benefit of type safety and auto-completion in your IDE.

The library also includes a validator to [verify the HMAC signature](#secure-webhooks), which is an important step in [securing your webhooks](#secure-webhooks).

Our libraries are available for several popular programming languages. To get started, find the library for your preferred language on our [Adyen GitHub page](https://github.com/Adyen#server-side) and go to **Supported webhook versions**.

### Handling duplicates

In some cases it is possible that you receive the same webhook event twice, so make sure that your system is able to deal with duplicates. These duplicate webhook events have the same values in the `eventCode` and `pspReference` fields, while the `eventDate` and other fields can be different. Your server should use the details from the latest webhook event.

## See also

* [Webhook structure and types](/development-resources/webhooks/webhook-types)
* [Verify HMAC signatures](/development-resources/webhooks/secure-webhooks/verify-hmac-signatures)
