Use Add Order to submit orders to the exchange.
Add Order
Request
Key | Type | Value | Required |
---|---|---|---|
type | string | addorder | Yes |
security | string | The trading pair for the order | Yes |
ordertype | string | Order Type options are: "LMT" for limit orders "MKT" for market orders | Yes |
side | string | "B" for Buy "S" for Sell | Yes |
price | number | Price for the order. (Required for Limit orders) | Conditional |
qty | number | The quantity of the asset for the all Limit and Market Sell orders (use amount for Market Buy orders) | Conditional |
amount | number | The order amount in FIAT for Market Buy orders (do not send qty field on Market Buy orders) | Conditional |
userid | string | The userid placing the order | No |
tif | string | Time 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 |
stoptype | string | Set field to "STOP" in order to place a Stop Limit or Stop Market order. Default is not set. | Condtional |
stopprice | number | The stop price if stop type is set | Condtional |
exptime | posix time | The expiry time of the order, in POSIX format. (Required if TIF is set to GTT) | Condtional |
clientorderid | string | An arbitrary identifier that will be passed back in the response to the add order | No |
Response
Key | Type | Value | Required |
---|---|---|---|
type | string | addorder | Yes |
result | string | "OK" for successful submission. For rejected orders, this field will be populated with the reason for the rejection | Yes |
refno | string | The reference number associated with a successful order submission | Yes |
security | string | The trading pair for the order | Yes |
ordertype | string | "LMT" for limit orders "MKT" for market orders | Yes |
side | string | "B" for Buy, "S" for Sell | Yes |
price | number | Price for the order. (Required for Limit orders) | Conditional |
qty | number | The quantity of the asset for the all Limit and Market Sell orders | Conditional |
amount | number | The order amount in FIAT for Market Buy orders. | Conditional |
userid | string | The userid placing the order | No |
tif | string | "GTC" (Good til Cancel), "IOC" (Immediate or Cancel), "FOK" (Fill or Kill) or "GTT" (Good til Time) | No |
exptime | time, POSIX | The expiry time of the order, in POSIX format if tif is set to GTT | Conditional |
stoptype | string | Will be set to "STOP" for valid stop orders. | Conditional |
stopprice | number | The stop price if stop type is set | Conditional |
clientorderid | string | An arbitrary identifier that will be passed back in the response to the add order | No |
# 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'
}