# MQTT Tạo 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/request/{terminalCode}
```

**Message**

<table><thead><tr><th width="209">Param</th><th width="134">Type</th><th>Description</th></tr></thead><tbody><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>bankAccount</code></td><td>String</td><td>Số tài khoản nhận tiền.</td></tr><tr><td><code>bankCode</code></td><td>String</td><td>Mã ngân hàng.</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>transType</code></td><td>String</td><td>Loại giao dịch.</td></tr><tr><td><code>orderId</code></td><td>String</td><td>Mã đơn hàng.</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" %}

```
{
  "amount": 15000,
  "content": "PaymentForOrder",
  "bankAccount": "1234567890",
  "bankCode": "MB",
  "userBankName": "ABC Corporation",
  "transType": "C",
  "orderId": "ORD12345XYZ",
  "terminalCode": "987",
  "serviceCode": "SVC001",
  "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/en/vn/other-api-service/api-host-to-device-mqtts/mqtt-tao-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.
