curl --request PUT \
--url https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>' \
--header 'trading-token: <trading-token>' \
--data '
{
"price": 1851,
"quantity": 3
}
'import requests
url = "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
payload = {
"price": 1851,
"quantity": 3
}
headers = {
"X-Api-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>",
"trading-token": "<trading-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>',
'trading-token': '<trading-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({price: 1851, quantity: 3})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 1851,
'quantity' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>",
"trading-token: <trading-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
payload := strings.NewReader("{\n \"price\": 1851,\n \"quantity\": 3\n}")
req, _ := http.NewRequest("PUT", url, payload)
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>")
req.Header.Add("trading-token", "<trading-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("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>")
.header("trading-token", "<trading-token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 1851,\n \"quantity\": 3\n}")
.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::Put.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
request["trading-token"] = '<trading-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 1851,\n \"quantity\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": 1626,
"accountNo": "0001179019",
"side": "NS",
"loanPackageId": 2278,
"symbol": "41I1G4000",
"orderType": "LO",
"orderCategory": "NORMAL",
"price": 1851,
"quantity": 3,
"fillQuantity": 0,
"canceledQuantity": 0,
"marketType": "DERIVATIVE",
"transDate": "2026-03-16",
"createdDate": "2026-03-24T04:09:50.761146893Z",
"modifiedDate": "2026-03-24T04:14:21.004856492Z"
}{
"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"
}Sửa lệnh
curl --request PUT \
--url https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>' \
--header 'trading-token: <trading-token>' \
--data '
{
"price": 1851,
"quantity": 3
}
'import requests
url = "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
payload = {
"price": 1851,
"quantity": 3
}
headers = {
"X-Api-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>",
"trading-token": "<trading-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Api-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>',
'trading-token': '<trading-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({price: 1851, quantity: 3})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 1851,
'quantity' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>",
"trading-token: <trading-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.dnse.com.vn/accounts/{accountNo}/orders/{orderId}"
payload := strings.NewReader("{\n \"price\": 1851,\n \"quantity\": 3\n}")
req, _ := http.NewRequest("PUT", url, payload)
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>")
req.Header.Add("trading-token", "<trading-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("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>")
.header("trading-token", "<trading-token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 1851,\n \"quantity\": 3\n}")
.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::Put.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
request["trading-token"] = '<trading-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 1851,\n \"quantity\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": 1626,
"accountNo": "0001179019",
"side": "NS",
"loanPackageId": 2278,
"symbol": "41I1G4000",
"orderType": "LO",
"orderCategory": "NORMAL",
"price": 1851,
"quantity": 3,
"fillQuantity": 0,
"canceledQuantity": 0,
"marketType": "DERIVATIVE",
"transDate": "2026-03-16",
"createdDate": "2026-03-24T04:09:50.761146893Z",
"modifiedDate": "2026-03-24T04:14:21.004856492Z"
}{
"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"
Trading token dùng cho các operation đặt, sửa, hủy lệnh hoặc đóng vị thế.
Ví dụ: 9ab81e9c-8a81-45aa-8190-b69a1c179d52
Tham số truy vấn
Loại thị trường
-
STOCK: Gói vay giao dịch cơ sở
-
DERIVATIVE: Gói vay giao dịch 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"
Nội dung
Giá mới cho lệnh LO
- Đối với lệnh cơ sở, có thể sửa cả giá và khối lượng
- Đối với lệnh phái sinh, chỉ được sửa hoặc giá hoặc khối lượng
1851
Khối lượng mới
- Đối với lệnh phái sinh, khối lượng mới phải lớn hơn khối lượng đã khớp (nếu có) của lệnh đã đặt
3
Phản hồi
OK
Id lệnh giao dịch
1626
Số tiểu khoản
"0001179019"
Chiều đặt lệnh
- NB: Mua
- NS: Bán
NB, NS "NS"
Mã gói vay
2278
Mã chứng khoán
"41I1G4000"
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"
Phân loại lệnh thường (mặc định NORMAL)
NORMAL, STOP, OCO, CONDITIONAL "NORMAL"
Giá đặt
1851
Khối lượng đặt
3
Khối lượng khớp
0
Khối lượng đã hủy
0
Loại thị trường
- STOCK: Lệnh cơ sở
- DERIVATIVE: Lệnh phái sinh
STOCK, DERIVATIVE, BOND "DERIVATIVE"
Ngày giao dịch
"2026-03-16"
Thời điểm tạo
"2026-03-24T04:09:50.761146893Z"
Thời điểm cập nhật
"2026-03-24T04:14:21.004856492Z"