Get Order History

API Description

Retrieves historical order data for the authenticated user. This endpoint provides comprehensive information about all past orders including filled, cancelled, and rejected orders.

HTTP Request

GET /v5/order/history

Request Parameters

Parameter
Type
Required
Description

symbol

string

No

Symbol name (e.g., BTCUSDT)

orderId

string

No

Order ID

orderStatus

string

No

Order status: New, PartiallyFilled, Filled, Cancelled, Rejected

startTime

string

No

Start time (ms)

endTime

string

No

End time (ms)

limit

number

No

Number of records (max 50)

cursor

string

No

Cursor for pagination

Response Parameters

Parameter
Type
Description

oid

number

Order ID

orderType

string

Order type (LIMIT, MARKET, etc.)

limitPrice

string

Limit price for the order

side

string

Order side (LONG, SHORT)

size

string

Order size

taken

string

Amount already filled

balance

string

Account balance

createdTime

string

Order creation timestamp

updatedTime

string

Order last update timestamp

status

string

Order status (FILLED, PARTIALLY_FILLED, etc.)

blockInfo

object

Block information

-> height

number

Block height

-> timestamp

number

Block timestamp

Request Example

cURL

curl -X GET \
  'https://api.synfutures.com/v5/order/history?category=linear&symbol=BTCUSDT&limit=20' \
  -H 'Content-Type: application/json' \
  -H 'X-BAPI-API-KEY: [api_key]' \
  -H 'X-BAPI-SIGN: [signature]' \
  -H 'X-BAPI-TIMESTAMP: [timestamp]' \
  -H 'X-BAPI-RECV-WINDOW: 5000'

JavaScript (Fetch)

const response = await fetch(
    "https://api.synfutures.com/v5/order/history?category=linear&symbol=BTCUSDT&limit=20",
    {
        method: "GET",
        headers: {
            "Content-Type": "application/json",
            "X-BAPI-API-KEY": "[api_key]",
            "X-BAPI-SIGN": "[signature]",
            "X-BAPI-TIMESTAMP": "[timestamp]",
            "X-BAPI-RECV-WINDOW": "5000",
        },
    }
);

const data = await response.json();
console.log(data);

Python (requests)

import requests

url = "https://api.synfutures.com/v5/order/history"
params = {
    'category': 'linear',
    'symbol': 'BTCUSDT',
    'limit': 20
}
headers = {
    'Content-Type': 'application/json',
    'X-BAPI-API-KEY': '[api_key]',
    'X-BAPI-SIGN': '[signature]',
    'X-BAPI-TIMESTAMP': '[timestamp]',
    'X-BAPI-RECV-WINDOW': '5000'
}

response = requests.get(url, headers=headers, params=params)
result = response.json()
print(result)

Response Example

Success Response

{
    "data": [
        {
            "instrumentAddrress": "0x1a8a5872b5b82686e1271a363556335a5f540dae",
            "symbol": "BTC-USDM-EMG",
            "expiry": 4294967295,
            "oid": 1407155437568,
            "orderType": "LIMIT",
            "limitPrice": "4389105219931565477678",
            "side": "SHORT",
            "size": "-100000000000000000",
            "taken": "0",
            "balance": "87782105000000000000",
            "createdTime": "1684738540559",
            "updatedTime": "1684738540559",
            "status": "FILLED",
            "blockInfo": {
                "height": 162708,
                "timestamp": 1761278396
            }
        }
    ],
    "msg": "",
    "code": 200,
    "requestId": "bbf4fa1a-0f41-449f-8d9c-44fdceae0bf7"
}

Error Response

{
    "code": 400,
    "msg": "Request parameter error",
    "data": {},
    "requestId": "bbf4fa1a-0f41-449f-8d9c-44fdceae0bf7"
}

Last updated