Get User Order

Get user order history (Authentication type: KEYED, See Interface Permission)

Request Format

GET https://api-cloud.bitmart.com/contract/v1/ifcontract/userOrders

Request Limit

See Detailed Rate Limit

Request Parameter

Field Type Required? Description
contractID long Yes Contract ID
offset int No Offset
size int No Request size, If size is not passed or size is 0, the system returns a maximum of 60 records
status int Yes Order status
0=All
1=Submitting
2=Commissioned
3=1&2
4=Completed

Instruction

Request example

curl https://api-cloud.bitmart.com/contract/v1/ifcontract/userOrders?contractID=1&offset=0&size=0&status=0

Response Data

Field Type Description
order_id long Order ID
contract_id long Contract ID
price string Price
vol string Volume
done_avg_price string Average filled price
done_vol string Filled volume
way int Yes Order side
1: Open long
2: Close short
3: Close long
4: Open short
category int Yes Order type
1: Limit order
2: Market order
make_fee string Maker fee
take_fee string Taker fee
origin string Origin of order
created_at string Create time
finished_at string Completion time
status int Status
1=Submitting
2=Commissioned, indicates that the order has entered the matching queue, and done_vol in the order information represents the order filled part. As long as done_vol is not 0, it means that the order has been filled
4=Completed
errno int Reason for closing of the order
1=User cancelled
2=Timeout (not in use)
3=Insufficient user assets, cancelled
4=End of liquidation order
5=System cancelled
6=Cancelled due to partial closing
7=Cancelled due to ADL
8=Cancelled due to profit sharing (not in use)
9=Cancelled due to position error
10=Illegal type
11=Opposite direction order exists

Instruction

Example of returned data format

{
  "code": 1000,
  "trace":"886fb6ae-456b-4654-b4e0-d681ac05cea1",
  "message": "OK",
  "data": {
    "orders": [
      {
        "order_id": 10284160,
        "contract_id": 1,
        "price": "8",
        "vol": "4",
        "done_avg_price": "0",
        "done_vol": "0",
        "way": 1,
        "category": 1,
        "open_type": 2,
        "make_fee": "0",
        "take_fee": "0",
        "origin": "",
        "created_at": "2018-07-17T07:24:13.410507Z",
        "finished_at": null,
        "status": 2,
        "errno": 0
      }
    ]
  }
}

results matching ""

    No results matching ""