Skip to main content

Order History

Note: Post Aug 1st, 2022, orderId has the format of uniform 17 digits whereas in the legacy system, orderId followed a natural growth pattern.

Orders History

  • GET https://api.poloniex.com/orders/history

Get a list of historical orders in an account. Interval between startTime and endTime cannot exceed 30 days. If only endTime is populated then startTime will default to 7 days before endTime. If only startTime is populated then endTime will be defaulted to 7 days after startTime. Please note that canceled orders that are before 7 days from current time will be archived. Rest of the orders will be archived before 90 days from current time.

Request ParameterData TypeRequiredDescription
accountTypeStringfalseSPOT is the default and only supported one.
typeStringfalseMARKET, LIMIT, LIMIT_MAKER (Default: all types)
sideStringfalseBUY, SELL (Default: both sides)
symbolStringfalseAny supported symbol (Default: all symbols)
fromLongfalseAn 'orderId'. The query begins at ‘from'.
directionStringfalsePRE, NEXT The direction before or after ‘from'.
statesStringfalseFAILED, FILLED, CANCELED. PARTIALLY_CANCELED Multiple states can be specified and separated with comma. (Default: all states)
limitIntegerfalseMax number of orders to return. Default is 500. Max value is 1000.
hideCancelBooleanfalsetrue or false. Whether canceled orders should not be retrieved. (Default: false)
startTimeLongfalse(milliseconds since UNIX epoch) orders updated before startTime will not be retrieved.
endTimeLongfalse(milliseconds since UNIX epoch) orders updated after endTime will not be retrieved.
Response FieldData TypeDescription
idStringorder id
clientOrderIdStringuser specified id
symbolStringThe symbol to trade, like BTC_USDT
accountTypeStringSPOT
sideStringBUY, SELL
typeStringMARKET, LIMIT, LIMIT_MAKER
timeInForceStringGTC, IOC, FOK
priceString
avgPriceStringavgPrice = filledAmount/filledQuantity
quantityStringbase units for the order
amountStringquote units for the order
filledQuantityString
filledAmountString
stateStringFAILED, FILLED, CANCELED, PARTIALLY_CANCELED
orderSourceStringsource of the order e.g API, APP, WEB
createTimeLong
updateTimeLong
loanBooleantrue if borrowed funds, false otherwise
cancelReasonIntegercode specified to provide reason for cancelation if applicable; 0: "Not applicable"; 1: "As requested by user"; 1000-1999: "Due to breach of controls in matching engine; 1004: "Due to self-trade"; 1012: "exceed slippage tolerance"; 2000: "Due to margin liquidation"; 2001: "Due to margin threshold breach"; 2002: "Due to symbol marked as offline"
Example output:
[
{
"id": 35490370041151490,
"clientOrderId": "Try1",
"symbol": "TRX_USDC",
"accountType": "SPOT",
"side": "SELL",
"type": "LIMIT_MAKER",
"timeInForce": "GTC",
"price": "3333",
"avgPrice": "0",
"quantity": "5",
"amount": "0",
"filledQuantity": "0",
"filledAmount": "0",
"state": "CANCELED",
"orderSource": "API",
"createTime": 1649427963597,
"updateTime": 1649427963597,
"loan": false,
"cancelReason": 1
},
{
"id": 34141303381950464,
"clientOrderId": "223ABD",
"symbol": "TRX_USDC",
"accountType": "SPOT",
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"price": "1.05",
"avgPrice": "0.06023436",
"quantity": "10",
"amount": "0",
"filledQuantity": "10",
"filledAmount": "0.6023436",
"state": "FILLED",
"orderSource": "API",
"createTime": 1649106321041,
"updateTime": 16491063210417,
"loan": false,
"cancelReason": 0
}
]

Smart Orders History

  • GET https://api.poloniex.com/smartorders/history

Get a list of historical smart orders in an account. Interval between startTime and endTime cannot exceed 30 days. If only endTime is populated then startTime will default to 7 days before endTime. If only startTime is populated then endTime will be defaulted to 7 days after startTime.

Request ParameterData TypeRequiredDescription
accountTypeStringfalseSPOT is the default and only supported one.
typeStringfalseSTOP, STOP_LIMIT (Default: all types)
sideStringfalseBUY, SELL (Default: both sides)
symbolStringfalseAny supported symbol (Default: all symbols)
fromLongfalseAn 'smart orderId'. The query begins at ‘from'.
directionStringfalsePRE, NEXT The direction before or after ‘from'.
statesStringfalseFAILED, FILLED, CANCELED. PARTIALLY_CANCELED. Multiple states can be specified and separated with comma. (Default: all states)
limitIntegerfalseMax number of orders to return. Default is 500. Max value is 2000.
hideCancelBooleanfalsetrue or false. Whether canceled smart orders should not be retrieved. (Default: false)
startTimeLongfalse(milliseconds since UNIX epoch) smart orders updated before startTime will not be retrieved.
endTimeLongfalse(milliseconds since UNIX epoch) smart orders updated after endTime will not be retrieved.
Response FieldData TypeDescription
idStringsmart order's id
clientOrderIdStringsmart order's clientOrderId
symbolStringThe symbol to trade, like BTC_USDT
stateStringFAILED, FILLED, CANCELED, PARTIALLY_CANCELED
accountTypeStringSPOT
sideStringBUY, SELL
typeStringSTOP, STOP_LIMIT
timeInForceStringGTC, IOC, FOK
quantityStringbase units for the order
priceString
amountStringquote units for the order
stopPriceString
createTimeLong
updateTimeLong
Example output:
[
{
"id": "25444163851911168",
"clientOrderId": "",
"symbol": "TRX_USDC",
"state": "CANCELED",
"accountType": "SPOT",
"side": "BUY",
"type": "STOP_LIMIT",
"timeInForce": "GTC",
"quantity": "2",
"price": "100",
"amount": "200",
"stopPrice": "125",
"createTime": 1647032761392,
"updateTime": 1647032874275
},
{
"id": "42745705164439552",
"clientOrderId": "777111",
"symbol": "BTC_USDT",
"state": "FAILED",
"accountType": "SPOT",
"side": "BUY",
"type": "STOP_LIMIT",
"timeInForce": "GTC",
"quantity": "0.1",
"price": "39000",
"amount": "100",
"stopPrice": "40000",
"createTime": 1651157770288,
"updateTime": 1651157770345
}
]