v1

latestOpenAPI 3.0.12026-07-26171200932.8 KB
Deprecated

Get Order Information and Position Details for Demo Account

Deprecated: This endpoint is no longer present in the current eToro Public API Swagger. Prefer the current replacement endpoints where available.

Retrieves comprehensive information about a specific order for opening a position, including the order status, execution details, and all positions that were opened from this order. This endpoint is essential for tracking order execution and identifying which positions were created as a result of a specific order request. The response includes detailed position information with PositionID values that can be used to query position-specific details.

get/api/v1/trading/info/demo/orders/{orderId}

Path parameters

orderIdinteger required

The unique identifier of the order for opening a position. This is the OrderID that was returned when the order was initially created.

Headers

x-request-idstring uuid required
Example:d2821231-fe26-4031-9c20-337104b4efaa

A unique request identifier.

x-api-keystring password required
Example:lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663

API key for authentication.

x-user-keystring password required
Example:eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_

User-specific authentication key.

Response

Successfully retrieved order information and associated position details.

tokenstring

Tracking token for the request, used for correlation and debugging purposes. This token is generated by the system and can be used to track the request through various system components.

orderIDinteger required

The unique identifier of the order. This is the same OrderID that was provided in the request path parameter.

CIDinteger required

Customer ID (CID) associated with the order. This identifies the user account that created the order.

referenceIDstring

Reference tracking ID for the order request.

statusIDinteger required

Current status of the order. Common values: 0 = Pending, 1 = Executed, 2 = Cancelled, 3 = Rejected, 4 = Partially Executed. The exact meaning of status codes may vary based on order type and system configuration.

orderTypeinteger required

Type of the order. Common values: 1 = Market Order, 2 = Limit Order, 3 = Stop Order. The exact order types depend on the trading system configuration.

openActionTypeinteger

The action type that triggered the order creation. This indicates the reason or context for opening the position, such as manual trade, copy trading, automated strategy, etc.

errorCodeinteger

Error code if the order execution failed or encountered an error. This field is null if the order was successful. Error codes are system-specific and should be referenced against the system's error code documentation.

errorMessagestring nullable

Human-readable error message describing any error that occurred during order processing. This field is null if the order was successful. Provides additional context beyond the errorCode.

instrumentIDinteger required

The unique identifier of the financial instrument that the order was placed for. This corresponds to the instrument being traded (e.g., stock, currency pair, commodity).

amountnumber

The USD amount that was requested to be invested in the position. This represents the monetary value allocated to the order.

unitsnumber

The number of units that were requested to be traded. If the order was placed by units rather than amount, this value represents the requested quantity.

requestOccurredstring date-time required

The timestamp when the order request was initially created and submitted to the system. This is in ISO 8601 format (UTC).

Example response

{
  "token": "550e8400-e29b-41d4-a716-446655440000",
  "orderID": 123456789,
  "CID": 987654321,
  "referenceID": "00000000-0000-0000-0000-000000000000",
  "statusID": 1,
  "orderType": 1,
  "openActionType": 1,
  "instrumentID": 67890,
  "amount": 1000,
  "units": 10.5,
  "requestOccurred": "2024-01-15T10:30:00Z",
  "positions": [
    {
      "positionID": 9876543210,
      "orderType": 1,
      "occurred": "2024-01-15T10:30:15Z",
      "rate": 1.2345,
      "units": 10.5,
      "conversionRate": 1,
      "amount": 1000,
      "isOpen": true
    }
  ]
}