v1

latestOpenAPI 3.0.12026-07-26171200932.8 KB
Trading - Demo

Create an order

Rate limit: 20 requests per 60 seconds. This is a shared quota — the same budget is consumed by a group of related endpoints, so calling any of them reduces what is left for the others (you cannot call each at the full rate independently). Endpoints sharing this quota:

  • DELETE /api/v1/trading/execution/demo/limit-orders/{orderId}
  • DELETE /api/v1/trading/execution/demo/market-close-orders/{orderId}
  • DELETE /api/v1/trading/execution/demo/market-open-orders/{orderId}
  • DELETE /api/v2/trading/execution/demo/orders/{orderId}
  • POST /api/v1/trading/execution/demo/limit-orders
  • POST /api/v1/trading/execution/demo/market-close-orders/positions/{positionId}
  • POST /api/v1/trading/execution/demo/market-open-orders/by-amount
  • POST /api/v1/trading/execution/demo/market-open-orders/by-units

This endpoint allows traders to place an order. Leverage, stop-loss, and take-profit settings can be applied. Order size must use exactly one of amount, units, or contracts. For open orders the instrument must be identified by exactly one of symbol or instrumentId - providing both is rejected. A unique X-Request-Id header (GUID) is required for idempotency. Currently only orders to open a position are supported.

post/api/v2/trading/execution/demo/orders

Headers

x-request-idstring uuid required
Example:fc51a35e-51e5-4a25-9230-4b17afe56f04

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.

Request body

action'open' | 'close' required

The order action type. Possible values: open, close.

transaction'buy' | 'sell' | 'sellShort' | 'buyToCover' required

The transaction direction. Possible values: buy, sell, sellShort, buyToCover.

symbolstring nullable

The asset ticker symbol. For open orders provide exactly one of symbol or instrumentId - providing both is rejected.

instrumentIdinteger nullable

The eToro instrument identifier. For open orders provide exactly one of symbol or instrumentId - providing both is rejected.

settlementType'cfd' | 'real' | 'realFutures' | 'marginTrade' nullable

The settlement type. Possible values: cfd, real, realFutures, marginTrade. Required for open orders.

orderType'mkt' | 'mit'

The order execution type. Possible values: mkt (market), mit (market if touched).

triggerRatenumber double nullable

The trigger rate for mit orders. Required for mit orders.

leverageinteger nullable

The leverage multiplier to apply. Required for open orders.

amountnumber double nullable

The monetary amount to invest in the order currency. Mutually exclusive with units and contracts.

orderCurrencystring nullable

The currency for the order amount. Typically usd.

unitsnumber double nullable

The number of units to trade. Mutually exclusive with amount and contracts.

contractsnumber double nullable

The number of contracts to trade. Mutually exclusive with amount and units.

stopLossRatenumber double nullable

The stop-loss rate at which the position will automatically close.

takeProfitRatenumber double nullable

The take-profit rate at which the position will automatically close.

stopLossType'fixed' | 'trailing' nullable

The stop-loss type. Possible values: fixed, trailing.

additionalMarginnumber double nullable

Additional margin to allocate to the position.

positionIdsinteger[] nullable

List of position IDs to close. Required for close orders.

Example request

{
  "action": "open",
  "transaction": "buy",
  "symbol": "AAPL",
  "instrumentId": 101,
  "settlementType": "cfd",
  "orderType": "mkt",
  "leverage": 2,
  "amount": 1000,
  "orderCurrency": "usd",
  "stopLossRate": 1.2,
  "takeProfitRate": 1.5,
  "stopLossType": "fixed"
}

Response

Order submitted successfully. Returns the created order details.

tokenstring uuid

A tracking token for the order request, used for correlation and debugging.

orderIdinteger

The unique identifier of the created order.

referenceIdstring uuid

The client reference identifier for the order, matching the X-Request-Id header if provided.

Example response

{
  "token": "066faaee-e1e9-49d2-a568-c6e1cc336ad8",
  "orderId": 13902598,
  "referenceId": "1c94300c-90aa-4303-9d00-dec376d74efb"
}