curl --request GET \
--url https://api.anchorage-staging.com/v2/trading/orders \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/orders"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"orderId": "c6d8c4a8-e883-4ae3-9f35-4a35d06c383d",
"clOrderId": "40d846b7-6efb-48fa-acc9-dcace827c927",
"accountId": "a05a846f-4ef0-11ed-a291-dafe71b41c83",
"symbol": "BTC-USD",
"side": "BUY",
"orderQty": "1.0",
"currency": "BTC",
"orderType": "MARKET",
"timeInForce": "GTC",
"orderStatus": "FILLED",
"avgPx": "22840.9299",
"avgPxAllIn": "22863.7708299",
"leavesQty": "0.0",
"cancelQty": "0.0",
"cumQty": "1.0",
"totalFee": "25.35",
"feeCurrency": "USD",
"rejectReason": "",
"rejectReasonText": "",
"submitTime'": "2023-03-07T19:49:06.286737Z",
"transactTime": "2023-03-07T19:49:06.314322Z"
}
],
"page": {
"next": "/v2/trading/orders?endDate=2020-08-31T22:14:07Z&limit=2"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}List orders
Permissions required: Execute trades or Read trade activity
List all orders. With the permission Read trade activity all orders of the organization may be read. With the permission Execute trades only the orders created by this API key may be read.
Orders are sorted in a descending order by their timestamp, i.e. the most recent order or the order with a timestamp closest to endDate is listed first.
When filtering by subaccountId, the allocation information is included but filtered to show only the allocation for the requested subaccount.
For multi-order requests without a subaccount filter, allocation information is not included.
To get complete allocation information, use GET /v2/trading/orders/{orderId}
Filters
You may optionally supply filters for the list of orders using query parameters below
curl --request GET \
--url https://api.anchorage-staging.com/v2/trading/orders \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/orders"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"orderId": "c6d8c4a8-e883-4ae3-9f35-4a35d06c383d",
"clOrderId": "40d846b7-6efb-48fa-acc9-dcace827c927",
"accountId": "a05a846f-4ef0-11ed-a291-dafe71b41c83",
"symbol": "BTC-USD",
"side": "BUY",
"orderQty": "1.0",
"currency": "BTC",
"orderType": "MARKET",
"timeInForce": "GTC",
"orderStatus": "FILLED",
"avgPx": "22840.9299",
"avgPxAllIn": "22863.7708299",
"leavesQty": "0.0",
"cancelQty": "0.0",
"cumQty": "1.0",
"totalFee": "25.35",
"feeCurrency": "USD",
"rejectReason": "",
"rejectReasonText": "",
"submitTime'": "2023-03-07T19:49:06.286737Z",
"transactTime": "2023-03-07T19:49:06.314322Z"
}
],
"page": {
"next": "/v2/trading/orders?endDate=2020-08-31T22:14:07Z&limit=2"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Query Parameters
The start date-time of the trades (exclusive) in YYYY-MM-DDTHH:MM:SS.nnnnnnnnn format. The earliest valid start date-time is '2017-01-01T00:00:00.000000000'. The last valid start date-time is the current date-time. Date-times are always in UTC RFC 3339 'date-time'.
The end date-time of the trades (exclusive) in YYYY-MM-DDTHH:MM:SS.nnnnnnnnn format. The latest valid end date-time is the current date-time. The earliest valid end date-time is '2017-01-01T00:00:00.000000000'. Date-times are always in UTC RFC 3339 'date-time'.
Was this page helpful?