Skip to main content

Place Your First Trade

Send a minimal trading request and process the asynchronous ACK, event, and status flow.

Important: trading is asynchronous

Mutating trading methods return an ACK first. ACK means the request was accepted for processing. The final result is delivered through server events as a transaction_event and can also be read from operation status.

Prerequisites

  • Use an Exness API key, not an Info API key.
  • Use a non-empty idempotency key for mutating requests.
  • Check account state, instrument state, trading sessions, volume limits, and margin before sending the request.
  • Subscribe to transaction events or poll operation status for final result.

Minimal trading flow

  1. 1
    Read account and instrument configuration.
  2. 2
    Subscribe to transaction events.
  3. 3
    Send the open-position request with a non-empty idempotency key.
  4. 4
    Store operation_id and client_request_id from the ACK.
  5. 5
    Wait for transaction_event or poll operation status.
  6. 6
    Update local state only after final result.

Example

curl -X POST "https://api.exness.com/v1/trading/accounts/123456/positions" \
-H "Content-Type: application/json" \
-H "EXN-API-KEY: exnsk_your_public_api_key" \
-H "EXN-IDEMPOTENCY-KEY: order-2026-06-22-0001" \
-H "EXN-TIMESTAMP: 1773656070123" \
-H "EXN-SIGN-VERSION: 1" \
-H "EXN-DATA: <base64url_encoded_payload>" \
-H "EXN-SIGN: <base64url_encoded_signature>" \
-d '{
"instrument": "EURUSD",
"side": "buy",
"volume": "0.10"
}'
{
"operation_id": "789",
"client_request_id": "order-2026-06-22-0001",
"status": "pending"
}
Use API Reference for exact request schema

Field names and enum values must match the approved YAML.

Common errors

Codeerror_messageClient action
4001MARKET_TRADE_DISABLEDCheck account and instrument trade mode before retrying.
4002MARKET_CLOSE_ONLYOnly close positions or cancel orders.
5000TRADING_RULE_INVALID_VOLUMECheck volume_min, volume_max, and volume_step.
5005TRADING_RULE_NO_MONEYReduce volume or close exposure.
6000EXECUTION_MARKET_CLOSEDRetry only when the market is open.
6001EXECUTION_PRICE_OFFWait for a fresh tick and retry only if still intended.