Skip to content

api placeorder

ntwerd edited this page Apr 12, 2023 · 3 revisions

Place Order


Send place order to backend broker

URL

http://122.8.148.106/robot/api/v1/placeOrder/<brokerCode>

Method:

POST

Required

Header : X-API-KEY: <XXXXXX> , Content-Type: application/json

Payload

  • accountNo : your account number

  • symbol : product symbol

  • position : For stock product Buy > O, Sell > C

  • side : Buy > B, Sell > S

  • volume : trade volume

  • price : trade price

  • priceType :

    • ATO
    • ATC
    • LIMIT
    • MP
    • MP-MKT
    • MP-MTL
  • validityType:

    • GTA
    • DAY
    • AUTO-M
    • GTC
    • FOK
    • IOC
    • GTS
    • GTT
  • pbVolume : Iceburg volume

  • takeProfitPrice

  • stopLossPrice

  • note

  • ttf

Sample Payload

{  
   "accountNo":"1234567-8",
   "symbol":"PTT",
   "position":"O",
   "side":"B",
   "volume":100,
   "price":52.75,
   "priceType":"LIMIT",
   "validityType":"DAY",
   "takeProfitPrice":0,
   "stopLossPrice":0,
   "note":"",
   "pbVolume":"",
   "ttf":"NORMAL"
}

Success Response:

  • Code: 200

    Content:

{
    "status": "T",
    "message": "Success",
    "data": {
        "orderNo": "4823"
    }
}

Error Response:

  • Code: 200

    Content:

{
    "status": "F",
    "message": "Account not found",
    "data": {}
}

OR

  • Code: 200 Content:
{
    "status": "F",
    "message": "QWERD is unavailable to trade with this account type.",
    "data": {}
}

Clone this wiki locally