# API Check Transaction

## <mark style="color:green;">`POST`</mark>

```
https://<vietqr-host>/<basepath>/api/ecommerce-transactions/check-order
```

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table data-full-width="false"><thead><tr><th width="187">Name</th><th width="92">Type</th><th width="98">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>bankAccount</code></td><td>String</td><td>Yes</td><td>Số tài khoản ngân hàng.</td></tr><tr><td><code>type</code></td><td>String</td><td>Yes</td><td>Check by <code>orderId</code>: 0<br>Check by <code>referenceNumber</code>: 1</td></tr><tr><td><code>value</code></td><td>String</td><td>Yes</td><td>Giá trị là<code>orderId</code> nếu <code>type</code> = 0<br>Giá trị là<code>referenceNumber</code> nếu <code>type</code> = 1</td></tr><tr><td><code>checkSum</code></td><td>String</td><td>Yes</td><td><p>Chuỗi mã hóa MD5 của tổ hợp:</p><p>(<code>bankAccount</code> + <code>username</code>)</p></td></tr></tbody></table>

**Response**

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

```json
[
    {
        "referenceNumber": "mã_giao_dịch",
        "orderId": "mã_đơn_hàng",
        "amount": số_tiền_giao_dịch,
        "content": "nội_dung_thanh_toán",
        "transType": "giao_dịch_đến_hoặc_đi",
        "status": phân_loại_trạng_thái_giao_dịch_theo_số,
        "type": phân_loại_giao_dịch_theo_số,
        "timeCreated": tem_thời_gian_tạo_mã_QR,
        "timePaid": tem_thời_gian_thanh_toán,
        "terminalCode": "mã_điểm_bán",
        "note": "ghi_chú_giao_dịch",
        "refundCount": số_lần_đã_hoàn_tiền_thuộc_giao_dịch_này,
        "amountRefunded": số_tiền_đã_hoàn_tiền_thuộc_giao_dịch_này
    }
]
```

{% hint style="info" %}
Giá trị trả về của `type`:

* 0: Giao dịch từ hệ thống VietQR.
* 2: Giao dịch ngoài hệ thống VietQR.
* 6: Giao dịch hoàn tiền.
  {% endhint %}

{% hint style="info" %}
Giá trị trả về của `status`:

* 0: Giao dịch chờ thanh toán.
* 1: Giao dịch đã thanh toán.
* 2: Giao dịch hết hạn thanh toán.
  {% endhint %}
  {% endtab %}

{% tab title="400" %}

```json
{
    "status": "FAILED",
    "message": "mã_lỗi_và_mô_tả_lỗi"
}
```

{% 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/korea/vietqr-xin-chao/api-nang-cao/host-to-client/api-check-transaction.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.
