Số dư tài khoản
curl --request GET \
--url https://api.ssi.com.vn/api/v3/trading/accountBalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ssi.com.vn/api/v3/trading/accountBalance"
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'}
};
fetch('https://api.ssi.com.vn/api/v3/trading/accountBalance', 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://api.ssi.com.vn/api/v3/trading/accountBalance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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://api.ssi.com.vn/api/v3/trading/accountBalance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ssi.com.vn/api/v3/trading/accountBalance")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ssi.com.vn/api/v3/trading/accountBalance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"equity": {
"accountNo": "Q123451",
"accountBalance": "22114",
"totalDebt": "0",
"interestLoan": "0",
"overdueFeeLoan": "0",
"withdrawable": "22114",
"onHoldCash": "0",
"sellUnmatched": "0",
"sellT0": "0",
"sellT1": "0",
"sellT2": "0",
"buyUnmatched": "0",
"buyT0": "0",
"buyT1": "0",
"buyT2": "0",
"advancedCashT0": "0",
"advancedCashT1": "0",
"holdSubscription": "0",
"dividend": "0"
},
"derivative": null
}Giao dịch
Số dư tài khoản
Lấy thông tin số dư tài khoản.
GET
/
api
/
v3
/
trading
/
accountBalance
Số dư tài khoản
curl --request GET \
--url https://api.ssi.com.vn/api/v3/trading/accountBalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ssi.com.vn/api/v3/trading/accountBalance"
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'}
};
fetch('https://api.ssi.com.vn/api/v3/trading/accountBalance', 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://api.ssi.com.vn/api/v3/trading/accountBalance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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://api.ssi.com.vn/api/v3/trading/accountBalance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ssi.com.vn/api/v3/trading/accountBalance")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ssi.com.vn/api/v3/trading/accountBalance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"equity": {
"accountNo": "Q123451",
"accountBalance": "22114",
"totalDebt": "0",
"interestLoan": "0",
"overdueFeeLoan": "0",
"withdrawable": "22114",
"onHoldCash": "0",
"sellUnmatched": "0",
"sellT0": "0",
"sellT1": "0",
"sellT2": "0",
"buyUnmatched": "0",
"buyT0": "0",
"buyT1": "0",
"buyT2": "0",
"advancedCashT0": "0",
"advancedCashT1": "0",
"holdSubscription": "0",
"dividend": "0"
},
"derivative": null
}Ủy quyền
Access token lấy từ endpoint /api/v3/auth/token hoặc /api/v3/auth/refresh.
Tiêu đề
Định dạng nội dung request body. Chủ yếu là application/json.
Thông tin client gửi request.
Ngôn ngữ phản hồi mong muốn. Nếu không có header này, hệ thống sẽ mặc định là en
Tham số truy vấn
Tài khoản 6 số định danh khách hàng tại SSI. Nếu số tài khoản là 003C123888 thì clientId = 123888
Tài khoản giao dịch cần lấy số dư. Bắt buộc truyền thông tin tiểu khoản.