v1

latestOpenAPI 3.0.12026-07-26171200932.8 KB
Trading - Demo

Get what-if trading cost breakdown

Rate limit: 20 requests per 60 seconds. This is a dedicated limit for this endpoint — it is not shared with (pooled across) any other endpoint, so the full rate is available to this endpoint alone.


Returns the markup, market spread, transaction fee, overnight fee, over-weekend fee, and SDRT that would apply if the supplied order were executed now against the demo account. For action: open, exactly one of symbol or instrumentId must be provided and leverage must be at least 1. For action: close, positionIds must be non-empty.

post/api/v2/trading/info/demo/costs

Headers

x-request-idstring uuid required
Example:96553ce8-0cd3-4a5e-9021-0b0fe8cd36ec

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

Cost breakdown resolved successfully.

instrumentIdinteger

Identifier of the instrument the cost breakdown applies to.

symbolstring nullable

Symbol of the instrument

lastUpdatedstring date-time

Timestamp (ISO 8601) at which the cost figures were generated.