curl --request POST \
--url https://openapi-uat.dnse.com.vn/accounts/orders \
--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 '
{
"accountNo": "0001179019",
"loanPackageId": 2278,
"orderType": "LO",
"price": 1861.5,
"quantity": 3,
"side": "NS",
"symbol": "41I1G4000"
}
'import requests
url = "https://openapi-uat.dnse.com.vn/accounts/orders"
payload = {
"accountNo": "0001179019",
"loanPackageId": 2278,
"orderType": "LO",
"price": 1861.5,
"quantity": 3,
"side": "NS",
"symbol": "41I1G4000"
}
headers = {
"X-API-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Aux-Date": "<x-aux-date>",
"trading-token": "<trading-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Aux-Date': '<x-aux-date>',
'trading-token': '<trading-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountNo: '0001179019',
loanPackageId: 2278,
orderType: 'LO',
price: 1861.5,
quantity: 3,
side: 'NS',
symbol: '41I1G4000'
})
};
fetch('https://openapi-uat.dnse.com.vn/accounts/orders', 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/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountNo' => '0001179019',
'loanPackageId' => 2278,
'orderType' => 'LO',
'price' => 1861.5,
'quantity' => 3,
'side' => 'NS',
'symbol' => '41I1G4000'
]),
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-uat.dnse.com.vn/accounts/orders"
payload := strings.NewReader("{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("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.post("https://openapi-uat.dnse.com.vn/accounts/orders")
.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("Content-Type", "application/json")
.body("{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/accounts/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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["Content-Type"] = 'application/json'
request.body = "{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1626,
"symbol": "41I1G4000",
"side": "NS",
"orderType": "LO",
"orderStatus": "Pending",
"price": 1861.5,
"averagePrice": 0,
"quantity": 3,
"fillQuantity": 0,
"canceledQuantity": 0,
"leaveQuantity": 3,
"accountNo": "0001179019",
"marketType": "DERIVATIVE",
"orderCategory": "NORMAL",
"transDate": "2026-03-16",
"createdDate": "2026-03-24T04:09:50.761146893Z",
"modifiedDate": "2026-03-24T04:09:50.761151529Z"
}{
"status": 400,
"code": "STOCK_PRICE_UNDEFINED",
"message": "Cannot determine stock price"
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}Đặt lệnh
Gửi yêu cầu đặt lệnh giao dịch cơ sở hoặc phái sinh trên tài khoản.
curl --request POST \
--url https://openapi-uat.dnse.com.vn/accounts/orders \
--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 '
{
"accountNo": "0001179019",
"loanPackageId": 2278,
"orderType": "LO",
"price": 1861.5,
"quantity": 3,
"side": "NS",
"symbol": "41I1G4000"
}
'import requests
url = "https://openapi-uat.dnse.com.vn/accounts/orders"
payload = {
"accountNo": "0001179019",
"loanPackageId": 2278,
"orderType": "LO",
"price": 1861.5,
"quantity": 3,
"side": "NS",
"symbol": "41I1G4000"
}
headers = {
"X-API-Key": "<x-api-key>",
"X-Signature": "<x-signature>",
"X-Aux-Date": "<x-aux-date>",
"trading-token": "<trading-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<x-api-key>',
'X-Signature': '<x-signature>',
'X-Aux-Date': '<x-aux-date>',
'trading-token': '<trading-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountNo: '0001179019',
loanPackageId: 2278,
orderType: 'LO',
price: 1861.5,
quantity: 3,
side: 'NS',
symbol: '41I1G4000'
})
};
fetch('https://openapi-uat.dnse.com.vn/accounts/orders', 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/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountNo' => '0001179019',
'loanPackageId' => 2278,
'orderType' => 'LO',
'price' => 1861.5,
'quantity' => 3,
'side' => 'NS',
'symbol' => '41I1G4000'
]),
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-uat.dnse.com.vn/accounts/orders"
payload := strings.NewReader("{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("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.post("https://openapi-uat.dnse.com.vn/accounts/orders")
.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("Content-Type", "application/json")
.body("{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/accounts/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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["Content-Type"] = 'application/json'
request.body = "{\n \"accountNo\": \"0001179019\",\n \"loanPackageId\": 2278,\n \"orderType\": \"LO\",\n \"price\": 1861.5,\n \"quantity\": 3,\n \"side\": \"NS\",\n \"symbol\": \"41I1G4000\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1626,
"symbol": "41I1G4000",
"side": "NS",
"orderType": "LO",
"orderStatus": "Pending",
"price": 1861.5,
"averagePrice": 0,
"quantity": 3,
"fillQuantity": 0,
"canceledQuantity": 0,
"leaveQuantity": 3,
"accountNo": "0001179019",
"marketType": "DERIVATIVE",
"orderCategory": "NORMAL",
"transDate": "2026-03-16",
"createdDate": "2026-03-24T04:09:50.761146893Z",
"modifiedDate": "2026-03-24T04:09:50.761151529Z"
}{
"status": 400,
"code": "STOCK_PRICE_UNDEFINED",
"message": "Cannot determine stock price"
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}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
Phiên bản API
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 thường, lệnh điều kiện (mặc định NORMAL)
Nội dung
Số tiểu khoản
"0001179019"
Id gói vay
2278
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"
Giá đặt lệnh
35000
Khối lượng đặt lệnh
300
Loại lệnh
- NB: Mua
- NS: Bán
"NB"
Mã chứng khoán
"TCB"
Phản hồi
OK
Id lệnh giao dịch
1626
Mã chứng khoán
"41I1G4000"
Chiều đặt lệnh NB: Mua NS: Bán
"NS"
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
- PendingNew: Chờ gửi
- New: Chờ khớp
- PendingReplace: Chờ sửa
- 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: Giải tỏa trong phiên
"Pending"
Giá đặt
1861.5
Giá khớp trung bình
0
Khối lượng đặt
3
Khối lượng khớp
0
Khối lượng đã hủy
0
Khối lượng còn lại
3
Số tiểu khoản
"0001179019"
Loại thị trường
- STOCK: Lệnh cơ sở
- DERIVATIVE: Lệnh phái sinh
"DERIVATIVE"
Phân loại lệnh thường (mặc định NORMAL)
"NORMAL"
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:09:50.761151529Z"