5. Notifications

Setting webhook preferences

Webhooks are notifications sent by Wirecard to your system whenever your transaction goes through an event and has its status changed. Therefore, through webhooks, it is possible to synchronize your system with Wirecard.

To receive webhooks you must first create a notification preference. It is at this point that you will register one or more URLs where the webhooks will be sent.

Attributes

Name

Description

Details

events

Transaction event types. To learn more, visit the Events section.

string list

target

Notification URL.

string

media

Notification type. Only possible value: WEBHOOK.

string

id

Unique preference identifier code. Example: NPR-DV61EEGGUFCQ

string(16)
response

token

Hash used to sign notifications. This token will be sent in all notifications sent by Wirecard for this preference.

string
response

Receiving Webhooks

To confirm receipt of a webhook, your system must return an HTTP status 2xx code. Information returned in header or body will be ignored. Any responses other than 2xx will be interpreted as a notification not received by your server. For these cases, we will do a notification send retry as shown below.

Retry

Description

1

10 seconds after initial notification.

🚧

IMPORTANT

We cannot guarantee the order of the statuses that will be received by your application. Therefore, we advise you to use the hierarchy-based approach to status handling.

Best Practices for Working with Webhooks

Using retries allows you to receive the same notification multiple times. To protect your application, we recommend that you process webhooks in an idempotent manner. One way to do this is to log the processed event and ensure that other similar events are disregarded.

To increase the security of your application and ensure that only Wirecard can send notifications to your system, you can check the token sent in the header Authorization of the webhooks. This token is the same one that is generated when registering your URL.