curl --request DELETE \
--url https://openapi-uat.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>' \
--header 'trading-token: <trading-token>' \
--header 'version: <version>'import requests
url = "https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
headers = {
"X-API-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Aux-Date": "<x-aux-date>",
"trading-token": "<trading-token>",
"version": "<version>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-API-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Aux-Date': '<x-aux-date>',
'trading-token': '<trading-token>',
version: '<version>'
}
};
fetch('https://openapi-uat.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-uat.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 => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>",
"trading-token: <trading-token>",
"version: <version>"
],
]);
$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-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("trading-token", "<trading-token>")
req.Header.Add("version", "<version>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
.header("X-API-Key", "<x-api-key>")
.header("X-Signature", "<x-signature>")
.header("X-Aux-Date", "<x-aux-date>")
.header("trading-token", "<trading-token>")
.header("version", "<version>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Signature"] = '<x-signature>'
request["X-Aux-Date"] = '<x-aux-date>'
request["trading-token"] = '<trading-token>'
request["version"] = '<version>'
response = http.request(request)
puts response.read_body{
"id": "741",
"accountNo": "0001179019",
"orderCategory": "NORMAL",
"marketType": "STOCK",
"symbol": "SHS",
"side": "NB",
"orderType": "LO",
"orderStatus": "PendingCancel",
"price": 15600,
"quantity": 800,
"loanPackageId": 1372,
"priceSecure": 15600,
"averagePrice": 0,
"fillQuantity": 0,
"canceledQuantity": 0,
"leaveQuantity": 800,
"transDate": "2026-01-30",
"createdDate": "2026-08-04T02:52:57.305213488Z",
"modifiedDate": "2026-08-04T02:53:09.831996595Z"
}Hủy lệnh
Gửi yêu cầu hủy lệnh đã đặt theo orderId.
Hỗ trợ hủy các loại lệnh:
-
Lệnh thường NORMAL có trạng thái: chờ gửi, chờ khớp hoặc đã khớp 1 phần trong thời gian quy định
-
Lệnh STOP /OCO có trạng thái: chờ kích hoạt
curl --request DELETE \
--url https://openapi-uat.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>' \
--header 'trading-token: <trading-token>' \
--header 'version: <version>'import requests
url = "https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
headers = {
"X-API-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Aux-Date": "<x-aux-date>",
"trading-token": "<trading-token>",
"version": "<version>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-API-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Aux-Date': '<x-aux-date>',
'trading-token': '<trading-token>',
version: '<version>'
}
};
fetch('https://openapi-uat.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-uat.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 => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>",
"trading-token: <trading-token>",
"version: <version>"
],
]);
$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-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("trading-token", "<trading-token>")
req.Header.Add("version", "<version>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
.header("X-API-Key", "<x-api-key>")
.header("X-Signature", "<x-signature>")
.header("X-Aux-Date", "<x-aux-date>")
.header("trading-token", "<trading-token>")
.header("version", "<version>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/accounts/{accountNo}/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Signature"] = '<x-signature>'
request["X-Aux-Date"] = '<x-aux-date>'
request["trading-token"] = '<trading-token>'
request["version"] = '<version>'
response = http.request(request)
puts response.read_body{
"id": "741",
"accountNo": "0001179019",
"orderCategory": "NORMAL",
"marketType": "STOCK",
"symbol": "SHS",
"side": "NB",
"orderType": "LO",
"orderStatus": "PendingCancel",
"price": 15600,
"quantity": 800,
"loanPackageId": 1372,
"priceSecure": 15600,
"averagePrice": 0,
"fillQuantity": 0,
"canceledQuantity": 0,
"leaveQuantity": 800,
"transDate": "2026-01-30",
"createdDate": "2026-08-04T02:52:57.305213488Z",
"modifiedDate": "2026-08-04T02:53:09.831996595Z"
}Tiêu đề
API Key được cấp khi đăng ký dịch vụ
Chữ ký xác thực yêu cầu
Thời gian thực hiện yêu cầu
Token đặt lệnh
API version (YYYY-MM-DD)
Tham số truy vấn
Loại thị trường
- STOCK: Đặt lệnh cơ sở
- DERIVATIVE: Đặt lệnh phái sinh
Phân loại lệnh
- NORMAL: lệnh thường (cơ sở, phái sinh, trái phiếu)
- STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
- OCO: lệnh OCO (phái sinh)
Phản hồi
OK
Id lệnh giao dịch
"741"
Số tiểu khoản
"0001179019"
Phân loại lệnh
- NORMAL: lệnh thường (cơ sở, phái sinh, trái phiếu)
- STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
- OCO: lệnh OCO (phái sinh)
"NORMAL"
Loại thị trường
- STOCK: Lệnh cơ sở
- DERIVATIVE: Lệnh phái sinh
- BOND: Lệnh phái sinh
"STOCK"
Mã chứng khoán
"SHS"
Chiều đặt lệnh
- NB: Mua
- NS: Bán
"NB"
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"
Trạng thái lệnh NORMAL:
-
Pending/PendingNew: Chờ gửi
-
New: Chờ khớp
-
PendingReplace: Chờ sửa
-
PendingCancel: Chờ hủy
-
PartiallyFilled: Khớp một phần
-
Filled: Khớp toàn bộ
-
Canceled: Đã hủy
-
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
Trạng thái lệnh STOP/OCO:
- New: Chờ kích hoạt
- Activated: Đã kích hoạt
- Cancelled: Đã hủy
- Expired: Hết hiệu lực
- Rejected: Bị từ chối
- Failed: Lệnh thất bại
"PendingCancel"
Giá đặt
15600
Khối lượng đặt
800
Mã gói vay
1372
Giá bảo đảm
15600
Giá khớp trung bình
0
Khối lượng khớp
0
Khối lượng đã hủy
0
Khối lượng còn lại
800
Ngày giao dịch
"2026-01-30"
Thời điểm tạo
"2026-08-04T02:52:57.305213488Z"
Thời điểm cập nhật
"2026-08-04T02:53:09.831996595Z"