# Webhook

### Configure  the  webhook to receive the IPN

* Enable **Use APIs**
* Fill in the **URL to receive notifications for changes in credit limit**
* Fill in the **Secret Key**

<figure><img src="https://1419689564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFdTKNedABvGBtqJRHWA0%2Fuploads%2Fso23RL01l5LdwPLcEkql%2FScreen%20Shot%202023-02-14%20at%2010.11.04%20AM.png?alt=media&#x26;token=1476dd25-a8e4-4b0d-8849-11e700e3b3d9" alt=""><figcaption></figcaption></figure>

### Sequence Diagram

<figure><img src="https://1419689564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFdTKNedABvGBtqJRHWA0%2Fuploads%2FJ6imArtoGPcnNsSHRP4v%2FPicture1_9.png?alt=media&#x26;token=e4eaf4d9-3cd3-4e75-85e9-e75b128a0a0e" alt=""><figcaption></figcaption></figure>

### Response Data&#x20;

<table><thead><tr><th width="144">Parameter</th><th width="108.33333333333334">Data Type </th><th>Description</th></tr></thead><tbody><tr><td>service </td><td>String </td><td>“<em>DISBURSEMENT</em>” </td></tr><tr><td>type </td><td>String </td><td>“<em>TRANSACTION</em>” </td></tr><tr><td>data </td><td>Object </td><td>Data response, refer to  <a href="../integration/response-data-structure">DisbursementTransactionItem</a> </td></tr><tr><td>time </td><td>String </td><td>The time of the event. </td></tr><tr><td>secureHash </td><td><p>String </p><p>(Base64) </p></td><td>Use SHA256 to hash the above parameters (sort the key by Alphabet order) + Secret Key (configured on Merchant Portal, in the “Disbursement service” menu) </td></tr></tbody></table>

### Sample data

```json
{
  "service": "DISBURSEMENT",
  "type": "TRANSACTION",
  "data": {
    "requestId": "826ae17b-8c96-42aa-aca2-196b94e21772",
    "amount": 200000,
    "fee": 0,
    "requestTransId": "transid-e360530e-5176-4830-aaf2-e744627ea931",
    "transId": "CH-101020230NLUW19L",
    "status": "SUCCESS",
    "receiver": "NGUYEN VAN A",
    "bankAccountNumber": "4396828945",
    "failedReason": "Successful transaction",
    "srcAmount": 200000,
    "srcCurrency": "VND",
    "fxRate": 1,
    "code": 1
  },
  "time": "2023-10-10T07:15:12.042Z",
  "secureHash": "ELsrE1knfvTD8JxPmyChO8VayUUzry6ptZJ0I+jPsac="
}
```

With the secretKey "123", the string used to create secureHash will be:

{% code overflow="wrap" %}

```
20000043968289451Successful transaction01NGUYEN VAN A826ae17b-8c96-42aa-aca2-196b94e21772transid-e360530e-5176-4830-aaf2-e744627ea931200000VNDSUCCESSCH-101020230NLUW19LDISBURSEMENT2023-10-10T07:15:12.042ZTRANSACTION123
```

{% endcode %}
