Skip to main content

Recommended Integration Flow

A high-level implementation path that connects onboarding, host selection, state sync, market data, trading, and error handling.

  1. 1
    Create and securely store API credentials.
  2. 2
    Use the DNS widget Gateway host to resolve the account Access Point before any Trader API REST request or WebSocket connection.
  3. 3
    Build signed requests using the exact path and query, then read account details to check the connection.
  4. 4
    Request effective API limits, throttling, contract constants.
  5. 5
    Read account, instrument, and configuration data.
  6. 6
    Connect to the appropriate WebSocket stream for transaction events or market data.
  7. 7
    Send trading requests with non-empty idempotency keys.
  8. 8
    Process ACK, transaction_event, and operation status.
  9. 9
    Handle errors using HTTP status, Public API error code, and client action.
  10. 10
    Monitor margin, HMR, rate limits, and client tiers when final source is available.

Example pseudo-code​

credentials = load_credentials()
# Pseudo-code helpers: discovery sends a signed GET with account_id.
gateway_url = load_dns_widget_gateway_host()
access_point = resolve_trading_access_point(gateway_url, account_id, credentials)
base_url = access_point["access_point"]
# Use base_url for the account REST requests and its host for WebSockets.
account = get_account(account_id)
limits = get_limits(account_id)
configure_client_rate_limits(limits)
instruments = get_available_instruments(account_id)
conditions = get_instrument_conditions(account_id, "EURUSD")
subscribe("transactions", account_id)
trading_state = wait_for_initial_trading_state_snapshot()
subscribe("instruments", account_id, instruments=["EURUSD"])
subscribe("hmr", account_id, instruments=["EURUSD"])
subscribe("ticks", account_id, instruments=["EURUSD"])
last_tick = wait_for_initial_tick("EURUSD")
operation = open_position(account_id, instrument="EURUSD", side="buy", volume="0.10", idempotency_key=new_key())
final_result = wait_for_transaction_event(operation.operation_id) or poll_operation_status(operation.operation_id)
handle_result_or_error(final_result)
on_reconnect:
resubscribe()
reconcile_with_trading_snapshot()

Decision points​

DecisionPreferred behavior
Need read-only integration?Use Info API key and avoid mutating endpoints.
Need trading integration?Use Exness API key, idempotency, and async event processing.
Need request limits?Use GET /v1/configuration/accounts/{account_id}/limits.
Temporary error?Retry with backoff only when safe.
Validation/business error?Change request or account state before retrying.