Skip to content

Read order by id#

About#

Returns specific open order for a MetaTrader account

GET /users/current/accounts/:accountId/orders/:orderId

For more information see Swagger documentation. Note, that this URL is valid for new-york region only. You can find URLs for other regions on API access page.

Headers#

Name Type Required Description
auth-token string Yes authorization token. See Authentication & authorization

Path parameters#

Name Type Required Description
accountId string Yes MetaTrader account id. You can retrieve account id from Web application after you add your MetaTrader account to our platform. The account id can also be obtained via Provisioning API
orderId string Yes order id (ticket number)

Query parameters#

Name Type Required Description
refreshTerminalState boolean whether to refresh terminal state before retrieving the data, slowing down the request. Defaults to false

Responses:

  • 200 - Order for a specified MetaTrader account returned successfully. Response schema: MetatraderOrder
  • 401 - Authorization failed. Response schema: Error
  • 404 - MetaTrader account not found or not provisioned yet or requested order does not exist. Response schema: Error

Examples#

Example request:

curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://mt-client-api-v1.new-york.agiliumtrade.ai/users/current/accounts/865d3a4d-3803-486d-bdf3-a85679d9fad2/orders/47067192'

Example response:

{
  "id": "47067192",
  "type": "ORDER_TYPE_BUY_LIMIT",
  "state": "ORDER_STATE_PLACED",
  "symbol": "AUDNZD",
  "magic": 123456,
  "time": "2020-04-21T07:39:18.904Z",
  "brokerTime": "2020-04-21 10:39:18.904",
  "openPrice": 1.05235,
  "currentPrice": 1.05335,
  "platform": "mt5",
  "volume": 0.01,
  "currentVolume": 0.01
}