> For the complete documentation index, see [llms.txt](https://docws.ems.com.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docws.ems.com.vn/tieng-viet/buu-gui/tinh-phi.md).

# Tính phí

<mark style="color:green;">`POST`</mark> `http://ws.ems.com.vn/api/v1/get-order-fee`

{% hint style="info" %}
API tính cước phí.
{% endhint %}

#### Header:

| Key          | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

####

#### Parameters:

<table><thead><tr><th> Tên trường</th><th> Kiểu dữ liệu</th><th> Chú thích</th><th data-type="checkbox">Bắt buộc</th></tr></thead><tbody><tr><td>from_province</td><td>String</td><td>Mã tỉnh gửi</td><td>true</td></tr><tr><td>from_district</td><td>String</td><td>Mã quận/huyện gửi</td><td>true</td></tr><tr><td>to_province</td><td>String</td><td>Mã tỉnh nhận</td><td>true</td></tr><tr><td>to_district</td><td>String</td><td>Mã quận/huyện nhận</td><td>true</td></tr><tr><td>service</td><td>Number</td><td>Mã dịch vụ</td><td>true</td></tr><tr><td>total_weight</td><td>Number</td><td>Khối lượng (gram)</td><td>true</td></tr><tr><td>money_collect</td><td>Number</td><td>Tổng tiền thu ở người nhận (vnđ)</td><td>true</td></tr><tr><td>total_quantity</td><td>Number</td><td>Số lượng sản phẩm</td><td>true</td></tr></tbody></table>

####

#### Responses:

```
Thành công:
{
    "code": "success",
    "message": "Thành công",
    "data": {
        "fee": {
            "fee": 16088, // Cước chính
            "remote_fee": 0 // Cước vùng xa
        },
        "vas": {
            "total_vas": 13000, // Tổng cước dịch vụ cộng thêm
            "vas_detail": [
                {
                    "code": "cod", // Dịch vụ cộng thêm
                    "fee": 13000 // Cước
                }
            ]
        },
        "money_collect": "100000" // Tổng tiền thu ở người nhận
    }
}
--------
Tổng cước = fee.fee + fee.remote_fee + vas.total_vas
          = 16088 + 0 + 13000
          = 29088
--------


Thất bại:
{
    "code": "error",
    "message": "xxxxxxxxxx"
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docws.ems.com.vn/tieng-viet/buu-gui/tinh-phi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
