Skip to main content
POST
/
api
/
v1
/
trading
/
execution
/
demo
/
market-open-orders
/
by-units
Places a Market Order to open a position by specifying the number of units you would like to trade.
curl --request POST \
  --url https://public-api.etoro.com/api/v1/trading/execution/demo/market-open-orders/by-units \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-request-id: <x-request-id>' \
  --header 'x-user-key: <x-user-key>' \
  --data '
{
  "InstrumentID": 123,
  "IsBuy": true,
  "Leverage": 123,
  "AmountInUnits": 123,
  "StopLossRate": 123,
  "TakeProfitRate": 123,
  "IsTslEnabled": true,
  "IsNoStopLoss": true,
  "IsNoTakeProfit": true
}
'
{
  "orderForOpen": {
    "instrumentID": 100000,
    "amount": 0,
    "amountInUnits": 0.001,
    "isBuy": true,
    "leverage": 1,
    "stopLossRate": 0,
    "takeProfitRate": 0,
    "isTslEnabled": false,
    "mirrorID": 0,
    "totalExternalCosts": 0,
    "lotCount": 0,
    "orderID": 13906629,
    "orderType": 18,
    "statusID": 1,
    "CID": 7765437,
    "openDateTime": "2025-04-02T15:56:50.7496838Z",
    "lastUpdate": "2025-04-02T15:56:50.7496838Z"
  },
  "token": "43ceb769-cff6-45ec-8ad7-292b7401353f"
}

Headers

x-request-id
string<uuid>
required

A unique request identifier.

Example:

"43860071-024b-4df9-b04b-42aaadecd0e5"

x-api-key
string<password>
required

API key for authentication.

Example:

"lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663"

x-user-key
string<password>
required

User-specific authentication key.

Example:

"eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_"

Body

application/json
InstrumentID
integer<int32>
required

The unique identifier of the financial instrument to trade.

IsBuy
boolean
required

True for a long position, false for a short position.

Leverage
integer<int32>
required

The leverage multiplier for the trade.

AmountInUnits
number<double>
required

The number of units of the asset. Required if Amount is not provided. For most assets this can be a fractional number. Note that for Future Contracts this number should indicate the number of underlying units, and not the number of contracts, according to the formula: AmountInUnits = contract multiplier * number of contracts.

StopLossRate
number<double> | null

The stop-loss trigger price at which the position will generate a Market Order to close (after it was opened). StopLoss trigger price must be worse than current price.

TakeProfitRate
number<double> | null

The take-profit trigger price at which the position will generate a Market Order to close (after it has opened). TakeProfit trigger price must be better than the current price.

IsTslEnabled
boolean | null

Indicates if a trailing stop loss (TSL) is enabled. This means that the stoploss rate indicated will get updated automatically whenever the asset price increases (for long positions) or decreases (for short position) effectively keeping the stoploss in a constant gap from the best price achieved so far.

IsNoStopLoss
boolean | null

True if no stop-loss is set for this order.

IsNoTakeProfit
boolean | null

True if no take-profit is set for this order.

Response

200 - application/json

Successfully opened a market order.

orderForOpen
object
token
string<uuid>

A unique confirmation token for the order.