curl --request GET \
--url https://openapi.dnse.com.vn/positions/{positionId} \
--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/positions/{positionId}"
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/positions/{positionId}', 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/positions/{positionId}",
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/positions/{positionId}"
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/positions/{positionId}")
.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/positions/{positionId}")
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{
"data": {
"id": 177410795472387,
"symbol": "41I1G4000",
"marketType": "DERIVATIVE",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 6,
"tradeQuantity": 1,
"closedQuantity": 5,
"openQuantity": 1,
"overNightQuantity": 0,
"costPrice": 1834.5,
"averageCostPrice": 1834.5,
"averageClosePrice": 1750.96,
"marketPrice": 1706.1,
"breakEvenPrice": 1834.95691,
"createdDate": "2026-03-23T03:08:32.773651Z",
"modifiedDate": "2026-03-23T04:07:45.692156Z"
}
}{
"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 vị thế theo ID
curl --request GET \
--url https://openapi.dnse.com.vn/positions/{positionId} \
--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/positions/{positionId}"
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/positions/{positionId}', 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/positions/{positionId}",
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/positions/{positionId}"
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/positions/{positionId}")
.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/positions/{positionId}")
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{
"data": {
"id": 177410795472387,
"symbol": "41I1G4000",
"marketType": "DERIVATIVE",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 6,
"tradeQuantity": 1,
"closedQuantity": 5,
"openQuantity": 1,
"overNightQuantity": 0,
"costPrice": 1834.5,
"averageCostPrice": 1834.5,
"averageClosePrice": 1750.96,
"marketPrice": 1706.1,
"breakEvenPrice": 1834.95691,
"createdDate": "2026-03-23T03:08:32.773651Z",
"modifiedDate": "2026-03-23T04:07:45.692156Z"
}
}{
"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ố đường dẫn
Id vị thế
Tham số truy vấn
Loại thị trường
-
STOCK: Danh sách Deal cơ sở
-
DERIVATIVE: Danh sách Deal phái sinh
-
BOND: Danh sách Deal trái phiếu 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 hồi
OK
Show child attributes
Show child attributes
{ "id": 177410795472387, "symbol": "41I1G4000", "marketType": "DERIVATIVE", "accountNo": "0001179019", "status": "OPEN", "loanPackageId": 2278, "side": "NB", "accumulateQuantity": 6, "tradeQuantity": 1, "closedQuantity": 5, "openQuantity": 1, "overNightQuantity": 0, "costPrice": 1834.5, "averageCostPrice": 1834.5, "averageClosePrice": 1750.96, "marketPrice": 1706.1, "breakEvenPrice": 1834.95691, "createdDate": "2026-03-23T03:08:32.773651Z", "modifiedDate": "2026-03-23T04:07:45.692156Z" }
ID vị thế
9589
Mã chứng khoán
"BVS"
Số tiểu khoản
"0001179019"
Trạng thái của vị thế
- OPEN: Đang mở
- PENDING_CLOSE: Chờ đóng
- CLOSED: Đã đóng
- ODD_LOT: Lô lẻ (cơ sở)
OPEN, PENDING_CLOSE, CLOSED, ODD_LOT "OPEN"
Gói vay cơ sở hoặc phái sinh
5757
Loại vị thế
- NB: Mua
- NS: Bán
NB, NS "NB"
Khối lượng cộng dồn
3400
Khối lượng được giao dịch
3400
Khối lượng đã đóng
0
Khối lượng mở
3400
Giá vốn trung bình của khối lượng mở
28000
Giá vốn trung bình
28000
Giá đóng trung bình
0
Giá thị trường
25200
Giá hòa vốn
28043.4752
Thời điểm mở
"2026-07-20T04:22:38.904283Z"
Thời điểm cập nhật
"2026-07-30T11:20:44.65933Z"