Vị thế nắm giữ
curl --request GET \
--url https://openapi-uat.dnse.com.vn/accounts/{accountNo}/positions \
--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/accounts/{accountNo}/positions"
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/accounts/{accountNo}/positions', 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}/positions",
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/accounts/{accountNo}/positions"
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/accounts/{accountNo}/positions")
.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/accounts/{accountNo}/positions")
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{
"positions": [
{
"id": 177796763592657,
"marketType": "DERIVATIVE",
"symbol": "41I1G5000",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 259,
"tradeQuantity": 23,
"closedQuantity": 236,
"openQuantity": 23,
"overNightQuantity": 0,
"costPrice": 2036.78986,
"marketPrice": 1915.8,
"breakEvenPrice": 2037.28116,
"averageClosePrice": 2094.28941,
"createdDate": "2026-05-05T09:17:50.457893Z",
"modifiedDate": "2026-05-08T06:51:04.755263Z"
},
{
"id": 177701390054522,
"marketType": "DERIVATIVE",
"symbol": "41I1G6000",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 21,
"tradeQuantity": 9,
"closedQuantity": 12,
"openQuantity": 9,
"overNightQuantity": 0,
"costPrice": 2003.47813,
"marketPrice": 2178.5,
"breakEvenPrice": 2003.96376,
"averageClosePrice": 2047.875,
"createdDate": "2026-05-04T08:09:22.201886Z",
"modifiedDate": "2026-05-06T04:26:03.22851Z"
}
],
"pageIndex": 0,
"pageSize": 20,
"pageNumber": 1,
"total": 2
}{
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ",
"status": 400
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}account
Vị thế nắm giữ
Lấy danh sách các vị thế đang nắm giữ trên tài khoản, bao gồm thông tin mã chứng khoán, khối lượng, giá vốn, và các thông tin khác.
GET
/
accounts
/
{accountNo}
/
positions
Vị thế nắm giữ
curl --request GET \
--url https://openapi-uat.dnse.com.vn/accounts/{accountNo}/positions \
--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/accounts/{accountNo}/positions"
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/accounts/{accountNo}/positions', 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}/positions",
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/accounts/{accountNo}/positions"
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/accounts/{accountNo}/positions")
.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/accounts/{accountNo}/positions")
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{
"positions": [
{
"id": 177796763592657,
"marketType": "DERIVATIVE",
"symbol": "41I1G5000",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 259,
"tradeQuantity": 23,
"closedQuantity": 236,
"openQuantity": 23,
"overNightQuantity": 0,
"costPrice": 2036.78986,
"marketPrice": 1915.8,
"breakEvenPrice": 2037.28116,
"averageClosePrice": 2094.28941,
"createdDate": "2026-05-05T09:17:50.457893Z",
"modifiedDate": "2026-05-08T06:51:04.755263Z"
},
{
"id": 177701390054522,
"marketType": "DERIVATIVE",
"symbol": "41I1G6000",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 21,
"tradeQuantity": 9,
"closedQuantity": 12,
"openQuantity": 9,
"overNightQuantity": 0,
"costPrice": 2003.47813,
"marketPrice": 2178.5,
"breakEvenPrice": 2003.96376,
"averageClosePrice": 2047.875,
"createdDate": "2026-05-04T08:09:22.201886Z",
"modifiedDate": "2026-05-06T04:26:03.22851Z"
}
],
"pageIndex": 0,
"pageSize": 20,
"pageNumber": 1,
"total": 2
}{
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ",
"status": 400
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}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
Phiên bản API
Tham số đường dẫn
Số tiểu khoản
Tham số truy vấn
Loại thị trường
- STOCK: Danh sách vị thế cơ sở
- DERIVATIVE: Danh sách vị thế phái sinh
Kích thước trang dữ liệu (page size)
Phản hồi
OK
Show child attributes
Show child attributes
Ví dụ:
[
{
"id": 177796763592657,
"marketType": "DERIVATIVE",
"symbol": "41I1G5000",
"accountNo": "0001179019",
"status": "OPEN",
"loanPackageId": 2278,
"side": "NB",
"accumulateQuantity": 259,
"tradeQuantity": 23,
"closedQuantity": 236,
"openQuantity": 23,
"overNightQuantity": 0,
"costPrice": 2036.78986,
"marketPrice": 1915.8,
"breakEvenPrice": 2037.28116,
"averageClosePrice": 2094.28941,
"createdDate": "2026-05-05T09:17:50.457893Z",
"modifiedDate": "2026-05-08T06:51:04.755263Z"
}
]
Kích thước trang dữ liệu (dành cho phái sinh)
Ví dụ:
0
Số bản ghi trên 1 trang (dành cho phái sinh)
Ví dụ:
20
Số trang (chỉ dành cho phái sinh)
Ví dụ:
1
Tổng số vị thế (chỉ dành cho phái sinh)
Ví dụ:
3