# Webhook

[***Configure the webhook***](https://github.com/neopayvn/neox-gitbook-documents-v2/blob/main/virtual-card/virtual-cards/integration/event-notification.md)

### **Sequence Diagram**

<figure><img src="https://github.com/neopayvn/neox-gitbook-documents-v2/blob/main/virtual-card/.gitbook/assets/Picture1%20(2).png" alt=""><figcaption></figcaption></figure>

### **Event data**

<table><thead><tr><th width="173.33333333333331">Parameter</th><th width="156">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The ID of the request.</td></tr><tr><td>type</td><td>String</td><td>“<em>ACCOUNT</em>”</td></tr><tr><td>merchantId</td><td>String</td><td>The ID of merchant.</td></tr><tr><td>virtualAccounts</td><td>Array</td><td><p>The array contains the list of created virtual accounts.</p><p>Refer to <a href="#virtualaccount">VirtualAccount</a> below</p></td></tr><tr><td>createdAt</td><td>String</td><td>The time of creating account.</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 Collection service menu)</td></tr></tbody></table>

#### VirtualAccount

<table><thead><tr><th>Parameter</th><th width="158.33333333333331">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>accountName</td><td>String</td><td>The ID of seller/business is provided by merchant.</td></tr><tr><td>receiver</td><td>String</td><td>The name of receiver.</td></tr><tr><td>bankId</td><td>String</td><td>The Swift Code of the bank.</td></tr><tr><td>bankName</td><td>String</td><td>Bank name</td></tr><tr><td>serviceInfomation</td><td>Object</td><td>Refer to <a href="#service-information">Service Information</a></td></tr><tr><td>bankAccountNumber</td><td>String</td><td>The bank account number.</td></tr><tr><td>qrText</td><td>String</td><td>QR Code</td></tr><tr><td>virtualAccountRequestId</td><td>String</td><td>The ID of seller/business is provided by merchant</td></tr><tr><td>transferNote</td><td>String</td><td>Transfer Contents</td></tr><tr><td>code</td><td>Number</td><td>Refer to <a href="https://github.com/neopayvn/neox-gitbook-documents-v2/blob/main/virtual-card/virtual-cards/integration/error-codes.md">Error Codes</a></td></tr><tr><td>status</td><td>String</td><td>Status of virtual account creation:<br>SUCCESS<br>FAILED<br>PROCESSING</td></tr></tbody></table>

#### Service Information

<table><thead><tr><th width="258">Parameter</th><th width="118">Data Type</th><th width="108">Required</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>String<br>(up to 10 latin chars)</td><td>N</td><td>Service code which is defined by the merchants. This code will be used to filter the VAs and grouped Reconciliations on Merchant Portal</td></tr><tr><td>groupId</td><td>String<br>(up to 10 latin chars)</td><td>N</td><td>Id of VA group which is defined by the merchants. This id will be used to filter the VAs on Merchant Portal</td></tr><tr><td>desc</td><td>String<br>(up to 256 latin chars)</td><td>N</td><td>Description of VA</td></tr></tbody></table>

### Sample data

```json
{
  "requestId": "63ea2832-8448-4993-8bff-9748cd3aed64",
  "merchantId": "62aa8e8311c8360019132856",
  "type": "ACCOUNT",
  "createdAt": "2023-11-15T02:27:18.241Z",
  "virtualAccounts": [
    {
      "virtualAccountRequestId": "5029e5b0-5824-4a0c-bd7a-808439cced22",
      "bankAccountNumber": "NEO0003044",
      "bankId": "MSCBVNVX",
      "bankName": "Military Commercial Joint stock Bank",
      "transferNote": "NEO1700015238057",
      "receiver": "ACC SBX 001",
      "accountName": "ACC SBX 001",
      "qrText": "00020101021238540010A000000727012400069704220110NEO00030440208QRIBFTTA53037045802VN5911ACC SBX 00162200816NEO17000152380576304FA4E",
      "serviceInformation": {
        "code": "code1",
        "desc": " test",
        "groupId": "group1"
      },
      "code": 1,
      "status": "SUCCESS"
    }
  ],
  "secureHash": "vpE2KAJ78GTrIXUkdxp8m3WOeR8rBRPAeth1/mP3sWE="
}
```

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

{% code overflow="wrap" %}

```
2023-11-15T02:27:18.241Z62aa8e8311c836001913285663ea2832-8448-4993-8bff-9748cd3aed64ACCOUNTACC SBX 001NEO0003044MSCBVNVXMilitary Commercial Joint stock Bank100020101021238540010A000000727012400069704220110NEO00030440208QRIBFTTA53037045802VN5911ACC SBX 00162200816NEO17000152380576304FA4EACC SBX 001code1 testgroup1SUCCESSNEO17000152380575029e5b0-5824-4a0c-bd7a-808439cced22123
```

{% endcode %}
