curl --request GET \
--url https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId} \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
headers = {
"X-Api-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>'
}
};
fetch('https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("X-Signature", "<x-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
.header("X-Api-Key", "<x-api-key>")
.header("X-Aux-Date", "<x-aux-date>")
.header("X-Signature", "<x-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
response = http.request(request)
puts response.read_body{
"id": "966",
"side": "NS",
"accountNo": "0001179019",
"symbol": "41I1G4000",
"price": 1706.1,
"quantity": 5,
"orderType": "LO",
"loanPackageId": 2278,
"orderCategory": "NORMAL",
"orderStatus": "Filled",
"fillQuantity": 5,
"lastQuantity": 2,
"lastPrice": 1706.1,
"averagePrice": 1750.96,
"transDate": "2026-03-16",
"taxRate": 0,
"exchangeFeeRate": 0,
"feeRate": 0,
"leaveQuantity": 0,
"canceledQuantity": 0,
"error": "",
"marketType": "DERIVATIVE",
"priceSecure": 1706.1,
"createdDate": "2026-03-23T03:10:06.556826794Z",
"modifiedDate": "2026-03-23T04:07:45.683977124Z",
"metadata": "{\"orderSession\":\"OPEN\",\"dealId\":\"1.77410795472387E14\",\"releaseSecureOnFilled\":\"false\",\"originMaker\":\"1000005917-close_deal_177410795472387\",\"dtaAccountNo\":\"D000113702\",\"isForeigner\":false,\"probType\":\"CUSTOMER\",\"eventNo\":5}"
}{
"status": 400,
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ"
}{
"status": 500,
"code": "OA-009",
"message": "Lỗi hệ thống"
}Chi tiết lệnh theo ID
Lấy thông tin chi tiết lệnh theo orderId, bao gồm lệnh thường (NORMAL), lệnh dừng có điều kiện (STOP) và lệnh OCO.
curl --request GET \
--url https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId} \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
headers = {
"X-Api-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>'
}
};
fetch('https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("X-Signature", "<x-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
.header("X-Api-Key", "<x-api-key>")
.header("X-Aux-Date", "<x-aux-date>")
.header("X-Signature", "<x-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
response = http.request(request)
puts response.read_body{
"id": "966",
"side": "NS",
"accountNo": "0001179019",
"symbol": "41I1G4000",
"price": 1706.1,
"quantity": 5,
"orderType": "LO",
"loanPackageId": 2278,
"orderCategory": "NORMAL",
"orderStatus": "Filled",
"fillQuantity": 5,
"lastQuantity": 2,
"lastPrice": 1706.1,
"averagePrice": 1750.96,
"transDate": "2026-03-16",
"taxRate": 0,
"exchangeFeeRate": 0,
"feeRate": 0,
"leaveQuantity": 0,
"canceledQuantity": 0,
"error": "",
"marketType": "DERIVATIVE",
"priceSecure": 1706.1,
"createdDate": "2026-03-23T03:10:06.556826794Z",
"modifiedDate": "2026-03-23T04:07:45.683977124Z",
"metadata": "{\"orderSession\":\"OPEN\",\"dealId\":\"1.77410795472387E14\",\"releaseSecureOnFilled\":\"false\",\"originMaker\":\"1000005917-close_deal_177410795472387\",\"dtaAccountNo\":\"D000113702\",\"isForeigner\":false,\"probType\":\"CUSTOMER\",\"eventNo\":5}"
}{
"status": 400,
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ"
}{
"status": 500,
"code": "OA-009",
"message": "Lỗi hệ thống"
}Tiêu đề
API key được cấp khi đăng ký dịch vụ DNSE OpenAPI.
Ví dụ: b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=
Thời gian thực hiện request, dùng trong cơ chế ký request của DNSE.
Ví dụ: Sat, 01 May 2026 14:24:23 +0000
Chữ ký xác thực request được tạo từ API key secret và X-Aux-Date.
Ví dụ: Signature keyId="b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=",algorithm="hmac-sha256",headers="(request-target) x-aux-date",signature="rfbVXHDUi%2B%2FsOkLXle7O17Qm%2F05cbISSR%2BDcFrBHfqQ%3D",nonce="4add8c3264e4492b9f8ecde0cf26b523"
Tham số truy vấn
Loại thị trường
-
STOCK: Sổ lệnh cơ sở
-
DERIVATIVE: Sổ lệnh phái sinh Loại thị trường.
-
STOCK: Giao dịch cơ sở -
DERIVATIVE: Giao dịch phái sinh -
BOND: Giao dịch trái phiếu
STOCK, DERIVATIVE, BOND "STOCK"
Phân loại lệnh thường, lệnh điều kiện (mặc định NORMAL) Phân loại lệnh.
NORMAL: Lệnh thườngSTOP: Lệnh dừng có điều kiệnOCO: Lệnh OCO phái sinhCONDITIONAL: Lệnh điều kiện
NORMAL, STOP, OCO, CONDITIONAL "NORMAL"
Phản hồi
OK
ID lệnh
"966"
Chiều giao dịch
- NB: Mua
- NS: Bán
NB, NS "NS"
Số tiểu khoản
"0001179019"
Mã hợp đồng phái sinh
"41I1G4000"
Giá đặt lệnh
1706.1
Khối lượng đặt lệnh
5
Loại lệnh
- LO: Lệnh giới hạn
- MOK/MAK/MTL: Lệnh thị trường
- ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
- PLO: Lệnh khớp lệnh sau giờ
LO, MOK, MAK, MTL, ATO, ATC, PLO "LO"
Mã gói vay
2278
Phân loại lệnh (mặc định NORMAL)
NORMAL, STOP, OCO, CONDITIONAL "NORMAL"
Trạng thái lệnh
- Pending/PendingNew: Chờ gửi
- New: Chờ khớp
- PartiallyFilled: Khớp một phần
- Filled: Khớp toàn bộ
- Rejected: Bị từ chối
- Expired: Hết hạn trong phiên
- DoneForDay: Lệnh được giải tỏa do không khớp trong phiên
Pending, PendingNew, New, PendingReplace, PendingCancel, PartiallyFilled, Filled, Canceled, Rejected, Expired, DoneForDay "Filled"
Khối lượng đã khớp
5
Khối lượng khớp gần nhất
2
Giá khớp gần nhất
1706.1
Giá khớp trung bình
1750.96
Ngày giao dịch
"2026-03-16"
Tỷ lệ thuế
0
Tỷ lệ phí trả Sở giao dịch
0
Tổng tỷ lệ phí của lệnh
0
Khối lượng còn lại chưa khớp
0
Khối lượng đã hủy
0
Mã lỗi nếu lệnh bị từ chối
""
Loại thị trường
- STOCK: Sổ lệnh cơ sở
- DERIVATIVE: Sổ lệnh phái sinh
STOCK, DERIVATIVE, BOND "DERIVATIVE"
Giá dùng để kiểm tra sức mua/đặt lệnh
1706.1
Thời điểm tạo lệnh
"2026-03-23T03:10:06.556826794Z"
Thời điểm cập nhật lệnh
"2026-03-23T04:07:45.683977124Z"
Thông tin bổ sung của lệnh
"{\"orderSession\":\"OPEN\",\"dealId\":\"1.77410795472387E14\",\"releaseSecureOnFilled\":\"false\",\"originMaker\":\"1000005917-close_deal_177410795472387\",\"dtaAccountNo\":\"D000113702\",\"isForeigner\":false,\"probType\":\"CUSTOMER\",\"eventNo\":5}"