API reference ยท Orders
/v1/accounts/{account_id}/ordersList orders.
Read
Orders, newest first: working ones and past ones. Orders placed on a trading platform are listed too (source platform).
Path parameters#
-
The account number.
Query parameters#
statusstringworking: the complete set of working orders. history: past orders. all: both.
One of
allworkinghistorymarketstringOnly this market.
client_order_idstringThe order you placed through the API with this id.
limitintegerPage size.
cursorstringnext_cursor from the previous page, with the same filters.
Responses#
200OK
-
The order.
-
Your own id for it, when it was placed through the API.
-
The account number.
-
A market id: the asset and USD.
-
The order's side; null for an order placed elsewhere before the API saw it.
One of
buysell -
The order's type.
One of
marketlimitstop_marketstop_limittake_markettake_limit -
unconfirmed: the engine has not confirmed its last state yet.
One of
pendingworkingfilledcanceledrejectedexpiredunconfirmed -
The size, in the base asset.
-
How much filled.
-
Its limit price.
-
Its trigger price.
-
The average fill price.
-
The fee its fill paid.
-
It may only reduce a position; null when not known (placed elsewhere).
-
How long it rests.
One of
gtcgtdiocfok -
Where it was placed: this API, a trading platform, a strategy, a TradingView alert, or the system (a liquidation).
One of
apiplatformstrategytradingviewsystem -
Exits attached to it (orders placed through the API).
-
Why it was canceled.
One of
usercancel_allflattenclose_allposition_closedposition_reversedclose_assistocoreplacedstrategykey_loss_stoprisk_rulesystem_restartexternal -
When it was placed.
-
When it filled.
-
When it was canceled.
-
updated_atinteger, Unix ms or nullIts latest change.
400A query or path parameter is out of range or the wrong kind.
{
"error": {
"type": "invalid_request",
"code": "invalid_parameter",
"message": "A parameter has a value this route does not take.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": false,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"
}
}401The request has no Authorization header.
{
"error": {
"type": "authentication",
"code": "missing_api_key",
"message": "No API key: send it as Authorization: Bearer <key>.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": false,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#missing_api_key"
}
}403The key only works from the addresses you listed.
{
"error": {
"type": "permission",
"code": "ip_not_allowed",
"message": "This address is not on the key's allowlist.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": false,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#ip_not_allowed"
}
}404The account does not exist in this environment, or the key does not reach it.
{
"error": {
"type": "not_found",
"code": "account_not_found",
"message": "No account with that id is reachable with this key.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": false,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"
}
}429A request budget is used up (details.scope says which).
{
"error": {
"type": "rate_limit",
"code": "rate_limited",
"message": "Too many requests: slow down.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": true,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#rate_limited"
}
}500An error we did not expect.
{
"error": {
"type": "server",
"code": "internal_error",
"message": "Something went wrong on our side.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": true,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#internal_error"
}
}503The trading engine did not give a complete answer in time; nothing partial is returned.
{
"error": {
"type": "engine",
"code": "state_unavailable",
"message": "The account's figures cannot be read right now.",
"request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
"retryable": true,
"doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"
}
}Errors#
Codes this endpoint can return. Match on the code, never on the message.