For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  • 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.

Dữ liệu
Kiểu
Mô tả

message

string

status

number

data

list

List data

accessToken

string

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

Field
Type
Description

message

string

status

number

Sample

  • Successfull request:

  • Error request:

GET auditOrderBook

To get the audit of the orders.

Details

Field
Type
Required?
Description

account

string

Yes

Field
Type
Description

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

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.

Field
Type
Description

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

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

Field
Type
Description

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

Sample

GET cashAccountBalance

To get cash account's balance.

Details

Field
Type
Required
Description

account

string

Yes

Field
Type
Describe

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

Sample

GET stockPosition

To query stock positions of cash accounts.

Details

Field
Type
Required?
Description

account

string

Yes

Input account number

Field
Type
Description

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

Sample

GET derivativeAccountBalance

To get derivatives account's balance.

Sample

Field
Type
Required?
Description

account

string

Yes

Field
Type
Description

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

nav

number

Net assert value

origMarginRatio

number

Original margin ratio

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

  • True: Netoff position

  • False: don't netoff position

Field
Type
Description

message

string

status

number

data

list

List data

account

string

openPositions

list

closePositions

list

marketID

string

instrumentID

string

longQty

number

shortQty

number

net

number

bidAvgPrice

number

askAvgPrice

number

tradePrice

number

marketPrice

number

floatingPL

number

tradingPL

number

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

Field
Type
Description

message

string

status

number

data

list

List data

account

string

maxbuyqty

number

marginRatio

number

purchasingPower

number

origMarginRatio

number

Original margin ratio

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

Field
Type
Description

message

string

status

number

data

list

List data

account

string

maxSellQty

number

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 Only support value "TA" (FCTrading 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

Field
Type
Description

message

string

status

number

data

list

List data

requestID

string

requestData

string

instrumentID

string

marketID

string

Market code:

VN: cash market

VNFE: derivative market

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

forceSell

boolean

Force sell order

modifiable

boolean

Can edit/modify order

note

string

Order note

brokerID

string

Broker ID

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

Only support value "TA" (FCTrading API)

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

Field
Type
Description

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

note

string

order note

brokerId

string

broker ID

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

Only support value "TA" (FCTrading API)

price

number

Yes

quantity

number

Yes

account

string

Yes

requestID

string

Yes

code

number

No

deviceID

string

Yes

userAgent

string

No

Field
Type
Description

message

string

status

number

data

list

List data

requestData

string

instrumentID

string

marketID

string

buySell

string

orderType

string

price

number

quantity

number

orderID

string

account

string

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

Order channel Only support value "TA" (FCTrading API)

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

Field
Type
Description

message

string

status

number

data

list

List data

requestID

string

requestData

string

instrumentID

string

marketID

string

Market ID:

VN: Cash market

VNFE: Derivative market

buySell

string

orderType

string

channelID

string

price

number

quantity

number

account

string

requestID

string

stopOrder

string

stopPrice

number

stopType

string

stopStep

number

profitStep

number

forceSell

boolean

force sell order?

modifiable

boolean

can order be modified

note

string

order note

brokerID

string

broker ID

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

Order channel Only support value "TA" (FCTrading API)

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

Field
Type
Description

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

note

string

Order note

brokerId

string

Broker ID

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

Only support value "TA" (FCTrading API)

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

Field
Type
Description

message

string

status

number

data

list

List data

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

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

Field
Type
Description

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

Sample:

GET unsettleSoldTransaction

Query unsettle sold transactions

Details

Field
Type
Required?
Description

account

string

Yes

settleDate

string

No

Format: dd/mm/yyyy

Field
Type
Description

message

string

status

number

data

list

List data

account

string

unsettledSoldTransactions

list

tradeDate

string

instrumentID

string

netSellValue

number

quantity

number

price

number

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

Dữ liệu
Kiểu
Mô tả

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

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

Dữ liệu
Kiểu
Mô tả

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

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

Field
Type
Description

message

string

status

number

data

list

List data

account

string

ciaAmount

number

receiveAmount

number

fee

number

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

Dữ liệu
Kiểu
Mô tả

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

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

remark

string

No

code

string

No

isSave = false -> Required PIN/ OTP isSave = true -> no required

Field
Type
Description

message

string

status

number

data

list

List data

transactionID

string

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

Field
Type
Description

message

string

status

number

data

list

List data

account

string

transactionID

string

Sample

  • Successfull request:

  • Error request:

Online Right Subscription

GET dividend

Get history dividend

Details

Field
Type
Required?
Description

account

string

Yes

Field
Type
Description

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

exchangeID

string

Exchange ID (HOSE/HNX/UPCOM)

Sample

GET exercisableQuantity

Query stock quantity can register subscription

Details

Field
Type
Required?
Description

account

string

Yes

Field
Type
Description

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

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

Field
Type
Description

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

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

Field
Type
Description

message

string

status

number

data

list

List data

account

string

transactionID

string

Sample

  • Successfull request:

  • Error request:

Stock

GET transferable

Get stock transferable

Details

Field
Type
Required?
Description

account

string

Yes

Field
Type
Description

message

string

status

number

data

list

List data

account

string

transferableStocks

list

instrumentID

string

quantity

number

instrumentType

string

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

Field
Type
Description

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

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

Dữ liệu
Kiểu
Mô tả

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

Sample:

  • Successfull request:

  • Error request:

Last updated