> For the complete documentation index, see [llms.txt](https://docs.0xprocessing.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0xprocessing.com/0xprocessing-api/binance-pay/webhooks.md).

# Webhooks

Set the Webhook URL in the menu **Settings\API\Binance Pay webhooks  to receive a callback about payment status.** Required https (TLS/SSL)

**Webhook password** - password required to verify the payment signature

**Webhook URL** - the address in the system from which the payment is made. This address will be used to send updates on the status of payments:

**Request method:** POST

**Response Type:** JSON

### Deposit

Triggered when a customer successfully completes a deposit via Binance Pay and the funds are credited to the merchant account.

#### Event type

`Deposit`

#### Statuses

* `Success`
* `Canceled`

#### Payload

```json
{
  "Id": 123,
  "MerchantID": "0x...",
  "Date": "2025-06-16T14:30:00Z",
  "Amount": 150.75,
  "AmountUSD": 150.75,
  "Fee": 1.50,
  "Currency": "USDT",
  "Type": "Deposit",
  "Destination": "",
  "Status": "Success",
  "Signature": "a1b2c3d4e5f6...",
  "ExternalID": "EXT-987654",
  "ClientID": "CLIENT-001",
  "TxId": "123456789",
  "BinanceID": "987654321"
}
```

#### Description of fields

| Field       | Description                                      |
| ----------- | ------------------------------------------------ |
| id          | Internal transaction identifier                  |
| merchantID  | Merchant identifier                              |
| date        | Transaction creation date (UTC)                  |
| amount      | Deposit amount                                   |
| amountUSD   | Amount converted to USD                          |
| fee         | Processing fee                                   |
| currency    | Transaction currency                             |
| type        | Event type (`Deposit`)                           |
| destination | Wallet address or Binance ID used for withdrawal |
| status      | Transaction status                               |
| signature   | Webhook signature                                |
| externalID  | Merchant's external transaction ID               |
| clientID    | Merchant client identifier                       |
| txId        | Internal Binance Pay transaction ID              |
| binanceID   | Binance payment identifier                       |

***

### WithdrawBinanceId

Triggered when a withdrawal is successfully sent to a Binance Pay account using Binance ID.

#### Event type

`WithdrawBinanceId`

#### Statuses

* `Success`
* `Canceled`

#### Payload

```json
{
  "Id": 123,
  "MerchantID": "0x...",
  "Date": "2025-06-16T14:30:00Z",
  "Amount": 150.75,
  "AmountUSD": 150.75,
  "Fee": 1.50,
  "Currency": "USDT",
  "Type": "WithdrawBinanceId",
  "Destination": "",
  "Status": "Success",
  "Signature": "a1b2c3d4e5f6...",
  "ExternalID": "EXT-987654",
  "ClientID": "CLIENT-001",
  "TxId": "123456789",
  "BinanceID": "987654321"
}
```

#### Description

The webhook is sent after funds are successfully transferred to the recipient's Binance account using their Binance ID.

***

### WithdrawOnchain

Triggered when a withdrawal is processed and sent to a blockchain wallet address.

#### Event type

`WithdrawOnchain`

#### Statuses

* `Success`
* `Canceled`

#### Payload

```json
{
  "Id": 123,
  "MerchantID": "0x...",
  "Date": "2025-06-16T14:30:00Z",
  "Amount": 150.75,
  "AmountUSD": 150.75,
  "Fee": 1.50,
  "Currency": "USDT",
  "Type": "WithdrawOnchain",
  "Destination": "0x38f5...90F223",
  "Status": "Success",
  "Signature": "a1b2c3d4e5f6...",
  "ExternalID": "EXT-987654",
  "ClientID": "CLIENT-001",
  "TxId": "0x5fdb...85974a"
}
```

#### Description

The webhook is sent when a withdrawal transaction is broadcast to the blockchain and reaches its final status.

***

### Signature Validation

1. To verify the authenticity of a webhook, generate a signature using the following template:

```
{tx.Id}:{merchantId}:{tx.ExternalId}:{tx.Status}:{webhookPassword}
```

2. Encrypt the resulting string using MD5 algorithm

<https://emn178.github.io/online-tools/md5.html>

3. Compare the generated hash with the value received in the `signature` field. Only process the webhook if the signatures match.
