# 4.16. Đóng Deal

<table><thead><tr><th width="249">Type</th><th width="249">URL</th><th>Method</th></tr></thead><tbody><tr><td>Real</td><td><a href="https://services.entrade.com.vn/entrade-api/derivative/deals/%7Bdeal_id%7D/_close_deal">https://services.entrade.com.vn/entrade-api/derivative/deals/{deal_id}/_close_deal</a></td><td>POST</td></tr><tr><td>Demo</td><td><a href="https://services.entrade.com.vn/entrade-api/derivative/deals/%7Bdeal_id%7D/_close_deal">https://services.entrade.com.vn/papertrade-entrade-api/derivative/deals/{deal_id}/_close_deal</a></td><td>POST</td></tr></tbody></table>

#### Path parameters

| Field    | Type        | Description  |
| -------- | ----------- | ------------ |
| deal\_id | <p><br></p> | Số hiệu deal |

#### Request header

| Field         | Type        | Description                         |
| ------------- | ----------- | ----------------------------------- |
| Authorization | <p><br></p> | Bearer \<JWT Token>                 |
| Trading-Token | <p><br></p> | Token được cấp sau khi xác thực OTP |

#### Request body

| Field       | Type        | Description             |
| ----------- | ----------- | ----------------------- |
| orderType   | <p><br></p> | Truyền vào “LO”         |
| triggeredBy | <p><br></p> | Truyền vào “close-deal” |

#### Response Body

| Field             | Type        | Description   |
| ----------------- | ----------- | ------------- |
| id                | <p><br></p> | Số hiệu deal  |
| investorId        | String      | Mã khách hàng |
| investorAccountId | Int         | Mã tài khoản  |
| …                 | <p><br></p> | <p><br></p>   |


---

# 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://hdsd2.entrade.com.vn/entrade-api/tai-lieu-api-cu/4.-giao-dich-phai-sinh/4.16.-dong-deal.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.
