> For the complete documentation index, see [llms.txt](https://guide.ssi.com.vn/ssi-products/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.ssi.com.vn/ssi-products/fastconnect-trading/api-specs.md).

# API Specs

## API List

* **Token and Authentication code**

<table><thead><tr><th width="219.33333333333331">API</th><th width="108">Method</th><th>Path</th></tr></thead><tbody><tr><td>AccessToken</td><td>POST</td><td>Trading/AccessToken</td></tr><tr><td>GetOTP</td><td>POST</td><td>Trading/GetOTP</td></tr></tbody></table>

* **Query cash and derivatives accounts**

<table><thead><tr><th width="219.33333333333331">API</th><th width="108">Method</th><th>Path</th></tr></thead><tbody><tr><td>orderBook</td><td>GET</td><td>Trading/orderBook</td></tr><tr><td>auditOrderBook</td><td>GET</td><td>Trading/auditOrderBook</td></tr><tr><td>cashAcctBal</td><td>GET</td><td>Trading/cashAcctBal</td></tr><tr><td>derivAcctBal</td><td>GET</td><td>Trading/derivAcctBal</td></tr><tr><td>ppmmraccount</td><td>GET</td><td>Trading/ppmmraccount</td></tr><tr><td>stockPosition</td><td>GET</td><td>Trading/stockPosition</td></tr><tr><td>derivPosition</td><td>GET</td><td>Trading/derivPosition</td></tr><tr><td>maxBuyQty</td><td>GET</td><td>Trading/maxBuyQty</td></tr><tr><td>maxSellQty</td><td>GET</td><td>Trading/maxSellQty</td></tr><tr><td>orderHistory</td><td>GET</td><td>Trading/orderHistory</td></tr><tr><td>rateLimit</td><td>GET</td><td>Trading/rateLimit</td></tr></tbody></table>

* **Order placing**&#x20;

<table><thead><tr><th width="219.33333333333331">API</th><th width="108">Method</th><th>Path</th></tr></thead><tbody><tr><td>NewOrder</td><td>POST</td><td>Trading/NewOrder</td></tr><tr><td>CancelOrder</td><td>POST</td><td>Trading/CancelOrder</td></tr><tr><td>derNewOrder</td><td>POST</td><td>Trading/derNewOrder</td></tr><tr><td>ModifyOrder</td><td>POST</td><td>Trading/ModifyOrder</td></tr><tr><td>derCancelOrder</td><td>POST</td><td>Trading/derCancelOrder</td></tr><tr><td>derModifyOrder</td><td>POST</td><td>Trading/derModifyOrder</td></tr></tbody></table>

* Cash

<table><thead><tr><th width="234.33333333333331">API</th><th width="108">Method</th><th>Path</th></tr></thead><tbody><tr><td>cashInAdvanceAmount</td><td>GET</td><td>cash/cashInAdvanceAmount</td></tr><tr><td>unsettleSoldTransaction</td><td>GET</td><td>cash/unsettleSoldTransaction</td></tr><tr><td>transferHistories</td><td>GET</td><td>cash/transferHistories</td></tr><tr><td>cashInAdvanceHistories</td><td>GET</td><td>cash/cashInAdvanceHistories</td></tr><tr><td>estCashInAdvanceFee</td><td>GET</td><td>cash/estCashInAdvanceFee</td></tr><tr><td>vsdCashDW</td><td>POST</td><td>cash/vsdCashDW</td></tr><tr><td>transferInternal</td><td>POST</td><td>cash/transferInternal</td></tr><tr><td>createCashInAdvance</td><td>POST</td><td>cash/createCashInAdvance</td></tr></tbody></table>

* Stock

<table><thead><tr><th width="178.33333333333331">API</th><th width="108">Method</th><th>Path</th></tr></thead><tbody><tr><td>transferable</td><td>GET</td><td>stock/transferable</td></tr><tr><td>transferHistories</td><td>GET</td><td>stock/transferHistories</td></tr><tr><td>transfer</td><td>POST</td><td>stock/transfer</td></tr></tbody></table>

* Online Right Subscription

<table><thead><tr><th width="205.33333333333331">API</th><th width="100">Method</th><th>Path</th></tr></thead><tbody><tr><td>dividend</td><td>GET</td><td>ors/dividend</td></tr><tr><td>exercisableQuantity</td><td>GET</td><td>ors/exercisableQuantity</td></tr><tr><td>histories</td><td>GET</td><td>ors/histories</td></tr><tr><td>create</td><td>POST</td><td>ors/create</td></tr></tbody></table>

## Configuration

<table><thead><tr><th width="145.33333333333331">Method</th><th width="344">Content</th><th>Content</th></tr></thead><tbody><tr><td>Post</td><td>Header (Authorization, Content-Type)</td><td>Body (json)</td></tr><tr><td>Get</td><td>Header (Authorization)</td><td>Params</td></tr></tbody></table>

## Request access

### POST  AccessToken

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/AccessToken
```

To get token to access APIs.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>consumerID</td><td>string</td><td>Yes</td><td>Your consumerID </td></tr><tr><td>consumerSecret</td><td>string</td><td>Yes</td><td>Your consumerSecret </td></tr><tr><td>code</td><td>string</td><td>No</td><td>Authentication code. Refer to <a href="/pages/sQZ7rZ5zgxlgyab8be3v">General Information</a> for details. Required if isSave = true. </td></tr><tr><td>TwoFactorType</td><td>string</td><td>Yes</td><td>Your account's authentication type. Supported values: 0 (PIN),  1 (OTP)</td></tr><tr><td>isSave</td><td>boolean</td><td>Yes</td><td><ul><li>If true: you will not have to fill in authentication code for each transaction. The code will be saved within the login sesion. </li><li>If false: you will have to fill in authentication code for each transaction. </li></ul></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Dữ liệu</th><th width="98">Kiểu</th><th>Mô tả</th></tr></thead><tbody><tr><td>message</td><td>string</td><td> </td></tr><tr><td>status</td><td>number</td><td> </td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>accessToken</td><td>string</td><td> </td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successfull request:&#x20;

```json
Input: 
{
  consumerID: "38f5fdfa56b44d5ab8b95895eb588e99",
  consumerSecret: "6d61bffefc6540fc837c71afd2ca4bcf",
  twoFactorType: 1,
  code: "123456789",
  isSave: false
}
Output: 
{
    message: "Success",
    status: 200,
    data: {
        "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ”
}
```

* Error request:&#x20;

```json
Input: 
{
  consumerID: "38f5fdfa56b44d5ab8b95895eb588e99",
  consumerSecret: "6d61bffefc6540fc837c71afd2ca4bcf",
  twoFactorType: 0,
  code: "123456789",
  isSave: true
}
Output: 
{
message: "Key does not exist.",
status: 400,
data: null
 }
```

### POST  GetOTP

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/GetOTP
```

To get OTP code if you registered SMS OTP/Email OTP.&#x20;

{% hint style="info" %}
If you get OTP code for 5 times without verification, your OTP service will be temporarily blocked and then automatically unlocked after sometimes. &#x20;
{% endhint %}

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="177">Field</th><th width="86">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>consumerID</td><td>string</td><td>Yes</td><td>You consumerID </td></tr><tr><td>consumerSecret</td><td>string</td><td>Yes</td><td>Your consumerSecret </td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successfull request:&#x20;

```json
Input: 
{
  "consumerID": "968d7b5940f5437583021aea2b038f35",
  "consumerSecret": "11ab3fc6af954c59ba646fac016f30cb"
}
Output: 
{
    message: "Success",
    status: 200
}
```

* Error request:

```json
Input: 
{
  "consumerID": "968d7b5940f5437583021aea2b038f351",
  "consumerSecret": "11ab3fc6af954c59ba646fac016f30cb"
}
Output: 
{
  "message": "ConsumerID is invalid",
  "status": 400
}
```

### GET  auditOrderBook

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/auditOrderBook
```

To get the audit of the orders.

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>uniqueID</td><td>string</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>filledQty</td><td>string</td><td></td></tr><tr><td>orderStatus</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>inputTime</td><td>string</td><td></td></tr><tr><td>modifiedTime</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>cancelQty</td><td>string</td><td></td></tr><tr><td>avgPrice</td><td>string</td><td></td></tr><tr><td>isForcesell</td><td>string</td><td></td></tr><tr><td>isShortsell</td><td>string</td><td></td></tr><tr><td>rejectReason</td><td>string</td><td></td></tr><tr><td>lastErrorEvent</td><td>list</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "1184418"
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "1184418",
    "orders": [
      {
        "uniqueID": "73885549",
        "orderID": "T202306146w273885549",
        "buySell": "B",
        "price": 1000,
        "quantity": 100,
        "filledQty": 0,
        "orderStatus": "RJ",
        "marketID": "VNFE",
        "inputTime": "1686730747945",
        "modifiedTime": "1686730747945",
        "instrumentID": "VN30F2306",
        "orderType": "LO",
        "cancelQty": 0,
        "avgPrice": 0,
        "isForcesell": "F",
        "isShortsell": "F",
        "rejectReason": "Invalid market status",
        "lastErrorEvent": null
      }     
    ]
  }
}
```

### POST  OrderBook

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/OrderBook
```

To get latest orderbook, for both cash and derivatives accounts.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td>Input the account to query. Accept both cash and derivatives accounts. </td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>uniqueID</td><td>string</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>filledQty</td><td>string</td><td></td></tr><tr><td>orderStatus</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>inputTime</td><td>string</td><td></td></tr><tr><td>modifiedTime</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>cancelQty</td><td>string</td><td></td></tr><tr><td>avgPrice</td><td>string</td><td></td></tr><tr><td>isForcesell</td><td>string</td><td></td></tr><tr><td>isShortsell</td><td>string</td><td></td></tr><tr><td>rejectReason</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "1184418"
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "1184418",
    "orders": [
      {
        "uniqueID": "73885549",
        "orderID": "T202306146w273885549",
        "buySell": "B",
        "price": 1000,
        "quantity": 100,
        "filledQty": 0,
        "orderStatus": "RJ",
        "marketID": "VNFE",
        "inputTime": "1686730747945",
        "modifiedTime": "1686730747945",
        "instrumentID": "VN30F2306",
        "orderType": "LO",
        "cancelQty": 0,
        "avgPrice": 0,
        "isForcesell": "F",
        "isShortsell": "F",
        "rejectReason": "Invalid market status"
      }     
    ]
  }
}
```

### GET  orderHistory

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/orderHistory
```

To get order history, for both cash and derivatives accounts.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>startDate</td><td>date</td><td>Yes</td><td>Format dd/mm/yyyy</td></tr><tr><td>endDate</td><td>date</td><td>Yes</td><td>Format dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>orderHistories</td><td>list</td><td></td></tr><tr><td>uniqueID</td><td>string</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td>Placed price</td></tr><tr><td>quantity</td><td>number</td><td>Placed quantity</td></tr><tr><td>filledQty</td><td>string</td><td></td></tr><tr><td>orderStatus</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>inputTime</td><td>string</td><td></td></tr><tr><td>modifiedTime</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>cancelQty</td><td>string</td><td></td></tr><tr><td>avgPrice</td><td>string</td><td></td></tr><tr><td>isForcesell</td><td>string</td><td></td></tr><tr><td>isShortsell</td><td>string</td><td></td></tr><tr><td>rejectReason</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "0901358",
startDate: “18/11/2020”,
endDate: “18/11/2020”
}
Output: 
{
    message: "Success",
    status: 200,
    data: {
        orderHistories: [
      {
                uniqueID: null,
                orderID: "12626539",
                buySell: "B",
                price: 800.0,
                quantity: 10,
                filledQty: 0,
                orderStatus: "RJ",
                marketID: "VNFE",
                inputTime: "1603157594668",
                modifiedTime: "1603157594668",
                instrumentID: "VN30F2012",
                orderType: "LO",
                cancelQty: 0,
                avgPrice: 0.0,
                isForcesell: null,
                isShortsell: null
            }
],
        account: "0901358"
    }
 }
```

### GET  cashAccountBalance

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/cashAcctBal
```

To get cash account's balance. &#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="218">Field</th><th width="130">Type</th><th>Describe</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>cashbal</td><td>number</td><td></td></tr><tr><td>cashonhold</td><td>number</td><td></td></tr><tr><td>secureamount</td><td>number</td><td>Secure amount intraday</td></tr><tr><td>withdrawable</td><td>number</td><td></td></tr><tr><td>receivingcasht1</td><td>number</td><td>Sell amount to receive on T1</td></tr><tr><td>receivingcasht2</td><td>number</td><td>Sell amount to receive on T2</td></tr><tr><td>matchedbuyvolume</td><td>number</td><td>Matched buy amount</td></tr><tr><td>matchedsellvolume</td><td>number</td><td>Matched sell amount</td></tr><tr><td>unmatchedbuyvolume</td><td>number</td><td>Unmatched buy amount</td></tr><tr><td>unmatchedsellvolume</td><td>number</td><td>Unmatched sell amount</td></tr><tr><td>paidcasht1</td><td>number</td><td>Buy amount to pay on T1</td></tr><tr><td>paidcasht2</td><td>number</td><td>Buy amount to pay T2</td></tr><tr><td>cia</td><td>number</td><td>cash advance amount</td></tr><tr><td>debt</td><td>number</td><td></td></tr><tr><td>purchasingpower</td><td>number</td><td></td></tr><tr><td>totalasset</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
    account: "0901351",
}
Output: 
{
message: "Success",
status: 200,
data: {
account: "0901351",
cashBal: 7459369481,
cashOnHold: 0,
secureAmount: 0,
withdrawable: 7459367581,
receivingCashT1: 0,
receivingCashT2: 0,
matchedBuyVolume: 0,
matchedSellVolume: 0,
debt: 1900,
unMatchedBuyVolume: 0,
unMatchedSellVolume: 864619337,
paidCashT1: 0,
paidCashT2: 0,
cia: 0,
purchasingPower: 7459367581,
totalAssets: 9726161481
       }
}
```

### GET  stockPosition

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/stockPosition
```

To query stock positions of cash accounts.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="116">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td>Input account number </td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="185">Field</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>totalMarketValue</td><td>number</td><td>= sum(maketprice * onhand)</td></tr><tr><td>stockPositions</td><td>list</td><td></td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Stock symbol</td></tr><tr><td>onHand</td><td>number</td><td>Total settled quantity in the account, which includes: sellable, hold, block, mortgage, sellT0, sellT1. Not include bonus, buyT0, buyT1</td></tr><tr><td>block</td><td>number</td><td>Blocked quantity</td></tr><tr><td>bonus</td><td>number</td><td>Dividend and bonus quantity</td></tr><tr><td>buyT0</td><td>number</td><td>Buy quantity matched on T0</td></tr><tr><td>buyT1</td><td>number</td><td>Buy quantity settled on T1</td></tr><tr><td>buyT2</td><td>number</td><td>Buy quantity settled on T2</td></tr><tr><td>sellT0</td><td>number</td><td>Sell quantity matched on T0</td></tr><tr><td>sellT1</td><td>number</td><td>Sel quantity settled on T1</td></tr><tr><td>sellT2</td><td>number</td><td>Sell quantity settled on T2</td></tr><tr><td>avgPrice</td><td>number</td><td>Average cost price</td></tr><tr><td>mortgage</td><td>number</td><td>Mortgage quantity </td></tr><tr><td>holdForTrade</td><td>number</td><td>Quantity restricted from trading</td></tr><tr><td>marketPrice</td><td>number</td><td>Market price of the stock</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "0901351",
}
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0001011",
    "totalMarketValue": 0,
    "stockPositions": [
      {
        "marketID": "VN",
        "instrumentID": "AMC",
        "onHand": 300,
        "block": 0,
        "bonus": 3819,
        "buyT0": 0,
        "buyT1": 0,
        "buyT2": 0,
        "sellT0": 0,
        "sellT1": 0,
        "sellT2": 0,
        "avgPrice": 1529,
        "mortgage": 0,
        "sellableQty": 300,
        "holdForTrade": 0,
        "marketPrice": 0
      }
    ]
  }
}
```

### GET  derivativeAccountBalance

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/derivAcctBal
```

To get derivatives account's balance.&#x20;

**Sample**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="140">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="177">Field</th><th width="132">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>accountbalance</td><td>number</td><td></td></tr><tr><td>fee</td><td>number</td><td></td></tr><tr><td>commission</td><td>number</td><td></td></tr><tr><td>interest</td><td>number</td><td></td></tr><tr><td>Loan</td><td>number</td><td></td></tr><tr><td>deliveryamount</td><td>number</td><td></td></tr><tr><td>floatingpl</td><td>number</td><td></td></tr><tr><td>totalpl</td><td>number</td><td></td></tr><tr><td>marginable</td><td>number</td><td></td></tr><tr><td>depositable</td><td>number</td><td></td></tr><tr><td>rccall</td><td>number</td><td></td></tr><tr><td>withdrawable</td><td>number</td><td></td></tr><tr><td>noncashdrawablerccall</td><td>number</td><td></td></tr><tr><td>internalassets</td><td>list</td><td><p>Assets in SSI:</p><ul><li>Cash</li><li>Validnoncash</li><li>totalvalue:</li><li>maxvalidnoncash</li><li>cashwithdrawable</li><li>Ee</li></ul></td></tr><tr><td>exchangeassets</td><td>list</td><td><p>Assets at VSD:</p><ul><li>Cash</li><li>Validnoncash</li><li>totalvalue:</li><li>maxvalidnoncash</li><li>cashwithdrawable</li><li>Ee</li></ul></td></tr><tr><td>internalmargin</td><td>list</td><td><p>SSI margin requirements:</p><ul><li>initialmargin</li><li>deliverymargin</li><li>marginreq</li><li>accountratio</li><li>usedlimitwarninglevel1</li><li>usedlimitwarninglevel2</li><li>usedlimitwarninglevel3</li><li>margincall</li></ul></td></tr><tr><td>exchangemargin</td><td>list</td><td><p>VSD margin requirement: </p><ul><li>marginreq</li><li>accountratio</li><li>usedlimitwarninglevel1</li><li>usedlimitwarninglevel2</li><li>usedlimitwarninglevel3</li><li>margincall</li></ul></td></tr><tr><td>nav</td><td>number</td><td>Net assert value</td></tr><tr><td>origMarginRatio</td><td>number</td><td>Original margin ratio</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
    account: "0901358",
}
Output: 
{
message: "Success",
status: 200,
data: {
account: "0901358",
accountBalance: 11166309263,
fee: 0,
commission: 0,
interest: 1514965,
loan: 0,
deliveryAmount: 0,
floatingPL: 0,
totalPL: 0,
marginable: 0,
depositable: 1148597520,
rcCall: 0,
withdrawable: 10912447363,
nonCashDrawableRCCall: 0,
internalAssets: {
cash: 1165730020,
validNonCash: 0,
totalValue: 11166309263,
maxValidNonCash: 0,
cashWithdrawable: 1148597520,
ee: 8197059272
        },
exchangeAssets: {
cash: 10000579243,
validNonCash: 0,
totalValue: 10000579243,
maxValidNonCash: 0,
cashWithdrawable: 9763849843,
ee: 7322887382
         },
        internalMargin: {
initialMargin: 172660800,
deliveryMargin: 0,
marginReq: 172660800,
accountRatio: 1.5462656096416592,
usedLimitWarningLevel1: 75,
usedLimitWarningLevel2: 85,
usedLimitWarningLevel3: 90,
marginCall: 0
        },
      exchangeMargin: {
marginReq: 172660800,
accountRatio: 1.7265079932330476,
usedLimitWarningLevel1: 75,
usedLimitWarningLevel2: 85,
usedLimitWarningLevel3: 90,
marginCall: 0
        }
     }
}
```

### GET  derivativePosition

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/derivPosition
```

To get dervatives account's position. After getting the snapshot, you can subscribed streaming to get realtime update.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="164">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>querySummary</td><td>boolean</td><td>Yes</td><td><ul><li>True: Netoff position</li><li>False: don't netoff position</li></ul></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="163">Field</th><th width="122">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td> </td></tr><tr><td>status</td><td>number</td><td> </td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td> </td></tr><tr><td><strong>openPositions</strong></td><td>list</td><td></td></tr><tr><td><strong>closePositions</strong></td><td>list</td><td> </td></tr><tr><td>marketID</td><td>string</td><td> </td></tr><tr><td>instrumentID</td><td>string</td><td> </td></tr><tr><td>longQty</td><td>number</td><td> </td></tr><tr><td>shortQty</td><td>number</td><td> </td></tr><tr><td>net</td><td>number</td><td> </td></tr><tr><td>bidAvgPrice</td><td>number</td><td> </td></tr><tr><td>askAvgPrice</td><td>number</td><td> </td></tr><tr><td>tradePrice</td><td>number</td><td> </td></tr><tr><td>marketPrice</td><td>number</td><td> </td></tr><tr><td>floatingPL</td><td>number</td><td> </td></tr><tr><td>tradingPL</td><td>number</td><td> </td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "0901358",
querySummary: true
}
Output: 
{
message: "Success",
status: 200,
data: {
       account: "0901358",
       openPosition: [
       {
           marketID: "VNFE",
           instrumentID: "VN30F2106",
           longQty: 8,
           shortQty: 0,
           net: 8,
           bidAvgPrice: 0,
           askAvgPrice: 0,
           tradePrice: 1452.7,
           marketPrice: 1452.7,
           floatingPL: 0,
           tradingPL: 0
          }   ],
        closePosition: [ ]
    }
}
```

### GET  maxBuyQty

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/maxBuyQty
```

To get max buy quantity. Applied for both cash and derivatives accounts.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="183">Field</th><th width="124">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td> </td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>maxbuyqty</td><td>number</td><td></td></tr><tr><td>marginRatio</td><td>number</td><td></td></tr><tr><td>purchasingPower</td><td>number</td><td></td></tr><tr><td>origMarginRatio</td><td>number</td><td>Original margin ratio</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "0041691",
instrumentD: “SSI”,
price:17
}
Output: 
{
    message: "Success",
    status: 200,
    data: {
        account: "0041691",
        maxBuyQty: 8241440,
        marginRatio: "50%",
        purchasingPower: 99292902171
    }
}
```

### GET  maxSellQty

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/maxSellQty
```

To get max sell quantity. Applied for both cash and derivatives accounts.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="153">Field</th><th width="118">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td> </td></tr><tr><td>status</td><td>number</td><td> </td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td> </td></tr><tr><td>maxSellQty</td><td>number</td><td> </td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
{
account: "0041691",
intrumentID: “SSI”
}
Output: 
{
    "message": "Success",
    "status": 200,
    "data": {
        "account": "0041691",
        "maxSellQty": 2000
    }
}
```

### POST  NewOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/NewOrder
```

To place orders.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>instrumentID</td><td>string</td><td>Yes</td><td> </td></tr><tr><td>market</td><td>string</td><td>Yes</td><td><p>VN: cash market</p><p>VNFE: derivatives market</p></td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td><p>buy (B): mua/Sell (S): bán đã đặt theo orderID của lệnh</p><p>B: Buy</p><p>S: Sell</p></td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td><a href="/pages/OBYYgsg68pin0RgfCB12">Loại lệnh</a></td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td><a href="/pages/RAXmaMSU8xIdzqJ9uKmd">Kênh đặt lệnh </a><br>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td><p>Giá đặt lệnh: </p><p>- Nếu loại lệnh là LO -> Giá đặt > 0</p><p>- Nếu loại lệnh khác LO -> Giá đặt = 0</p></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td>ID đặt lệnh trong ngày. Bắt buộc 8 số random</td></tr><tr><td>stopOrder</td><td>string</td><td>Yes</td><td><ul><li>True: conditional orders. Only applied for derivatives market. </li><li>False: normal orders</li></ul></td></tr><tr><td>stopPrice</td><td>number</td><td>Yes</td><td>If stopOrder = true -> stopPrice > 0</td></tr><tr><td>stopType</td><td>string</td><td>Yes</td><td><p>Required if stopType = true: </p><ul><li>D: Down</li><li>U: Up</li><li>V: Trailling Up</li><li>E: Trailing Down</li><li>O: OCO</li><li>B: BullBear</li></ul></td></tr><tr><td>stopStep</td><td>number</td><td>Yes</td><td>Stop loss amount, only applied for BullBear (stopType = B)</td></tr><tr><td>profitStep</td><td>number</td><td>Yes</td><td>Take profit amount, only applied for BullBear (stopType = B)</td></tr><tr><td>code</td><td>number</td><td>No</td><td>Authentication code: PIN/OTP (depending on your registered authentication type)</td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td><a href="/pages/svktO3iygb898Mrgt1y2">Device ID</a></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td><p><br>Market code:</p><p>VN: cash market</p><p>VNFE: derivative market</p></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td><p>Order type: </p><ul><li>Order type = True: it is a conditional order (only applicable to Derivatives)</li><li>Order type = False: it is a normal order</li></ul></td></tr><tr><td>channelID</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td>stopOrder</td><td>string</td><td></td></tr><tr><td>stopPrice</td><td>number</td><td></td></tr><tr><td>stopType</td><td>string</td><td></td></tr><tr><td>stopStep</td><td>number</td><td></td></tr><tr><td>profitStep</td><td>number</td><td></td></tr><tr><td>forceSell</td><td>boolean</td><td>Force sell order</td></tr><tr><td>modifiable</td><td>boolean</td><td>Can edit/modify order </td></tr><tr><td>note</td><td>string</td><td>Order note</td></tr><tr><td>brokerID</td><td>string</td><td>Broker ID</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successful request: &#x20;

```json
Input: 
{ 
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "LO",
channelID: "TA",
price: 21000,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678195",
code: “123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
 }
 Output: 
 {
message: "Success",
status: 200,
data: {
requestID: "1678195",
requestData: 
{
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "LO",
channelID: "TA",
price: 21000,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
}
    }
}
```

* Error request:&#x20;

```json
Input: 
{  
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "ATO",
channelID: "TA",
price: 21000,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678195",
code: “123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
 }
Output: 
 {
    message: "Price is null or equal zero when order is market order",
    status: 400,
    data: null
}
```

### POST  ModifyOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/ModifyOrder
```

To amend an order.

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>orderID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td>instrument of the amended order</td></tr><tr><td>marketID</td><td>string</td><td>Yes</td><td><p>VN: cash market</p><p>VNFE: derivatives market</p></td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td>side of the amended order</td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td><a href="/pages/OBYYgsg68pin0RgfCB12">Order type</a> </td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td>New price</td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td>New quantity</td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td>Unique id of the request generated by client. Required 8 digits. </td></tr><tr><td>code</td><td>number</td><td>No</td><td></td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>market</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>note</td><td>string</td><td>order note</td></tr><tr><td>brokerId</td><td>string</td><td>broker ID</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successful request:&#x20;

```json
Input: 
{
requestID: "93235974",
orderID: "12658867",
price: 1410,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
message: "Success",
status: 200,
data: {
   requestID: "93235974",
   requestData: {
         orderID: "12658867",
         price: 1410,
         quantity: 2,
         account: "0901358",
         instrumentID: "VN30F2106",
         marketID: "VNFE",
         buySell: "B",
         orderType: "LO"
      }
  }
}
```

* Error request:&#x20;

```json
Input: 
{
requestID: "93235971",
orderID: "",
price: 1410,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
data: null,
message: "’Order ID’ must not be empty ",
status: 400
}

```

### POST  CancelOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/CancelOrder
```

To cancel an order.

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>orderID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>market</td><td>string</td><td>Yes</td><td></td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td></td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td></td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>code</td><td>number</td><td>No</td><td></td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td> </td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>account</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successful request:&#x20;

```json
Input: 
{
requestID: "93235974",
orderID: "12658867",
price: 1410,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
message: "Success",
status: 200,
data: {
   requestID: "93235974",
   requestData: {
         orderID: "12658867",
         price: 1410,
         quantity: 2,
         account: "0901358",
         instrumentID: "VN30F2106",
         marketID: "VNFE",
         buySell: "B",
         orderType: "LO"
      }
  }
}
```

* Error request:&#x20;

```json
Input: 
{
requestID: "93235971",
orderID: "",
price: 1410,
quantity: 2,
account: "0901358",
instrumentID: "VN30F2106",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
data: null,
message: "’Order ID’ must not be empty ",
status: 400
}

```

### POST  derNewOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/derNewOrder
```

To place derivatives orders.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>market</td><td>string</td><td>Yes</td><td>VNFE: derivatives market</td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td><p>B: Buy</p><p>S: Sell</p></td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td><a href="/pages/OBYYgsg68pin0RgfCB12">Order type </a></td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td><a href="/pages/RAXmaMSU8xIdzqJ9uKmd">Order channel</a> <br>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>stopOrder</td><td>string</td><td>Yes</td><td><ul><li>True: conditional order, applied to derivatives market only.  </li><li>False: normal order</li></ul></td></tr><tr><td>stopPrice</td><td>number</td><td>Yes</td><td>If stopOrder = true -> stopPrice > 0</td></tr><tr><td>stopType</td><td>string</td><td>Yes</td><td><p>Required if stopType = true:</p><ul><li>D: Down</li><li>U: Up</li><li>V: Trailling Up</li><li>E: Trailing Down</li><li>O: OCO</li><li>B: BullBear</li></ul></td></tr><tr><td>stopStep</td><td>number</td><td>Yes</td><td>only applied for BullBear (stopType = B)</td></tr><tr><td>profitStep</td><td>number</td><td>Yes</td><td>Only applied for BullBear (stopType = B)</td></tr><tr><td>code</td><td>number</td><td>No</td><td></td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td><a href="/pages/svktO3iygb898Mrgt1y2">Device ID </a></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>marketID</td><td>string</td><td><p>Market ID:</p><p>VN: Cash market</p><p>VNFE: Derivative market</p></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>channelID</td><td>string</td><td><br></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td>stopOrder</td><td>string</td><td></td></tr><tr><td>stopPrice</td><td>number</td><td></td></tr><tr><td>stopType</td><td>string</td><td></td></tr><tr><td>stopStep</td><td>number</td><td></td></tr><tr><td>profitStep</td><td>number</td><td></td></tr><tr><td>forceSell</td><td>boolean</td><td>force sell order?</td></tr><tr><td>modifiable</td><td>boolean</td><td>can order be modified</td></tr><tr><td>note</td><td>string</td><td>order note</td></tr><tr><td>brokerID</td><td>string</td><td>broker ID</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successful request:&#x20;

```json
Input: 
{  
instrumentID: "VN30F2306",
market: "VNFE",
buySell: "B",
orderType: "LO",
channelID: "TA",
price: 1200,
quantity: 10,
account: "1184418",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678198",
code: “123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading"
 }
 Output: 
 {
  "message": "Success",
  "status": 200,
  "data": {
    "requestID": "3407154",
    "requestData": {
      "instrumentID": "VN30F2306",
      "market": "VNFE",
      "buySell": "B",
      "orderType": "LO",
      "channelID": "TA",
      "price": 1200,
      "quantity": 100,
      "account": "1184418",
      "stopOrder": false,
      "stopPrice": 0,
      "stopType": "",
      "stopStep": 0,
      "lossStep": 0,
      "profitStep": 0
    }
  }
}
```

* Error request:

```json
Input: 
{  
instrumentID: "SSI",
market: "VN",
buySell: "B",
orderType: "ATO",
channelID: "TA",
price: 21000,
quantity: 300,
account: "0901351",
stopOrder: false,
stopPrice: 0,
stopType: "string",
stopStep: 0,
lossStep: 0,
profitStep: 0
requestID: "1678195",
code: “123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
 }
 Output: 
{
    message: "Price is null or equal zero when order is market order",
    status: 400,
    data: null
}
```

### POST  derModifyOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/derModifyOrder
```

To amend a derivatives order.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>orderID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>marketID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td></td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td></td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td><a href="/pages/RAXmaMSU8xIdzqJ9uKmd">Order channel</a><br>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td>uniqueid of the request</td></tr><tr><td>code</td><td>number</td><td>No</td><td>Authentication code: PIN, OTP (depending your registered authentication type)</td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>requestID</td><td>string</td><td></td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>market</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>orderID</td><td>string</td><td></td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>note</td><td>string</td><td>Order note</td></tr><tr><td>brokerId</td><td>string</td><td>Broker ID</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successful request: &#x20;

```json
Input: 
{
requestID: "93235974",
orderID: "12658867",
price: 1410,
quantity: 3,
account: "1184418",
instrumentID: "VN30F2306",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
message: "Success",
status: 200,
data: {
   requestID: "93235974",
   requestData: {
         orderID: "12658867",
         price: 1410,
         quantity: 3,
         account: "1184418",
         instrumentID: "VN30F2306",
         marketID: "VNFE",
         buySell: "B",
         orderType: "LO"
      }
  }
}
```

* Error request:&#x20;

```json
Input: 
{
requestID: "93235974",
orderID: "",
price: 1410,
quantity: 3,
account: "1184418",
instrumentID: "VN30F2306",
marketID: "VNFE",
buySell: "B",
orderType: "LO"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
data: null,
message: "’Order ID’ must not be empty ",
status: 400
}

```

### POST  derCancelOrder

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/derCancelOrder
```

To cancel a derivatives order.&#x20;

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>orderID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>market</td><td>string</td><td>Yes</td><td>VNFE</td></tr><tr><td>buySell</td><td>string</td><td>Yes</td><td></td></tr><tr><td>orderType</td><td>string</td><td>Yes</td><td></td></tr><tr><td>channelID</td><td>string</td><td>Yes</td><td>Only support value "TA" (FCTrading API)</td></tr><tr><td>price</td><td>number</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>requestID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>code</td><td>number</td><td>No</td><td>Authentication code: PIN/OTP depending on your registered authentication type</td></tr><tr><td>deviceID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>userAgent</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="161">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td> </td></tr><tr><td>status</td><td>number</td><td> </td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td><strong>requestData</strong></td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td> </td></tr><tr><td>marketID</td><td>string</td><td></td></tr><tr><td>buySell</td><td>string</td><td></td></tr><tr><td>orderType</td><td>string</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>orderID</td><td>string</td><td>ID of the going-to-cancel order</td></tr><tr><td>account</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successfull request: &#x20;

```json
Input: 
{
orderID: "12658867",
account: "1184418",
marketID: "VNFE",
instrumentID: "VN30F2306",
buySell: "B",
requestID: "52513603"
code:”123456789”,
      deviceID: "MAC Address",
      userAgent: “FCTrading”
}
Output: 
{
message: "Success",
status: 200,
data: {
    requestID: "52513603",
    requestData: {
         orderID: "12658867",
         account: "1184418",
         marketID: "VNFE",
         instrumentID: "VN30F2106",
         buySell: "B",
         requestID: "52513603"
       }
    }
}
```

* Error request:&#x20;

```json
Input: 
{
orderID: " ",
account: "0901358",
marketID: "VNFE",
instrumentID: "VN30F2106",
buySell: "B",
requestID: "52513603"
code:”123456789”,
deviceID: "MAC Address",
userAgent: “FCTrading”
}
Output: 
{
message: "’Order ID' must not be empty.",
status: 400,
data: null
}
```

### GET  rateLimit

```
https://fc-tradeapi.ssi.com.vn/api/v2/Trading/rateLimit
```

Get rate Limit

**Details**

{% tabs %}
{% tab title="Output" %}

<table><thead><tr><th width="125">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>endpoint</td><td>string</td><td>The set rateLimit information includes one of the following cases:<br>* -> All APIs <br>post:* -> API method POST<br>get:* -> API method GET<br>*:*/api_name -> rateLimit API name</td></tr><tr><td>period</td><td>string</td><td>format: s,m,h,d</td></tr><tr><td>limit</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Output: 
{
  "message": "Success",
  "status": 200,
  "data": [
    {
      "endpoint": "*",
      "period": "1s",
      "limit": 5
    },
    {
      "endpoint": "*",
      "period": "5s",
      "limit": 30
    }
  ]
}
```

## Cash

### GET  cashInAdvanceAmount

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/cashInAdvanceAmount
```

Query cash in advance available amount

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="121">Field</th><th width="98">Type</th><th width="115">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="186">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>ciaAmounts</strong></td><td>list</td><td></td></tr><tr><td>dueDate</td><td>string</td><td>Format: dd/mm/yyyy</td></tr><tr><td>sellValue</td><td>number</td><td></td></tr><tr><td>netSellValue</td><td>number</td><td></td></tr><tr><td>advance</td><td>number</td><td></td></tr><tr><td>cashAdvance</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**:

```json
Input: 
{
  account: "8888881"
}
Output: 
{
    "message": "Success",
    "status": 200,
    "data": {
        "account": "8888881",
        "ciaAmounts": [
            {
                "dueDate": "08/03/2023",
                "sellValue": 3000000.0,
                "netSellValue": 0.0,
                "advance": 0.0,
                "cashAdvance": 0.0
            }
        ]
    }
}
```

### GET  unsettleSoldTransaction

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/unsettleSoldTransaction
```

Query unsettle sold transactions

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="139">Field</th><th width="98">Type</th><th width="130">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>settleDate</td><td>string</td><td>No</td><td>Format: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="264">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>unsettledSoldTransactions</strong></td><td>list</td><td></td></tr><tr><td>tradeDate</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>netSellValue</td><td>number</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>price</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Input: 
{
  account: "8888881",
  settleDate: "10/03/2023"
}
Output: 
{
    "message": "Success",
    "status": 200,
    "data": {
        "account": "8888881",
        "unsettledSoldTransactions": [
            {
                "tradeDate": "08/03/2023",
                "instrumentID": "SSI",
                "quantity": 100,
                "price": 0.0,
                "netSellValue": 1990000.0
            },
            {
                "tradeDate": "08/03/2023",
                "instrumentID": "SSI",
                "quantity": 100,
                "price": 0.0,
                "netSellValue": 1990000.0
            },
            {
                "tradeDate": "08/03/2023",
                "instrumentID": "SSI",
                "quantity": 100,
                "price": 0.0,
                "netSellValue": 117410.0
            }
        ]
    }
}
```

### GET  transferHistories

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/transferHistories
```

Query cash transfer histories

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="122">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>fromDate</td><td>string</td><td>Yes</td><td>format: dd/mm/yyyy</td></tr><tr><td>toDate</td><td>string</td><td>Yes</td><td>format: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Dữ liệu</th><th width="98">Kiểu</th><th>Mô tả</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Mô tả msg call API</td></tr><tr><td>status</td><td>number</td><td>Trạng thái </td></tr><tr><td><strong>data</strong></td><td>list</td><td>Thông tn dữ liệu trả ra</td></tr><tr><td><strong>transferHistories</strong></td><td>list</td><td>Danh sách lịch sử chuyển tiền và Nộp/Rút ký quỹ</td></tr><tr><td>transactionID</td><td>string</td><td>Mã chi nhánh ngân hàng</td></tr><tr><td>date</td><td>string</td><td>Ngày thực hiện giao dịch</td></tr><tr><td>account</td><td>string</td><td>Số tài khoản chuyển</td></tr><tr><td>beneficiaryAccount</td><td>string</td><td>Số tài khoản nhận</td></tr><tr><td>amount</td><td>number</td><td>Số tiền</td></tr><tr><td>bankName</td><td>string</td><td>Ngân hàng nhận</td></tr><tr><td>bankBranchName</td><td>string</td><td>Chi nhánh ngân hàng nhận </td></tr><tr><td>beneficiary</td><td>string</td><td>Tên người nhận</td></tr><tr><td>remark</td><td>string</td><td>Nội dung</td></tr><tr><td>type</td><td>string</td><td>Loại giao dịch (Nộp/ Rút)</td></tr><tr><td>status</td><td>string</td><td>Trạng thái chuyển</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Input: 
account:8888881
fromDate: 10/01/2023
toDate: 10/08/2023
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "transferHistories": [
      {
        "transactionID": "101660519",
        "date": "07/03/2023 11:54:22",
        "account": "8888881",
        "beneficiaryAccount": "8888886",
        "amount": 1000000,
        "bankName": "TECHCOMBANK_NH KỸ THƯƠNG",
        "bankBranchName": "CN THANG LONG",
        "beneficiary": "TK tự doanh CK niêm yết (TK 8)",
        "remark": "Huyen test chuyen tien sang 6",
        "type": "W",
        "status": "A"
      }
    ]
  }
}
```

### GET  cashInAdvanceHistories

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/cashInAdvanceHistories
```

Query cash in advance histories

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="143">Field</th><th width="98">Type</th><th width="131">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>fromDate</td><td>string</td><td>Yes</td><td>Format: dd/mm/yyyy</td></tr><tr><td>toDate</td><td>string</td><td>Yes</td><td>Format: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Dữ liệu</th><th width="98">Kiểu</th><th>Mô tả</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>ciaHistories</strong></td><td>list</td><td></td></tr><tr><td>transactionID</td><td>string</td><td></td></tr><tr><td>date</td><td>string</td><td></td></tr><tr><td>totalAmount</td><td>number</td><td></td></tr><tr><td>status</td><td>string</td><td></td></tr><tr><td><strong>detai</strong></td><td>list</td><td></td></tr><tr><td>type</td><td>string</td><td>I: Fee and D &#x26; W: ciaAmount</td></tr><tr><td>value</td><td>number</td><td></td></tr><tr><td>settleDate</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:**&#x20;

* fromDate - toDate not more than 1 month
* The time for searching the past should not exceed 6 months
  {% endhint %}

**Sample:**

```json
Input: 
account:0001011
fromDate: 10/01/2023
toDate: 10/08/2023
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0001011",
    "ciaHistories": [
      {
        "transactionID": "20230731-45895",
        "dateTime": "31/07/2023 09:01:56",
        "totalAmount": 200000,
        "details": [
          {
            "type": "D",
            "value": 200000,
            "settleDate": null
          },
          {
            "type": "I",
            "value": 50000,
            "settleDate": null
          },
          {
            "type": "W",
            "value": 200000,
            "settleDate": "01/08/2023"
          }
        ],
        "status": "A"
      }
        ],
        "status": "A"
      }
    ]
  }
}
```

### GET  estCashInAdvanceFee

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/estCashInAdvanceFee
```

Query estimate cash in advance fee

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="164">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>ciaAmount</td><td>string</td><td>No</td><td></td></tr><tr><td>receiveAmount</td><td>string</td><td>No</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>ciaAmount</td><td>number</td><td></td></tr><tr><td>receiveAmount</td><td>number</td><td></td></tr><tr><td>fee</td><td>number</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Input: 
account:0001011
ciaAmount: 50000
Output:
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0001011",
    "ciaAmount": 0,
    "receiveAmount": 0,
    "fee": 0
  }
}
```

### POST  vsdCashDW

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/vsdCashDW
```

Tranfer cash with VSD (only support for derivatives account)

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="151">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>amount</td><td>number</td><td>Yes</td><td></td></tr><tr><td>type</td><td>string</td><td>Yes</td><td><p>Include:</p><p>W = withdraw</p><p>D = deposit</p></td></tr><tr><td>remark</td><td>string</td><td>No</td><td></td></tr><tr><td>code</td><td>string</td><td>No</td><td>isSave = false -> Required PIN/ OTP <br>isSave = true -> no required</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Dữ liệu</th><th width="98">Kiểu</th><th>Mô tả</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Mô tả msg call API</td></tr><tr><td>status</td><td>number</td><td>Trạng thái </td></tr><tr><td><strong>data</strong></td><td>list</td><td>Thông tn dữ liệu trả ra</td></tr><tr><td>transactionID</td><td>string</td><td>Số hiệu giao dịch</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

* Successfull request:&#x20;

```json
Input: 
{
  "account": "0901358",
  "amount": 50000,
  "type": "D",
  "remark": "string",
  "code": "string"
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "transactionID": "579108"
  }
}
```

* Error request:&#x20;

```json
Input: 
{
  "account": "0901351",
  "amount": 50000,
  "type": "D",
  "remark": "string",
  "code":"string"
}
Output: 
{
  "message": "Not support cash transfer with vsd for stock account",
  "status": 400,
  "data": null
}
```

### POST  transferInternal

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/transferInternal
```

Transfer cash inside

{% hint style="info" %}
**Note:**&#x20;

The source account number and the receiving account number must have the same name and money can only be transferred between sub-accounts&#x20;
{% endhint %}

**Thông tin chi tiết**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="202">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>beneficiaryAccount</td><td>string</td><td>Yes</td><td></td></tr><tr><td>amount</td><td>number</td><td>Yes</td><td></td></tr><tr><td>remark</td><td>string</td><td>No</td><td></td></tr><tr><td>code</td><td>string</td><td>No</td><td>isSave = false -> Required PIN/ OTP <br>isSave = true -> no required</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>transactionID</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Ví dụ**

* Successfull request: &#x20;

```json
Input: 
{
  "account": "0901351",
  "beneficiaryAccount": "0901356",
  "amount": 50000,
  "remark": "string", 
  "code":"string"
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "transactionID": "101844165"
  }
}
```

* Error request:&#x20;

```json
Input: 
{
  "account": "0901351",
  "beneficiaryAccount": "0901356",
  "amount": 50000,
  "remark": "string",
  "code":"string"
}
Output: 
{
  "message": "Account 0901352 is not exist",
  "status": 400,
  "data": null
}
```

### POST  createCashInAdvance

```
https://fc-tradeapi.ssi.com.vn/api/v2/cash/createCashInAdvance
```

Create cash in advance transaction

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>ciaAmount</td><td>string</td><td>No</td><td></td></tr><tr><td>receiveAmount</td><td>string</td><td>No</td><td></td></tr><tr><td>code</td><td>string</td><td>Yes</td><td>OTP/PIN </td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>transactionID</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successfull request:&#x20;

```json
Input: 
{
  "account": "8888881",
  "ciaAmount": 50000,
  "code": 1234567
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "1158851",
    "transactionID": "20230824-46286"
  }
}
```

* Error request:

```json
Input: 
{
  "account": "8888881",
  "ciaAmount": 50000, 
  "code":1234567
}
Output: 
{
  "message": "Not support derivatives account",
  "status": 400,
  "data": null
}
```

### Online Right Subscription

### GET  dividend

```
https://fc-tradeapi.ssi.com.vn/api/v2/ors/dividend
```

Get history dividend

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="231">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>dividends</strong></td><td>list</td><td></td></tr><tr><td>stockDividend</td><td>string</td><td><p>Include:</p><p>- STOCK DIVIDEND</p><p>- CASH DIVIDEND</p><p>- BONUS ISSUE</p><p>- EXERCISE CW </p><p>- EXERCISE RIGHTS</p></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>executedRate</td><td>string</td><td></td></tr><tr><td>closeDate</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>paidDate</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>amount</td><td>number</td><td></td></tr><tr><td>status</td><td>string</td><td></td></tr><tr><td>receivedQuantity</td><td>number</td><td></td></tr><tr><td>issueInstrument</td><td>string</td><td></td></tr><tr><td>distributedFlag</td><td>string</td><td></td></tr><tr><td>payableDate</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>subscriptionPrice</td><td>number</td><td></td></tr><tr><td>subscriptionAmount</td><td>number</td><td></td></tr><tr><td>subscriptionQuantity</td><td>number</td><td></td></tr><tr><td>subscriptionPeriodFrom</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>subscriptionPeriodTo</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>entitlementID</td><td>string</td><td></td></tr><tr><td>exchangeID</td><td>string</td><td>Exchange ID (HOSE/HNX/UPCOM)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

```json
Input: 
account: 0901351
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "dividends": [
      {
        "stockDividend": "STOCK DIVIDEND",
        "instrumentID": "SSI",
        "quantity": 49500,
        "executedRate": "100:15",
        "closeDate": "05/10/2020",
        "paidDate": "07/10/2020",
        "amount": 0,
        "status": "A",
        "receivedQuantity": 7425,
        "issueInstrument": "SSI",
        "distributedFlag": "N",
        "payableDate": null,
        "subscriptionPrice": 0,
        "subscriptionAmount": 0,
        "subscriptionQuantity": 0,
        "subscriptionPeriodFrom": null,
        "subscriptionPeriodTo": null,
        "entitlementID": null
      }
      ]
  }
}
```

### GET  exercisableQuantity

```
https://fc-tradeapi.ssi.com.vn/api/v2/ors/exercisableQuantity
```

Query stock quantity can register subscription

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="267">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>exercisableQuantities</strong></td><td>list</td><td></td></tr><tr><td>entitlementID</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>subscriptionPrice</td><td>number</td><td></td></tr><tr><td>executedRateFrom</td><td>number</td><td></td></tr><tr><td>subscriptionPeriodFrom</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>subscriptionPeriodTo</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>exerciseableQuantity</td><td>number</td><td></td></tr><tr><td>exerciseableReceiveQuantity</td><td>number</td><td></td></tr><tr><td>exercisedReceiveQuantity</td><td>number</td><td></td></tr><tr><td>executedRateTo</td><td>number</td><td>format: dd/mm/yyyy</td></tr><tr><td>exercisedQuantity</td><td>number</td><td></td></tr><tr><td>payableDate</td><td>string</td><td>format: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Input: 
account: 0901351
Output:
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "exercisableQuantities": [
      {
        "entitlementID": "913279",
        "instrumentID": "HCB",
        "subscriptionPrice": 10000,
        "executedRateFrom": 1,
        "subscriptionPeriodFrom": "03/10/2022",
        "subscriptionPeriodTo": "03/10/2023",
        "exerciseableQuantity": 0,
        "exerciseableReceiveQuantity": 0,
        "exercisedReceiveQuantity": 0,
        "executedRateTo": 1,
        "exercisedQuantity": 0,
        "payableDate": null
      }
      ]
  }
}
```

### GET  histories

```
https://fc-tradeapi.ssi.com.vn/api/v2/ors/histories
```

Get histories

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td>Số tài khoản nguồn truy vấn</td></tr><tr><td>startDate</td><td>string</td><td>Yes</td><td>Ngày bắt đầu tìm kiếm <br>Định dạng: dd/mm/yyyy</td></tr><tr><td>endDate</td><td>string</td><td>Yes</td><td>Ngày kết thúc tìm kiếm<br>Định dạng: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="313">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>onlineRightSubscriptionHistories</strong></td><td>list</td><td></td></tr><tr><td>transactionID</td><td>string</td><td></td></tr><tr><td>dateTime</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>ratioFrom</td><td>number</td><td></td></tr><tr><td>subscriptionPrice</td><td>number</td><td></td></tr><tr><td>subscriptionPeriodFrom</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>subscriptionPeriodTo</td><td>string</td><td>format: dd/mm/yyyy</td></tr><tr><td>exercisedReceivedQty</td><td>number</td><td></td></tr><tr><td>amount</td><td>number</td><td></td></tr><tr><td>status</td><td>string</td><td></td></tr><tr><td>ratioTo</td><td>number</td><td></td></tr><tr><td>underlyingInstrumentID</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:**&#x20;

* fromDate - toDate not more than 1 month
* The time for searching the past should not exceed 1 year
  {% endhint %}

**Sample**

```json
Input: 
account: 1158851
startDate: 10/07/2023
endDate: 10/07/2023
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "1158851",
    "onlineRightSubscriptionHistories": []
  }
}
```

### POST  create

```
https://fc-tradeapi.ssi.com.vn/api/v2/ors/create
```

Create online right subscription

**Thông tin chi tiết**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>entitlementID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>amount</td><td>number</td><td>Yes</td><td></td></tr><tr><td>code</td><td>string</td><td>No</td><td>PIN/ OTP</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td>transactionID</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample**

* Successfull request: &#x20;

```json
Input: 
{  
   "account": "0901351",  
   "instrumentID": "SSI",  
   "entitlementID": "913312",  
   "quantity": 100,  
   "amount": 1000,
   "code":"string" 
 }
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "transactionID": "17509268"
  }
}
```

* Error request:

```json
Input: 
{  
   "account": "0901351",  
   "instrumentID": "VND",  
   "entitlementID": "913312",  
   "quantity": 100,  
   "amount": 1000,
   "code":"string"  
 }
Output: 
{
  "message": "Invalid ammount (max amount 1,459,882)",
  "status": 40006,
  "data": null
}
```

## Stock

### GET  transferable

```
https://fc-tradeapi.ssi.com.vn/api/v2/stock/transferable
```

Get stock transferable

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="207">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>transferableStocks</strong></td><td>list</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>instrumentType</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

```json
Input: 
account: 0901351
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "transferableStocks": [
      {
        "instrumentID": "ACB",
        "quantity": 100,
        "instrumentType": "EQ"
      },
      {
        "instrumentID": "BTS",
        "quantity": 300,
        "instrumentType": "EQ"
      }
    ]
  }
}
```

### GET  transferHistories

<pre><code><strong>https://fc-tradeapi.ssi.com.vn/api/v2/stock/transferHistories
</strong></code></pre>

Get stock transfer history

**Details**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="193">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>startDate</td><td>string</td><td>Yes</td><td>format: dd/mm/yyyy</td></tr><tr><td>endDate</td><td>string</td><td>Yes</td><td>format: dd/mm/yyyy</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="229">Field</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td></td></tr><tr><td>status</td><td>number</td><td></td></tr><tr><td><strong>data</strong></td><td>list</td><td>List data</td></tr><tr><td>account</td><td>string</td><td></td></tr><tr><td><strong>stockTransferHistories</strong></td><td>list</td><td></td></tr><tr><td>transactionID</td><td>string</td><td></td></tr><tr><td>beneficiaryAccount</td><td>string</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td></td></tr><tr><td>quantity</td><td>number</td><td></td></tr><tr><td>dateTime</td><td>string</td><td></td></tr><tr><td>status</td><td>string</td><td></td></tr><tr><td>remark</td><td>string</td><td></td></tr><tr><td>auditRemark</td><td>string</td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:**&#x20;

* fromDate - toDate not more than 1 month
* The time for searching the past should not exceed 6 months
  {% endhint %}

**Sample:**

```json
Input: 
account: 0901351
startDate: 10/07/2023
enđate: 10/08/2023
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "stockTransferHistories": []
  }
}
```

### POST  transfer

```
https://fc-tradeapi.ssi.com.vn/api/v2/stock/transfer
```

Transfer stock inside

**Detail**

{% tabs %}
{% tab title="Input" %}

<table><thead><tr><th width="197">Field</th><th width="98">Type</th><th width="101">Required?</th><th>Description</th></tr></thead><tbody><tr><td>account</td><td>string</td><td>Yes</td><td></td></tr><tr><td>beneficiaryAccount</td><td>string</td><td>Yes</td><td></td></tr><tr><td>exchangeID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>instrumentID</td><td>string</td><td>Yes</td><td></td></tr><tr><td>quantity</td><td>number</td><td>Yes</td><td></td></tr><tr><td>code</td><td>string</td><td>No</td><td>isSave = false -> required PIN/ OTP <br>isSave = true -> no required</td></tr></tbody></table>
{% endtab %}

{% tab title="Output" %}

<table><thead><tr><th width="196">Dữ liệu</th><th width="98">Kiểu</th><th>Mô tả</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Mô tả msg call API</td></tr><tr><td>status</td><td>number</td><td>Trạng thái </td></tr><tr><td><strong>data</strong></td><td>list</td><td>Thông tn dữ liệu trả ra</td></tr><tr><td>account</td><td>string</td><td>Số tài khoản</td></tr><tr><td>transactionID</td><td>string</td><td>Số hiệu giao dịch</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

**Sample:**

* Successfull request: &#x20;

```json
Input: 
{
  "account": "0901351",
  "beneficiaryAccount": "0901356",
  "exchangeID": "HOSE",
  "instrumentID": "SSI",
  "quantity": 100,
  "code": "string"
}
Output: 
{
  "message": "Success",
  "status": 200,
  "data": {
    "account": "0901351",
    "transactionID": "462764"
  }
}
```

* Error request:&#x20;

```json
Input: 
{
  "account": "0901351",
  "beneficiaryAccount": "0901356",
  "exchangeID": "HOSE",
  "instrumentID": "SSI",
  "quantity": 100,
  "code": "string"
}
Output: 
{
  "message": "Account 0901352 is not exist",
  "status": 400,
  "data": null
}
```
