Chi tiết vị thế theo ID
curl --request GET \
--url https://openapi-uat.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-uat.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-uat.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-uat.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-uat.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-uat.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-uat.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{
"id": 9589,
"symbol": "BVS",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 5757,
"side": "NB",
"accumulateQuantity": 3400,
"tradeQuantity": 3400,
"closedQuantity": 0,
"openQuantity": 3400,
"costPrice": 28000,
"averageCostPrice": 28000,
"averageClosePrice": 0,
"marketPrice": 25200,
"breakEvenPrice": 28043.4752,
"createdDate": "2026-07-20T04:22:38.904283Z",
"modifiedDate": "2026-07-30T11:20:44.65933Z"
}account
Chi tiết vị thế theo ID
Lấy thông tin chi tiết của một vị thế cơ sở hoặc phái sinh đang mở theo positionId.
GET
/
positions
/
{positionId}
Chi tiết vị thế theo ID
curl --request GET \
--url https://openapi-uat.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-uat.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-uat.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-uat.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-uat.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-uat.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-uat.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{
"id": 9589,
"symbol": "BVS",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 5757,
"side": "NB",
"accumulateQuantity": 3400,
"tradeQuantity": 3400,
"closedQuantity": 0,
"openQuantity": 3400,
"costPrice": 28000,
"averageCostPrice": 28000,
"averageClosePrice": 0,
"marketPrice": 25200,
"breakEvenPrice": 28043.4752,
"createdDate": "2026-07-20T04:22:38.904283Z",
"modifiedDate": "2026-07-30T11:20:44.65933Z"
}Tiêu đề
API Key được cấp khi đăng ký dịch vụ
Thời gian thực hiện yêu cầu
Chữ ký xác thực yêu cầu
API version (YYYY-MM-DD)
Tham số đường dẫn
Id vị thế
Tham số truy vấn
Loại thị trường
- STOCK: Vị thế cơ sở
- DERIVATIVE: Vị thế phái sinh
Phản hồi
OK
ID vị thế
Ví dụ:
9589
Mã chứng khoán
Ví dụ:
"BVS"
Số tiểu khoản
Ví dụ:
"0001179019"
Trạng thái của vị thế
- OPEN: Đang mở
- PENDING_CLOSE: Chờ đóng
- CLOSED: Đã đóng
- ODD_LOT: Lô lẻ (cơ sở)
Ví dụ:
"OPEN"
Gói vay cơ sở hoặc phái sinh
Ví dụ:
5757
Loại vị thế
- NB: Mua
- NS: Bán
Ví dụ:
"NB"
Khối lượng cộng dồn
Ví dụ:
3400
Khối lượng được giao dịch
Ví dụ:
3400
Khối lượng đã đóng
Ví dụ:
0
Khối lượng mở
Ví dụ:
3400
Giá vốn trung bình của khối lượng mở
Ví dụ:
28000
Giá vốn trung bình
Ví dụ:
28000
Giá đóng trung bình
Ví dụ:
0
Giá thị trường
Ví dụ:
25200
Giá hòa vốn
Ví dụ:
28043.4752
Thời điểm mở
Ví dụ:
"2026-07-20T04:22:38.904283Z"
Thời điểm cập nhật
Ví dụ:
"2026-07-30T11:20:44.65933Z"