PlaceOrder
placeOrder
Request Parameter
| Parameter | Type | Meaning | 
|---|---|---|
| account | Account | Account | 
| orderObject | OrderObject | Order Object | 
| unblock | bool ? (default = false) | unblock | 
Result Response
| Parameter | Type | Meaning | 
|---|---|---|
| isSuccess | bool | Interface result | 
| data | Object | OrderResult list is returned | 
| message | string ? (optional) | isSuccess = False error description is returned | 
OrderResult Parameter
Return type : Object
| Parameter | Type | Meaning | 
|---|---|---|
| functionType | int | Function Type : 0New Order 、10New Order Executed 、15Change Price 、20Change Quantity 、30Cancel 、90Failed | 
| date | string | Transaction date | 
| seqNo | string | Order serial number | 
| branchNo | string | Branch number | 
| account | string | Account | 
| orderNo | string | Order number | 
| assetType | number | Asset type : 0Stock | 
| market | string | Market type : TAIEXListed 、TAISDAQOTC 、TAIEMGEMG | 
| marketType | js:string / ts:MarketType | Trading session type : Common、Fixing、IntradayOdd、Odd、Emg、EmgOdd | 
| stockNo | string | Symbol | 
| buySell | js:string / ts:BSAction | Buy/Sell Type : Buy、Sell | 
| priceType | js:string / ts:PriceType | Original order price type : Limit、LimitUp、LimitDown、Market、Reference | 
| price | number | Order Price | 
| quantity | number | Original order quantity | 
| timeInForce | js:string / ts:TimeInForce | Time In Force ROD、FOK、IOC | 
| orderType | js:string / ts:OrderType | Order Type  : Stock、Margin、ShortShort sale 、DayTrade、SBL | 
| isPreOrder | bool | Reservation Flag | 
| status | number | Order status, for details please refer to STATUS | 
| afterPriceType | js:string / ts:PriceType | Valid order price type : Limit、LimitUp、LimitDown、Market、Reference | 
| afterPrice | number | Valid order price | 
| afterQty | number | Valid Order Quantity (filled quantity included) | 
| filledQty | number | Filled Quantity | 
| filledMoney | number | Filled Value | 
| beforeQty | number | Before the Quantity Modification | 
| beforePrice | number | Before the Price Modification | 
| userDef | string | Custom Fields | 
| lastTime | string | Last Modification Time | 
| details | list | Order Process (Return value when query orderResultDetail or orderHistory ) | 
| errorMessage | string | Error Message | 
Request Example
const order = {
  buySell: BSAction.Buy,
  symbol: "2888",
  price: "8.90",
  quantity: 2000,
  marketType: marketType.Common,
  priceType: PriceType.Limit,
  timeInForce: TimeInForce.ROD,
  orderType: OrderType.Stock,
  userDef: "from Js"
};
sdk.stock.placeOrder(accounts.data[0],order,false);
Response Example
{
  isSuccess: true,
  data:{
      functionType: 0,                        // Function Type (number)
      date: '2023/10/23',                     // Trading Date (string)
      seqNo: '00000000016',                   // Order serial number (string)
      branchNo: '6460',                       // Branch number (string)
      account: '26',                          // Account (string)
      orderNo: 'bA716',                       // Order number (string)
      assetType: 0,                          // Asset Category (number)
      market: 'TAIEX',                        // Market Category (string)
      marketType: 'Common',                   // Trading session type (string)
      stockNo: '2888',                        // Symbol (string)
      buySell: 'Buy',                         // Transaction direction (string)
      priceType: 'Limit',                    // Order price type (string)
      price: 9,                              // Order Price (number)
      quantity: 2000,                        // Order quantity (number)
      timeInForce: 'ROD',                    // Time in force (string)
      orderType: 'Stock',                    // Order Type (string)
      isPreOrder: false,                     // Reservation flag (boolean)
      status: 10,                            // Order Status (number)
      afterPriceType: Limit,                 // Valid order price type (PriceType)
      afterPrice: 9,                        // Valid order price (number)
      unit: 1000,                            // Share Unit (number)
      afterQty: 2000,                        // Valid order quantity (number)
      filledQty: 0,                          // Filled quantity (number)
      filledMoney: 0,                       // Filled Value (number)
      beforeQty: 0,                         // Before the quantity modification (number)
      beforePrice: 9,                       // Before the price modification (number)
      userDef: 'from Js',                   // Custom fields (string)
      lastTime: '13:36:38.317'              // Last modification time (string)
  }
}