# Setting up Webhooks

**To integrate a webhook (callback) for payments and withdrawals you need to follow these steps:**

1. Navigate to the **Merchant** section.
2. In "API settings" enter the URL in the "Webhook URL" field for a callback on the payment status or in a separate field for withdrawals. Required https (TLS/SSL)
3. In the "Webhook password" field enter the password, if you have one.
4. Click on "Save" to save your webhook settings.

Merchant can setup Webhook link in **Merchant menu**, and instantly start receiving data about incoming payments and withdrawals in JSON such as: amount, status, timestamp, etc.\
\
Every time new crypto payment gets deposited or funds have been withdrawn Merchant will receive webhook with transaction details:

* status
* currency
* amount
* USD amount
* blockchain transaction's hash
* address
* Merchants Client ID
* Merchants ID
* Signature
* ...and so on

{% hint style="warning" %}

#### Attention

Merchant should validate webhook's signature and values of known parameters in order to avoid fraudulent activity.
{% endhint %}

{% hint style="info" %}
After successful validation of webhook, Merchant should respond with **HTTP Code: 200 OK.** No additional parameters are required in the response body.&#x20;

Our server expects a response to the webhook within a **3-second** timeout period. If the response is not received within these 3 seconds, the system considers the delivery failed.

In case if Merchant will not validate callback System repeats it 31 times with an interval of 15 seconds. If Webhook still fails to be delivered, System sends notification to the Merchant's email indicating a problem with Webhook URL.
{% endhint %}

## Webhook's test

The following integration method is used to test webhooks for payments.

{% content-ref url="../0xprocessing-api/deposits/payment-form-with-fixed-amount" %}
[payment-form-with-fixed-amount](https://docs.0xprocessing.com/0xprocessing-api/deposits/payment-form-with-fixed-amount)
{% endcontent-ref %}

To emulate test payments, the parameter Test=true must be transferred.

Link to the payment form for the test payment opens with buttons to emulate Successful Payment, Canceled Payment and Insufficient Payment. Test payment link must be opened in the same browser as the logged in merchant account.

<figure><img src="https://3581776959-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe844yi2U8Swnqhi7iE8%2Fuploads%2FoWzMbsA9xXpbHHcS3Ltx%2Fimage.png?alt=media&#x26;token=4abb4211-32b7-469e-be0d-da475ec53e96" alt=""><figcaption></figcaption></figure>

In the case of successful validation of the callback, your system will respond with **HTTP Code: 200 OK.** No additional parameters are required in the response body.

To resend a non-test callback, you can use the menu **Transactions**

In the field of the transaction you need to press the button "Show webhooks"<br>

<figure><img src="https://3581776959-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe844yi2U8Swnqhi7iE8%2Fuploads%2FBqN2iwuVPbvLYhJv5vcd%2Fimage.png?alt=media&#x26;token=c41c5932-8cb0-44aa-95ac-ac1a5b2ebc56" alt=""><figcaption></figcaption></figure>

And then "Resend"<br>

<figure><img src="https://3581776959-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe844yi2U8Swnqhi7iE8%2Fuploads%2FrYnpq89wsH9ERq9zfrfg%2Fimage.png?alt=media&#x26;token=5d9b52b6-c1b0-49a5-a1ee-84d65df07dae" alt="" width="304"><figcaption></figcaption></figure>

Learn more about integrating callbacks in API documentation: [0xprocessing-api](https://docs.0xprocessing.com/0xprocessing-api "mention")
