Support Center

New API update on v2.1/orders (27th April 2021)

April 23, 2021

New update on v2.1/orders (Effective at UTC 3AM on 28th April 2021)

 

before:

 

GET v2.1/orders

params in the body are like
{
“marketCode”: “BTC-USD-SWAP-LIN”,
“orderId”: “123456789”,
“clientOrderId”: “987654321”,
“limit”: “3”,
“startTime”: “2020-12-08 20:00:00”,
“endTime”: “2020-12-09 20:00:00”
}

response is
{
“accountId”: “4499257”,
“event”: “orders”,
“timestamp”: “1611645666834”,
“data”: [
{
“status”: “OrderOpened”,
“orderId”: 304330302278421284,
“clientOrderId”: 1611727170448,
“marketCode”: “BTC-USD-SWAP-LIN”,
“side”: “sell”,
“orderType”: “LIMIT”,
“price”: “33108”,
“lastTradedPrice”: null,
“averageFillPrice”: null,
“stopPrice”: null,
“limitPrice”: null,
“quantity”: “1”,
“matchQuantity”: null,
“remainQuantity”: “1”,
“orderMatchType”: null,
“matchId”: null,
“leg1Price”: null,
“leg2Price”: null,
“fees”: null,
“feeInstrumentId”: null,
“timeInForce”: “MAKER_ONLY”,
“isTriggered”: null,
“timestamp”: “1611727170650”
},
{
“status”: “OrderMatched”,
“orderId”: 5204263117330811401,
“clientOrderId”: 1611644738148,
“marketCode”: “BTC-Rate-Jan21”,
“side”: “sell”,
“orderType”: “LIMIT”,
“price”: “472”,
“lastTradedPrice”: “472”,
“averageFillPrice”: “472”,
“stopPrice”: null,
“limitPrice”: null,
“quantity”: “3”,
“matchQuantity”: “0.5”,
“remainQuantity”: “2.5”,
“orderMatchType”: “MAKER”,
“matchId”: [
5204263117330811403,
5204263117330811405,
5204263117330811407
],
“leg1Price”: null,
“leg2Price”: null,
“fees”: “-0.0028391”,
“feeInstrumentId”: null,
“timeInForce”: “GTC”,
“isTriggered”: False,
“timestamp”: “1611645088765”
},

]
}

 

after:

 

GET v2.1/orders?marketCode=BTC-USD-SWAP-LIN&orderId=123456789&clientOrderId=987654321&limit=3&startTime=1579450778000&endTime=1613978625000

with parameters in the URL

response is
{
“event”: “orders”,
“timestamp”: “1619167719563”,
“accountId”: “1076”,
“data”: [
{
“status”: “OrderClosed”,
“orderId”: “304408197314577142”,
“clientOrderId”: “1”,
“marketCode”: “BTC-USD-SWAP-LIN”,
“side”: “BUY”,
“orderType”: “LIMIT”,
“price”: “10006.0”,
“quantity”: “0.001”,
“remainQuantity”: “0.001”,
“timeInForce”: “GTC”,
“orderClosedTimestamp”: “1619131050779”
},
{
“status”: “OrderOpened”,
“orderId”: “304408197314577143”,
“clientOrderId”: “2”,
“marketCode”: “BTC-USD-SWAP-LIN”,
“side”: “SELL”,
“orderType”: “LIMIT”,
“price”: “60006.0”,
“quantity”: “0.001”,
“remainQuantity”: “0.001”,
“timeInForce”: “GTC”,
“orderOpenedTimestamp”: “1619131049574”
},
{
“status”: “OrderMatched”,
“orderId”: “448528458527567629”,
“clientOrderId”: “1618870087524”,
“marketCode”: “FLEX-USD-SWAP-LIN”,
“side”: “BUY”,
“orderType”: “MARKET”,
“price”: “0.194”,
“lastTradedPrice”: “0.170”,
“avgFillPrice”: “0.170”,
“quantity”: “12.1”,
“filledQuantity”: “12.1”,
“remainQuantity”: “0”,
“matchIds”: [
{
“448528458527567630”: {
“matchQuantity”: “12.1”,
“matchPrice”: “0.170”,
“timestamp”: “1618870088471”,
“orderMatchType”: “TAKER”
}
}
],
“fees”: {
“FLEX”: “-0.00440786”
},
“timeInForce”: “IOC”,
“isTriggered”: “false”
},

]
}