API Specs
Last updated
Last updated
Token and Authentication code
API | Method | Path |
---|---|---|
Query cash and derivatives accounts
API | Method | Path |
---|---|---|
Order placing
API | Method | Path |
---|---|---|
Cash
Stock
Online Right Subscription
To get token to access APIs.
Details
Sample
Successfull request:
Error request:
To get OTP code if you registered SMS OTP/Email OTP.
If you get OTP code for 5 times without verification, your OTP service will be temporarily blocked and then automatically unlocked after sometimes.
Details
Sample
Successfull request:
Error request:
To get the audit of the orders.
Details
Sample
To get latest orderbook, for both cash and derivatives accounts.
Details
Sample
To get order history, for both cash and derivatives accounts.
Details
Sample
To get cash account's balance.
Details
Sample
To query stock positions of cash accounts.
Details
Sample
To get derivatives account's balance.
Sample
Sample
To get dervatives account's position. After getting the snapshot, you can subscribed streaming to get realtime update.
Details
Sample
To get max buy quantity. Applied for both cash and derivatives accounts.
Details
Sample
To get max sell quantity. Applied for both cash and derivatives accounts.
Details
Sample
To place orders.
Details
Sample
Successful request:
Error request:
To amend an order.
Details
Sample
Successful request:
Error request:
To cancel an order.
Details
Sample
Successful request:
Error request:
To place derivatives orders.
Details
Sample
Successful request:
Error request:
To amend a derivatives order.
Details
Sample
Successful request:
Error request:
To cancel a derivatives order.
Details
Sample
Successfull request:
Error request:
Get rate Limit
Details
Sample:
Query cash in advance available amount
Details
Sample:
Query unsettle sold transactions
Details
Sample:
Query cash transfer histories
Details
Sample:
Query cash in advance histories
Details
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 6 months
Sample:
Query estimate cash in advance fee
Details
Sample:
Tranfer cash with VSD (only support for derivatives account)
Details
Sample:
Successfull request:
Error request:
Transfer cash inside
Note:
The source account number and the receiving account number must have the same name and money can only be transferred between sub-accounts
Thông tin chi tiết
Ví dụ
Successfull request:
Error request:
Create cash in advance transaction
Details
Sample
Successfull request:
Error request:
Get history dividend
Details
Sample
Query stock quantity can register subscription
Details
Sample:
Get histories
Details
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 1 year
Sample
Create online right subscription
Thông tin chi tiết
Sample
Successfull request:
Error request:
Get stock transferable
Details
Sample:
Get stock transfer history
Details
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 6 months
Sample:
Transfer stock inside
Detail
Sample:
Successfull request:
Error request:
API | Method | Path |
---|---|---|
API | Method | Path |
---|---|---|
API | Method | Path |
---|---|---|
Method | Content | Content |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Dữ liệu | Kiểu | Mô tả |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required | Description |
---|---|---|---|
Field | Type | Describe |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Dữ liệu | Kiểu | Mô tả |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Dữ liệu | Kiểu | Mô tả |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Dữ liệu | Kiểu | Mô tả |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Required? | Description |
---|---|---|---|
Dữ liệu | Kiểu | Mô tả |
---|---|---|
AccessToken
POST
Trading/AccessToken
GetOTP
POST
Trading/GetOTP
orderBook
GET
Trading/orderBook
auditOrderBook
GET
Trading/auditOrderBook
cashAcctBal
GET
Trading/cashAcctBal
derivAcctBal
GET
Trading/derivAcctBal
ppmmraccount
GET
Trading/ppmmraccount
stockPosition
GET
Trading/stockPosition
derivPosition
GET
Trading/derivPosition
maxBuyQty
GET
Trading/maxBuyQty
maxSellQty
GET
Trading/maxSellQty
orderHistory
GET
Trading/orderHistory
rateLimit
GET
Trading/rateLimit
NewOrder
POST
Trading/NewOrder
CancelOrder
POST
Trading/CancelOrder
derNewOrder
POST
Trading/derNewOrder
ModifyOrder
POST
Trading/ModifyOrder
derCancelOrder
POST
Trading/derCancelOrder
derModifyOrder
POST
Trading/derModifyOrder
cashInAdvanceAmount
GET
cash/cashInAdvanceAmount
unsettleSoldTransaction
GET
cash/unsettleSoldTransaction
transferHistories
GET
cash/transferHistories
cashInAdvanceHistories
GET
cash/cashInAdvanceHistories
estCashInAdvanceFee
GET
cash/estCashInAdvanceFee
vsdCashDW
POST
cash/vsdCashDW
transferInternal
POST
cash/transferInternal
createCashInAdvance
POST
cash/createCashInAdvance
transferable
GET
stock/transferable
transferHistories
GET
stock/transferHistories
transfer
POST
stock/transfer
dividend
GET
ors/dividend
exercisableQuantity
GET
ors/exercisableQuantity
histories
GET
ors/histories
create
POST
ors/create
Post
Header (Authorization, Content-Type)
Body (json)
Get
Header (Authorization)
Params
consumerID
string
Yes
Your consumerID
consumerSecret
string
Yes
Your consumerSecret
code
string
No
Authentication code. Refer to General Information for details. Required if isSave = true.
TwoFactorType
string
Yes
Your account's authentication type. Supported values: 0 (PIN), 1 (OTP)
isSave
boolean
Yes
If true: you will not have to fill in authentication code for each transaction. The code will be saved within the login sesion.
If false: you will have to fill in authentication code for each transaction.
message
string
status
number
data
list
List data
accessToken
string
consumerID
string
Yes
You consumerID
consumerSecret
string
Yes
Your consumerSecret
message
string
status
number
account
string
Yes
message
string
status
number
data
list
List data
uniqueID
string
orderID
string
buySell
string
price
number
quantity
number
filledQty
string
orderStatus
string
marketID
string
inputTime
string
modifiedTime
string
instrumentID
string
orderType
string
cancelQty
string
avgPrice
string
isForcesell
string
isShortsell
string
rejectReason
string
lastErrorEvent
list
account
string
Yes
Input the account to query. Accept both cash and derivatives accounts.
message
string
status
number
data
list
List data
uniqueID
string
orderID
string
buySell
string
price
number
quantity
number
filledQty
string
orderStatus
string
marketID
string
inputTime
string
modifiedTime
string
instrumentID
string
orderType
string
cancelQty
string
avgPrice
string
isForcesell
string
isShortsell
string
rejectReason
string
account
string
Yes
startDate
date
Yes
Format dd/mm/yyyy
endDate
date
Yes
Format dd/mm/yyyy
message
string
status
number
data
list
List data
orderHistories
list
uniqueID
string
orderID
string
buySell
string
price
number
Placed price
quantity
number
Placed quantity
filledQty
string
orderStatus
string
marketID
string
inputTime
string
modifiedTime
string
instrumentID
string
orderType
string
cancelQty
string
avgPrice
string
isForcesell
string
isShortsell
string
rejectReason
string
account
string
Yes
message
string
status
number
data
list
List data
account
string
cashbal
number
cashonhold
number
secureamount
number
Secure amount intraday
withdrawable
number
receivingcasht1
number
Sell amount to receive on T1
receivingcasht2
number
Sell amount to receive on T2
matchedbuyvolume
number
Matched buy amount
matchedsellvolume
number
Matched sell amount
unmatchedbuyvolume
number
Unmatched buy amount
unmatchedsellvolume
number
Unmatched sell amount
paidcasht1
number
Buy amount to pay on T1
paidcasht2
number
Buy amount to pay T2
cia
number
cash advance amount
debt
number
purchasingpower
number
totalasset
number
account
string
Yes
Input account number
message
string
status
number
data
list
List data
totalMarketValue
number
= sum(maketprice * onhand)
stockPositions
list
marketID
string
instrumentID
string
Stock symbol
onHand
number
Total settled quantity in the account, which includes: sellable, hold, block, mortgage, sellT0, sellT1. Not include bonus, buyT0, buyT1
block
number
Blocked quantity
bonus
number
Dividend and bonus quantity
buyT0
number
Buy quantity matched on T0
buyT1
number
Buy quantity settled on T1
buyT2
number
Buy quantity settled on T2
sellT0
number
Sell quantity matched on T0
sellT1
number
Sel quantity settled on T1
sellT2
number
Sell quantity settled on T2
avgPrice
number
Average cost price
mortgage
number
Mortgage quantity
holdForTrade
number
Quantity restricted from trading
marketPrice
number
Market price of the stock
account
string
Yes
message
string
status
number
data
list
List data
account
string
accountbalance
number
fee
number
commission
number
interest
number
Loan
number
deliveryamount
number
floatingpl
number
totalpl
number
marginable
number
depositable
number
rccall
number
withdrawable
number
noncashdrawablerccall
number
internalassets
list
Assets in SSI:
Cash
Validnoncash
totalvalue:
maxvalidnoncash
cashwithdrawable
Ee
exchangeassets
list
Assets at VSD:
Cash
Validnoncash
totalvalue:
maxvalidnoncash
cashwithdrawable
Ee
internalmargin
list
SSI margin requirements:
initialmargin
deliverymargin
marginreq
accountratio
usedlimitwarninglevel1
usedlimitwarninglevel2
usedlimitwarninglevel3
margincall
exchangemargin
list
VSD margin requirement:
marginreq
accountratio
usedlimitwarninglevel1
usedlimitwarninglevel2
usedlimitwarninglevel3
margincall
account
string
Yes
querySummary
boolean
Yes
True: Netoff position
False: don't netoff position
message
string
status
number
data
list
List data
account
string
openPosition
list
closePosition
list
marketID
string
instrumentID
string
longQty
number
shortQty
number
net
number
bidAvgPrice
number
askAvgPrice
number
tradePrice
number
marketPrice
number
floatingPL
number
tradingPL
number
account
string
Yes
instrumentID
string
Yes
price
number
Yes
message
string
status
number
data
list
List data
account
string
maxbuyqty
number
marginRatio
number
purchasingPower
number
account
string
Yes
instrumentID
string
Yes
price
number
Yes
message
string
status
number
data
list
List data
account
string
maxSellQty
number
instrumentID
string
Yes
market
string
Yes
VN: cash market
VNFE: derivatives market
buySell
string
Yes
buy (B): mua/Sell (S): bán đã đặt theo orderID của lệnh
B: Buy
S: Sell
orderType
string
Yes
channelID
string
Yes
Kênh đặt lệnh VD: TA (trader API)
price
number
Yes
Giá đặt lệnh:
- Nếu loại lệnh là LO -> Giá đặt > 0
- Nếu loại lệnh khác LO -> Giá đặt = 0
quantity
number
Yes
account
string
Yes
requestID
string
Yes
ID đặt lệnh trong ngày. Bắt buộc 8 số random
stopOrder
string
Yes
True: conditional orders. Only applied for derivatives market.
False: normal orders
stopPrice
number
Yes
If stopOrder = true -> stopPrice > 0
stopType
string
Yes
Required if stopType = true:
D: Down
U: Up
V: Trailling Up
E: Trailing Down
O: OCO
B: BullBear
stopStep
number
Yes
Stop loss amount, only applied for BullBear (stopType = B)
profitStep
number
Yes
Take profit amount, only applied for BullBear (stopType = B)
code
number
No
Authentication code: PIN/OTP (depending on your registered authentication type)
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
requestData
string
instrumentID
string
market
string
buySell
string
orderType
string
Order type:
Order type = True: it is a conditional order (only applicable to Derivatives)
Order type = False: it is a normal order
channelID
string
price
number
quantity
number
account
string
requestID
string
stopOrder
string
stopPrice
number
stopType
string
stopStep
number
profitStep
number
orderID
string
Yes
instrumentID
string
Yes
instrument of the amended order
marketID
string
Yes
VN: cash market
VNFE: derivatives market
buySell
string
Yes
side of the amended order
orderType
string
Yes
channelID
string
Yes
price
number
Yes
New price
quantity
number
Yes
New quantity
account
string
Yes
requestID
string
Yes
Unique id of the request generated by client. Required 8 digits.
code
number
No
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
requestData
string
instrumentID
string
market
string
buySell
string
orderType
string
price
number
quantity
number
orderID
string
account
string
orderID
string
Yes
instrumentID
string
Yes
market
string
Yes
buySell
string
Yes
orderType
string
Yes
channelID
string
Yes
price
number
Yes
quantity
number
Yes
account
string
Yes
requestID
string
Yes
code
number
No
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
requestData
string
instrumentID
string
marketID
string
buySell
string
orderType
string
price
number
quantity
number
orderID
string
account
string
instrumentID
string
Yes
market
string
Yes
VNFE: derivatives market
buySell
string
Yes
B: Buy
S: Sell
orderType
string
Yes
channelID
string
Yes
price
number
Yes
quantity
number
Yes
account
string
Yes
requestID
string
Yes
stopOrder
string
Yes
True: conditional order, applied to derivatives market only.
False: normal order
stopPrice
number
Yes
If stopOrder = true -> stopPrice > 0
stopType
string
Yes
Required if stopType = true:
D: Down
U: Up
V: Trailling Up
E: Trailing Down
O: OCO
B: BullBear
stopStep
number
Yes
only applied for BullBear (stopType = B)
profitStep
number
Yes
Only applied for BullBear (stopType = B)
code
number
No
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
requestData
string
instrumentID
string
market
string
buySell
string
orderType
string
channelID
string
price
number
quantity
number
account
string
requestID
string
stopOrder
string
stopPrice
number
stopType
string
stopStep
number
profitStep
number
orderID
string
Yes
instrumentID
string
Yes
marketID
string
Yes
buySell
string
Yes
orderType
string
Yes
channelID
string
Yes
price
number
Yes
quantity
number
Yes
account
string
Yes
requestID
string
Yes
uniqueid of the request
code
number
No
Authentication code: PIN, OTP (depending your registered authentication type)
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
requestData
string
instrumentID
string
market
string
buySell
string
orderType
string
price
number
quantity
number
orderID
string
account
string
orderID
string
Yes
instrumentID
string
Yes
market
string
Yes
VNFE
buySell
string
Yes
orderType
string
Yes
channelID
string
Yes
price
number
Yes
quantity
number
Yes
account
string
Yes
requestID
string
Yes
code
number
No
Authentication code: PIN/OTP depending on your registered authentication type
deviceID
string
Yes
userAgent
string
No
message
string
status
number
data
list
List data
requestID
string
uniqueid of the cancel instruction
requestData
string
instrumentID
string
marketID
string
buySell
string
orderType
string
price
number
quantity
number
orderID
string
ID of the going-to-cancel order
account
string
message
string
status
number
data
list
List data
endpoint
string
The set rateLimit information includes one of the following cases: * -> All APIs post:* -> API method POST get:* -> API method GET *:*/api_name -> rateLimit API name
period
string
format: s,m,h,d
limit
number
account
string
Yes
message
string
status
number
data
list
List data
account
string
ciaAmounts
list
dueDate
string
Format: dd/mm/yyyy
sellValue
number
netSellValue
number
advance
number
cashAdvance
number
account
string
Yes
settleDate
string
No
Format: dd/mm/yyyy
message
string
status
number
data
list
List data
account
string
unsettledSoldTransactions
list
tradeDate
string
instrumentID
string
netSellValue
number
quantity
number
price
number
account
string
Yes
fromDate
string
Yes
format: dd/mm/yyyy
toDate
string
Yes
format: dd/mm/yyyy
message
string
Mô tả msg call API
status
number
Trạng thái
data
list
Thông tn dữ liệu trả ra
transferHistories
list
Danh sách lịch sử chuyển tiền và Nộp/Rút ký quỹ
transactionID
string
Mã chi nhánh ngân hàng
date
string
Ngày thực hiện giao dịch
account
string
Số tài khoản chuyển
beneficiaryAccount
string
Số tài khoản nhận
amount
number
Số tiền
bankName
string
Ngân hàng nhận
bankBranchName
string
Chi nhánh ngân hàng nhận
beneficiary
string
Tên người nhận
remark
string
Nội dung
type
string
Loại giao dịch (Nộp/ Rút)
status
string
Trạng thái chuyển
account
string
Yes
fromDate
string
Yes
Format: dd/mm/yyyy
toDate
string
Yes
Format: dd/mm/yyyy
message
string
status
number
data
list
List data
account
string
ciaHistories
list
transactionID
string
date
string
totalAmount
number
status
string
detai
list
type
string
I: Fee and D & W: ciaAmount
value
number
settleDate
string
account
string
Yes
ciaAmount
string
No
receiveAmount
string
No
message
string
status
number
data
list
List data
account
string
ciaAmount
number
receiveAmount
number
fee
number
account
string
Yes
amount
number
Yes
type
string
Yes
Include:
W = withdraw
D = deposit
remark
string
No
code
string
No
isSave = false -> Required PIN/ OTP isSave = true -> no required
message
string
Mô tả msg call API
status
number
Trạng thái
data
list
Thông tn dữ liệu trả ra
transactionID
string
Số hiệu giao dịch
account
string
Yes
beneficiaryAccount
string
Yes
amount
number
Yes
type
string
Yes
Include:
W = withdraw
D = deposit
remark
string
No
code
string
No
isSave = false -> Required PIN/ OTP isSave = true -> no required
message
string
status
number
data
list
List data
transactionID
string
account
string
Yes
ciaAmount
string
No
receiveAmount
string
No
code
string
Yes
OTP/PIN
message
string
status
number
data
list
List data
account
string
transactionID
string
account
string
Yes
message
string
status
number
data
list
List data
account
string
dividends
list
stockDividend
string
Include:
- STOCK DIVIDEND
- CASH DIVIDEND
- BONUS ISSUE
- EXERCISE CW
- EXERCISE RIGHTS
instrumentID
string
quantity
number
executedRate
string
closeDate
string
format: dd/mm/yyyy
paidDate
string
format: dd/mm/yyyy
amount
number
status
string
receivedQuantity
number
issueInstrument
string
distributedFlag
string
payableDate
string
format: dd/mm/yyyy
subscriptionPrice
number
subscriptionAmount
number
subscriptionQuantity
number
subscriptionPeriodFrom
string
format: dd/mm/yyyy
subscriptionPeriodTo
string
format: dd/mm/yyyy
entitlementID
string
account
string
Yes
message
string
status
number
data
list
List data
account
string
exercisableQuantities
list
entitlementID
string
instrumentID
string
subscriptionPrice
number
executedRateFrom
number
subscriptionPeriodFrom
string
format: dd/mm/yyyy
subscriptionPeriodTo
string
format: dd/mm/yyyy
exerciseableQuantity
number
exerciseableReceiveQuantity
number
exercisedReceiveQuantity
number
executedRateTo
number
format: dd/mm/yyyy
exercisedQuantity
number
payableDate
string
format: dd/mm/yyyy
account
string
Yes
Số tài khoản nguồn truy vấn
startDate
string
Yes
Ngày bắt đầu tìm kiếm Định dạng: dd/mm/yyyy
endDate
string
Yes
Ngày kết thúc tìm kiếm Định dạng: dd/mm/yyyy
message
string
status
number
data
list
List data
account
string
onlineRightSubscriptionHistories
list
transactionID
string
dateTime
string
instrumentID
string
ratioFrom
number
subscriptionPrice
number
subscriptionPeriodFrom
string
format: dd/mm/yyyy
subscriptionPeriodTo
string
format: dd/mm/yyyy
exercisedReceivedQty
number
amount
number
status
string
ratioTo
number
underlyingInstrumentID
string
account
string
Yes
instrumentID
string
Yes
entitlementID
string
Yes
quantity
number
Yes
amount
number
Yes
code
string
No
PIN/ OTP
message
string
status
number
data
list
List data
account
string
transactionID
string
account
string
Yes
message
string
status
number
data
list
List data
account
string
transferableStocks
list
instrumentID
string
quantity
number
instrumentType
string
account
string
Yes
startDate
string
Yes
format: dd/mm/yyyy
endDate
string
Yes
format: dd/mm/yyyy
message
string
status
number
data
list
List data
account
string
stockTransferHistories
list
transactionID
string
beneficiaryAccount
string
instrumentID
string
quantity
number
dateTime
string
status
string
remark
string
auditRemark
string
account
string
Yes
beneficiaryAccount
string
Yes
exchangeID
string
Yes
instrumentID
string
Yes
quantity
number
Yes
code
string
No
isSave = false -> required PIN/ OTP isSave = true -> no required
message
string
Mô tả msg call API
status
number
Trạng thái
data
list
Thông tn dữ liệu trả ra
account
string
Số tài khoản
transactionID
string
Số hiệu giao dịch