> For the complete documentation index, see [llms.txt](https://developer-topup.esms.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer-topup.esms.vn/reference/ham-kiem-tra-dang-nhap/ham-lay-trang-thai-giao-dich-topup-theo-requestid.md).

# Hàm lấy trạng thái giao dịch Topup theo RequestId

Hàm cho phép bạn xem trạng thái giao dịch theo RequestId nếu có truyền vào

## HTTP request

\ <mark style="color:yellow;">**`POST`**</mark> [https://api.omitopup.com/api/get-by-requestid](http://api.omitopup.com/api/get-by-requestid)

* **Content Type:** <mark style="color:orange;">application/json</mark>
* **Response Type:** <mark style="color:orange;">application/json</mark>

```json
curl --location --request POST 'https://api.omitopup.com/api/get-by-requestid' \
--header 'token: {token}' \
--header 'Content-Type: application/json' \
--data-raw '{ "request_id": ["{request_id}"] }'
```

* **Cấu trúc body của request:**

<table><thead><tr><th width="163">Thuộc tính</th><th>Mô tả</th></tr></thead><tbody><tr><td>token <mark style="color:red;">*</mark></td><td>Bạn sẽ được cung cấp khi sử dụng hàm đăng nhập.</td></tr><tr><td>request_id <mark style="color:red;">*</mark></td><td>id của khách hàng truyền vào khi topup</td></tr></tbody></table>

* **Response:**

{% code fullWidth="false" %}

```json
{
"resultCode": 100,
"payload": {
"code": 1,
"reference_id": "42bf5f70-409e-4eda-8cce-10420691221f",
"request_id": "270220230000",
"request_price": 20000,
"total_topup": 0
}
}
```

{% endcode %}

* **Cấu trúc body của response:**

<table><thead><tr><th width="187">Thuộc tính</th><th>Mô tả</th></tr></thead><tbody><tr><td>resultCode</td><td>100 Thành công.<br>101  Sai Token.<br>111  Địa chỉ IP chưa được Whitelist.<br>99  Lỗi không xác định.<br>104 Sai request_id hoặc get giao dịch quá 7 ngày</td></tr><tr><td>payload</td><td><ul><li>referenceid: ID của hệ thống eSMS trả về khi gọi hàm topup và cardcode.</li><li>request_id: Thông tin requested của khách hàng truyền vào.</li><li>code: Trạng thái giao dịch<br>    0: thành công .<br>    1: thất bại .<br>    2: pending .<br>    3: thành công 1 phần .</li></ul></td></tr></tbody></table>
