API Specs
API List
Token and Authentication code
API | Method | Path |
---|---|---|
AccessToken | POST | Trading/AccessToken |
GetOTP | POST | Trading/GetOTP |
Query cash and derivatives accounts
API | Method | Path |
---|---|---|
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 |
Order placing
API | Method | Path |
---|---|---|
NewOrder | POST | Trading/NewOrder |
CancelOrder | POST | Trading/CancelOrder |
derNewOrder | POST | Trading/derNewOrder |
ModifyOrder | POST | Trading/ModifyOrder |
derCancelOrder | POST | Trading/derCancelOrder |
derModifyOrder | POST | Trading/derModifyOrder |
Cash
API | Method | Path |
---|---|---|
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 |
Stock
API | Method | Path |
---|---|---|
transferable | GET | stock/transferable |
transferHistories | GET | stock/transferHistories |
transfer | POST | stock/transfer |
Online Right Subscription
API | Method | Path |
---|---|---|
dividend | GET | ors/dividend |
exercisableQuantity | GET | ors/exercisableQuantity |
histories | GET | ors/histories |
create | POST | ors/create |
Configuration
Method | Content | Content |
---|---|---|
Post | Header (Authorization, Content-Type) | Body (json) |
Get | Header (Authorization) | Params |
Request access
POST AccessToken
To get token to access APIs.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
|
Sample
Successfull request:
Error request:
POST GetOTP
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
Field | Type | Required? | Description |
---|---|---|---|
consumerID | string | Yes | You consumerID |
consumerSecret | string | Yes | Your consumerSecret |
Sample
Successfull request:
Error request:
GET auditOrderBook
To get the audit of the orders.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample
POST OrderBook
To get latest orderbook, for both cash and derivatives accounts.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | Input the account to query. Accept both cash and derivatives accounts. |
Sample
GET orderHistory
To get order history, for both cash and derivatives accounts.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
startDate | date | Yes | Format dd/mm/yyyy |
endDate | date | Yes | Format dd/mm/yyyy |
Sample
GET cashAccountBalance
To get cash account's balance.
Details
Field | Type | Required | Description |
---|---|---|---|
account | string | Yes |
Sample
GET stockPosition
To query stock positions of cash accounts.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | Input account number |
Sample
GET derivativeAccountBalance
To get derivatives account's balance.
Sample
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample
GET derivativePosition
To get dervatives account's position. After getting the snapshot, you can subscribed streaming to get realtime update.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
querySummary | boolean | Yes |
|
Sample
GET maxBuyQty
To get max buy quantity. Applied for both cash and derivatives accounts.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
instrumentID | string | Yes | |
price | number | Yes |
Sample
GET maxSellQty
To get max sell quantity. Applied for both cash and derivatives accounts.
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
instrumentID | string | Yes | |
price | number | Yes |
Sample
POST NewOrder
To place orders.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
|
stopPrice | number | Yes | If stopOrder = true -> stopPrice > 0 |
stopType | string | Yes | Required if stopType = true:
|
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 |
Sample
Successful request:
Error request:
POST ModifyOrder
To amend an order.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample
Successful request:
Error request:
POST CancelOrder
To cancel an order.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample
Successful request:
Error request:
POST derNewOrder
To place derivatives orders.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
|
stopPrice | number | Yes | If stopOrder = true -> stopPrice > 0 |
stopType | string | Yes | Required if stopType = true:
|
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 |
Sample
Successful request:
Error request:
POST derModifyOrder
To amend a derivatives order.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample
Successful request:
Error request:
POST derCancelOrder
To cancel a derivatives order.
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample
Successfull request:
Error request:
GET rateLimit
Get rate Limit
Details
Field | Type | Description |
---|---|---|
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 |
Sample:
Cash
GET cashInAdvanceAmount
Query cash in advance available amount
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample:
GET unsettleSoldTransaction
Query unsettle sold transactions
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
settleDate | string | No | Format: dd/mm/yyyy |
Sample:
GET transferHistories
Query cash transfer histories
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
fromDate | string | Yes | format: dd/mm/yyyy |
toDate | string | Yes | format: dd/mm/yyyy |
Sample:
GET cashInAdvanceHistories
Query cash in advance histories
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
fromDate | string | Yes | Format: dd/mm/yyyy |
toDate | string | Yes | Format: dd/mm/yyyy |
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 6 months
Sample:
GET estCashInAdvanceFee
Query estimate cash in advance fee
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
ciaAmount | string | No | |
receiveAmount | string | No |
Sample:
POST vsdCashDW
Tranfer cash with VSD (only support for derivatives account)
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample:
Successfull request:
Error request:
POST transferInternal
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
Field | Type | Required? | Description |
---|---|---|---|
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 |
Ví dụ
Successfull request:
Error request:
POST createCashInAdvance
Create cash in advance transaction
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
ciaAmount | string | No | |
receiveAmount | string | No | |
code | string | Yes | OTP/PIN |
Sample
Successfull request:
Error request:
Online Right Subscription
GET dividend
Get history dividend
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample
GET exercisableQuantity
Query stock quantity can register subscription
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample:
GET histories
Get histories
Details
Field | Type | Required? | Description |
---|---|---|---|
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 |
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 1 year
Sample
POST create
Create online right subscription
Thông tin chi tiết
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
instrumentID | string | Yes | |
entitlementID | string | Yes | |
quantity | number | Yes | |
amount | number | Yes | |
code | string | No | PIN/ OTP |
Sample
Successfull request:
Error request:
Stock
GET transferable
Get stock transferable
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes |
Sample:
GET transferHistories
Get stock transfer history
Details
Field | Type | Required? | Description |
---|---|---|---|
account | string | Yes | |
startDate | string | Yes | format: dd/mm/yyyy |
endDate | string | Yes | format: dd/mm/yyyy |
Note:
fromDate - toDate not more than 1 month
The time for searching the past should not exceed 6 months
Sample:
POST transfer
Transfer stock inside
Detail
Field | Type | Required? | Description |
---|---|---|---|
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 |
Sample:
Successfull request:
Error request:
Last updated