# MQTT Nhận Mã Thanh Toán VietQR

### <mark style="color:green;">`MQTT`</mark> **Request** Generate VietQR Code <a href="#get-token" id="get-token"></a>

```
mqtt://<vietqr-port>/vietqr/response/{terminalCode}
```

**Message**

<table><thead><tr><th width="212">Param</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>bankCode</code></td><td>String</td><td>Mã ngân hàng.</td></tr><tr><td><code>bankName</code></td><td>String</td><td>Tên của ngân hàng</td></tr><tr><td><code>bankAccount</code></td><td>String</td><td>Số tài khoản nhận tiền</td></tr><tr><td><code>userBankName</code></td><td>String</td><td>Tên chủ tài khoản ngân hàng</td></tr><tr><td><code>amount</code></td><td>Long</td><td>Số tiền nhận</td></tr><tr><td><code>content</code></td><td>String</td><td>Nội dung chuyển tiền</td></tr><tr><td><code>qrCode</code></td><td>String</td><td>Mã QR</td></tr><tr><td><code>orderId</code></td><td>String</td><td>Mã đơn hàng</td></tr><tr><td><code>imgId</code></td><td>String</td><td>Hình ảnh qrCode</td></tr><tr><td><code>existing</code></td><td>String</td><td>Có tồn tại trong hệ thống VietQR</td></tr><tr><td><code>transactionId</code></td><td>String</td><td>Id của giao dịch</td></tr><tr><td><code>transactionRefId</code></td><td>String</td><td>Mã tham chiếu giao dịch</td></tr><tr><td><code>qrLink</code></td><td>String</td><td>Đường link hiện qrCode</td></tr><tr><td><code>terminalCode</code></td><td>String</td><td>Mã điểm bán hoặc mã cửa hàng</td></tr><tr><td><code>serviceCode</code></td><td>String</td><td>Mã sản phẩm</td></tr><tr><td><code>additionalData</code></td><td>List&#x3C;Object></td><td>Thông tin thêm của đối tác muốn lưu trữ kèm giao dịch</td></tr></tbody></table>

### Code mẫu

{% tabs %}
{% tab title="Message" %}

```
{
  "bankCode": "MB",
  "bankName": "MB Bank",
  "bankAccount": "1234567890",
  "userBankName": "XYZ Ltd",
  "amount": "50000",
  "content": "SampleTransactionDescription",
  "qrCode": "00020101021138540010A00000072701240006970422011012345678900208QRIBFTTA53037045405200005802VN62350831SampleTransactionDescription6304AAB8",
  "imgId": "abcd1234-5678-90ef-ghij-klmn01234567",
  "existing": 1,
  "transactionId": "",
  "transactionRefId": "ABC1234567890XYZ",
  "qrLink": "https://vietqr.vn/test/qr-generated?token=ABC1234567890XYZ",
  "terminalCode": "987",
  "serviceCode": "SVC002",
  "additionalData": [
    {
      "info": "AdditionalInfo1"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.vietqr.vn/vi/cac-dich-vu-api-khac/api-host-to-device-mqtts/mqtt-nhan-ma-thanh-toan-vietqr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
