Use Add Order to submit orders to the exchange.

Add Order


Request

KeyTypeValueRequired
typestringaddorderYes
securitystringThe trading pair for the orderYes
ordertypestringOrder Type options are:

"LMT" for limit orders
"MKT" for market orders
Yes
sidestring"B" for Buy
"S" for Sell
Yes
pricenumberPrice for the order. (Required for Limit orders)Conditional
qtynumberThe quantity of the asset for the all Limit and Market Sell orders (use amount for Market Buy orders)Conditional
amountnumberThe order amount in FIAT for Market Buy orders (do not send qty field on Market Buy orders)Conditional
useridstringThe userid placing the orderNo
tifstringTime In Force. Options are:

"GTC" (Good til Cancel),
"IOC" (Immediate or Cancel),
"FOK" (Fill or Kill) or
"GTT" (Good til Time)

If parameter is not specified, the order defaults to GTC
No
stoptypestringSet field to "STOP" in order to place a Stop Limit or Stop Market order. Default is not set.Condtional
stoppricenumberThe stop price if stop type is setCondtional
exptimeposix timeThe expiry time of the order, in POSIX format. (Required if TIF is set to GTT)Condtional
clientorderidstringAn arbitrary identifier that will be passed back in the response to the add orderNo

Response

KeyTypeValueRequired
typestringaddorderYes
resultstring"OK" for successful submission. For rejected orders, this field will be populated with the reason for the rejectionYes
refnostringThe reference number associated with a successful order submissionYes
securitystringThe trading pair for the orderYes
ordertypestring"LMT" for limit orders
"MKT" for market orders
Yes
sidestring"B" for Buy,
"S" for Sell
Yes
pricenumberPrice for the order. (Required for Limit orders)Conditional
qtynumberThe quantity of the asset for the all Limit and Market Sell ordersConditional
amountnumberThe order amount in FIAT for Market Buy orders.Conditional
useridstringThe userid placing the orderNo
tifstring"GTC" (Good til Cancel),
"IOC" (Immediate or Cancel),
"FOK" (Fill or Kill) or
"GTT" (Good til Time)
No
exptimetime, POSIXThe expiry time of the order, in POSIX format if tif is set to GTTConditional
stoptypestringWill be set to "STOP" for valid stop orders.Conditional
stoppricenumberThe stop price if stop type is setConditional
clientorderidstringAn arbitrary identifier that will be passed back in the response to the add orderNo
# Request MKT BUY
{
  "type":"addorder",
  "security":"BTCUSD",
  "ordertype":"MKT",
  "side":"B",
  "amount":"100"
}

# Request MKT SELL

{
  "type": "addorder",
  "security":"BTCUSD",
  "side":"S",
  "ordertype":"MKT",
  "qty":"10"
}

# Request LMT Order

{
  "type":"addorder",
  "security":"ETHUSD",
  "side":"S",
  "price":5000,
  "qty":69,
  "tif":"GTC",
  "ordertype":"LMT"
}

# Response MKT BUY

{
  'result': 'OK',
  'refno': '6B53OKXU07Z2E0',
  'security': 'BTCUSD',
  'side': 'B',
  'amount': '100',
  'type': 'addorder',
  'ordertype': 'MKT'
}

# Response MKT SELL - GTC

{
  'tif': 'GTC', 
  'result': 'OK', 
  'refno': '6B53OKXU0AVXE1', 
  'security': 'ETHUSD', 
  'side': 'S', 
  'price': 5000, 
  'qty': 69, 
  'type': 'addorder', 
  'ordertype': 'LMT'
}

# Response MKT SELL
{
  'result': 'OK', 
  'refno': '6B53OKXU08GJE0', 
  'security': 'BTCUSD', 
  'side': 'S', 
  'qty': '10', 
  'type': 'addorder', 
  'ordertype': 'MKT'
}

# Response LMT Order

{
  'tif': 'GTC', 
  'result': 'OK', 
  'refno': '6B53OKXU0AVXE1', 
  'security': 'ETHUSD', 
  'side': 'S', 
  'price': 5000, 
  'qty': 69, 
  'type': 'addorder', 
  'ordertype': 'LMT'
}

# Response once order executed (MKT BUY)

{
  'refno': '6B53OKXU07Z2E0',
  'side': 'B', 
  'amount': '100', 
  'orderstatus': 'Executed', 
  'type': 'order', 
  'userid': '[email protected]', 
  'execamount': '99.99964917', 
  'tif': 'IOC', 
  'firm': 'QAT', 
  'commrate': '0:0', 
  'security': 'BTCUSD', 
  'price': '0', 
  'liveqty': '0', 
  'qty': '0.00276498', 
  'updtime': '1651856263638', 
  'enttime': '1651856263638', 
  'category': 'STAGE', 
  'execqty': '0.00276498', 
  'account': '[email protected]', 
  'ordertype': 'MKT'
}

# Response when order rejected

{
  'refno': '6B53OKXU0887E0', 
  'side': 'B', 
  'amount': '10000000000000000000000000', 
  'orderstatus': 'Rejected', 
  'type': 'order', 
  'userid': '[email protected]', 
  'execamount': '0', 
  'tif': 'IOC', 
  'firm': 'QAT', 
  'commrate': '0:0', 
  'security': 'BTCUSD', 
  'price': '0', 
  'liveqty': '0', 
  'qty': '0', 
  'updtime': '1651856713672', 
  'text': 'not enough available crypto pos USD,250', 
  'enttime': '1651856713672', 
  'category': 'STAGE', 
  'execqty': '0', 
  'account': '[email protected]', 
  'ordertype': 'MKT'
}