### Signed GET request example Source: https://www.exness-api.com/reference/trading/exness-trader-api Example of a signed GET request to retrieve account configuration. Note that the idempotency key is an empty string for signed GET requests. ```http GET /v1/configuration/accounts/123456789/account HTTP/1.1 EXN-API-KEY: exnsk-live-example EXN-IDEMPOTENCY-KEY: EXN-TIMESTAMP: 1773656070123 EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### HTTP request example for GET /v1/partnership/reports/clients Source: https://www.exness-api.com/partnership/guides/reports Request-shape example for the Clients report. Replace authentication placeholders with a fresh signature. ```http GET /v1/partnership/reports/clients?limit=100&offset=0 HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### GET /v1/accounts/{account_id}/balance - Example Request Source: https://www.exness-api.com/payments/get-started/send-first-request Structural example of a GET request to read an account balance. Replace placeholders in angle brackets with your values. The EXN-IDEMPOTENCY-KEY header is present with an empty value, and the signed idempotency_key field is an empty string. The request has no body, so the signed body_hash is the SHA-256 hash of the empty string: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU. The signed path is exactly as sent. ```http GET /v1/accounts/8066808/balance HTTP/1.1 EXN-API-KEY: EXN-IDEMPOTENCY-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### Signed Request Example Source: https://www.exness-api.com/authentication/request-signing Example of a signed GET request to the Exness API, demonstrating the required EXN-* headers and the EXN-DATA payload structure. ```APIDOC ## [GET] /v1/configuration/accounts/{account_id}/account ### Description Retrieves account details for a specific account. This endpoint requires a signed request with the EXN-* headers. ### Method GET ### Endpoint https://ap-4decef67.exness.com/v1/configuration/accounts/{account_id}/account ### Parameters #### Path Parameters - **account_id** (string) - Required - The account identifier. #### Headers - **EXN-API-KEY** (string) - Required - Public API key identifier. Must match `api_key` inside `EXN-DATA`. - **EXN-IDEMPOTENCY-KEY** (string) - Required - Empty for signed GET requests. - **EXN-TIMESTAMP** (string) - Required - Unix timestamp in milliseconds. Must match `timestamp` inside `EXN-DATA`. - **EXN-SIGN-VERSION** (string) - Required - Signature protocol version. Current value: `1`. - **EXN-DATA** (string) - Required - Base64url-encoded signed payload without `=` padding. - **EXN-SIGN** (string) - Required - Ed25519 signature of the decoded `EXN-DATA` payload bytes, base64url-encoded without `=` padding. ### Request Example ```bash curl -X GET "https://ap-4decef67.exness.com/v1/configuration/accounts/123456/account" \ -H "EXN-API-KEY: exnsk_your_public_api_key" \ -H "EXN-IDEMPOTENCY-KEY:" \ -H "EXN-TIMESTAMP: 1773656070123" \ -H "EXN-SIGN-VERSION: 1" \ -H "EXN-DATA: " \ -H "EXN-SIGN: " ``` ### EXN-DATA Payload Example ```json { "api_key": "exnsk_your_public_api_key", "idempotency_key": "", "timestamp": 1773656070123, "sign_version": 1, "method": "GET", "path": "/v1/configuration/accounts/123456/account", "body_hash": "47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU" } ``` ### Response #### Success Response (200) No response schema is provided in the source documentation. ### Error Handling | Code | `error_message` | Client action | | --- | --- | --- | | 1000 | `AUTH_INVALID_API_KEY` | Check `EXN-API-KEY`, key expiry, and `api_key` inside `EXN-DATA`. | | 1001 | `AUTH_INVALID_SIGNATURE` | Check `EXN-DATA`, `EXN-SIGN`, private key, payload serialization, body hash, timestamp, and base64url encoding. | | 1002 | `AUTH_PERMISSION_DENIED` | Check account access, source IP restrictions, and API key permissions. | ``` -------------------------------- ### TypeScript helper example for signed requests Source: https://www.exness-api.com/trading/guides/code-examples Loads configuration and signed auth from environment, builds signed headers for a GET request to the account details endpoint, and prints the headers and account details. Uses helper functions from './lib/config.js', './lib/http.js', and './lib/signing.js'. ```typescript import { loadExampleConfig } from './lib/config.js'; import { loadSignedAuthFromEnv, requestJson } from './lib/http.js'; import { buildSignedHeaders } from './lib/signing.js'; type AccountDetailsResponse = Record; const config = loadExampleConfig(); const auth = await loadSignedAuthFromEnv(); const path = `/v1/configuration/accounts/${config.accountId}/account`; const headers = await buildSignedHeaders({ apiKey: auth.apiKey, privateKey: auth.privateKey, method: 'GET', pathWithQuery: path, body: '', idempotencyKey: '', }); console.log('Signed headers example:'); console.log(JSON.stringify(headers, null, 2)); const account = await requestJson({ baseUrl: config.discoveryBaseUrl, method: 'GET', path, auth, }); console.log('Account details:'); console.log(JSON.stringify(account, null, 2)); ``` -------------------------------- ### Signed GET Request Source: https://www.exness-api.com/reference/trading/exness-trader-api Example of a signed GET request to retrieve account configuration, demonstrating the required EXN-* headers and the decoded EXN-DATA payload. ```APIDOC ## GET /v1/configuration/accounts/{accountId}/account ### Description Retrieves the configuration for a specific account. The request must be signed using the EXN-* headers. ### Method GET ### Endpoint /v1/configuration/accounts/{accountId}/account ### Parameters #### Path Parameters - **accountId** (integer) - Required - The account identifier. #### Request Headers - **EXN-API-KEY** (string) - Required - The public API key. - **EXN-IDEMPOTENCY-KEY** (string) - Required - Must be an empty string for signed GET requests. - **EXN-TIMESTAMP** (integer) - Required - Unix time in milliseconds. - **EXN-SIGN-VERSION** (string) - Required - Must be `1`. - **EXN-DATA** (string) - Required - Base64url-encoded JSON payload containing the signed fields. - **EXN-SIGN** (string) - Required - Ed25519 signature of the decoded EXN-DATA payload. ### Request Example ```http GET /v1/configuration/accounts/123456789/account HTTP/1.1 EXN-API-KEY: exnsk-live-example EXN-IDEMPOTENCY-KEY: EXN-TIMESTAMP: 1773656070123 EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` ### Response #### Success Response (200) - The response is not specified in the source. #### Response Example Not provided in the source. ### Error Handling Authentication errors use the public error model. Clients should use `error.code` and `error_message` as the stable contract and must not rely on internal diagnostic text. ``` -------------------------------- ### GET /v1/transfers/{transfer_id} - Example HTTP Request Source: https://www.exness-api.com/payments/guides/transfer-status Structural example of a GET request to check a transfer status. Replace placeholders in angle brackets with your values. The EXN-IDEMPOTENCY-KEY header is sent with an empty value for this GET request. ```http GET /v1/transfers/2000000074 HTTP/1.1 EXN-API-KEY: EXN-IDEMPOTENCY-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### GET /v1/partnership/referral-agent-links request Source: https://www.exness-api.com/partnership/guides/referral-agents HTTP request example for the Partnership Referral Agent Links API. Replace authentication placeholders with a fresh signature. ```http GET /v1/partnership/referral-agent-links HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### Example HTTP request to GET /v1/partnership/autorebates/payments Source: https://www.exness-api.com/partnership/guides/autorebates Shows the request shape for the auto-rebates payments endpoint. Replace the authentication placeholders with a fresh signature before sending. ```http GET /v1/partnership/autorebates/payments HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### Signed POST request example Source: https://www.exness-api.com/reference/trading/exness-trader-api Example of a signed POST request to create an order. Includes required EXN-* headers and a placeholder for the base64url-encoded payload and signature. ```http POST /v1/trading/accounts/123456789/orders HTTP/1.1 EXN-API-KEY: exnsk-live-example EXN-IDEMPOTENCY-KEY: order-20260316-0001 EXN-TIMESTAMP: 1773656070123 EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: Content-Type: application/json ``` -------------------------------- ### curl request to access-point endpoint Source: https://www.exness-api.com/trading/get-started/access-point-host-discovery Use this request-shape example only when the separate Access Point / Host Discovery YAML confirms the endpoint contract. It sends a GET request to the /v1/trading/access-point endpoint with required headers including EXN-API-KEY, EXN-IDEMPOTENCY-KEY, EXN-TIMESTAMP, EXN-SIGN-VERSION, EXN-DATA, and EXN-SIGN. ```bash curl -X GET "https://api.exness.com/v1/trading/access-point?account_id=123456" \ -H "EXN-API-KEY: exnsk_your_public_api_key" \ -H "EXN-IDEMPOTENCY-KEY:" \ -H "EXN-TIMESTAMP: 1773656070123" \ -H "EXN-SIGN-VERSION: 1" \ -H "EXN-DATA: " \ -H "EXN-SIGN: " ``` -------------------------------- ### Run first-request.mjs with Node.js Source: https://www.exness-api.com/partnership/guides/code-examples Run the example script after setting the required environment variables (EXN_API_BASE_URL, EXN_API_KEY, EXN_PRIVATE_KEY_FILE, EXN_REQUEST_TIMEOUT_MS). Requires Node.js 22 or later. ```bash node first-request.mjs ``` -------------------------------- ### Main entry point for default link example Source: https://www.exness-api.com/partnership/guides/code-examples Reads EXN_API_BASE_URL, EXN_API_KEY, EXN_PRIVATE_KEY_FILE, and EXN_REQUEST_TIMEOUT_MS from environment variables. Requires all to be set with a positive integer timeout. Loads the private key PEM file, calls getDefaultLink with an AbortSignal.timeout, and prints the result as JSON. On error, prints the apiError object or the error message and sets exit code 1. ```javascript async function main() { const baseUrl = process.env.EXN_API_BASE_URL; const apiKey = process.env.EXN_API_KEY; const keyFile = process.env.EXN_PRIVATE_KEY_FILE; const timeoutMs = Number(process.env.EXN_REQUEST_TIMEOUT_MS); if (!baseUrl || !apiKey || !keyFile || !Number.isSafeInteger(timeoutMs) || timeoutMs <= 0) { throw new Error('Set EXN_API_BASE_URL, EXN_API_KEY, EXN_PRIVATE_KEY_FILE and a positive EXN_REQUEST_TIMEOUT_MS'); } const privateKeyPem = await readFile(keyFile, 'utf8'); const result = await getDefaultLink({baseUrl, apiKey, privateKeyPem, signal: AbortSignal.timeout(timeoutMs)}); console.log(JSON.stringify(result, null, 2)); } if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) { main().catch(error => { console.error(error.apiError ? JSON.stringify(error.apiError, null, 2) : error.message); process.exitCode = 1; }); } ``` -------------------------------- ### curl GET request with EXN-* headers Source: https://www.exness-api.com/authentication/request-signing Example of a signed GET request to the Exness API. The EXN-IDEMPOTENCY-KEY header is empty for GET requests, and the EXN-DATA and EXN-SIGN headers contain base64url-encoded payload and signature without padding. ```bash curl -X GET "https://ap-4decef67.exness.com/v1/configuration/accounts/123456/account" \ -H "EXN-API-KEY: exnsk_your_public_api_key" \ -H "EXN-IDEMPOTENCY-KEY:" \ -H "EXN-TIMESTAMP: 1773656070123" \ -H "EXN-SIGN-VERSION: 1" \ -H "EXN-DATA: " \ -H "EXN-SIGN: " ``` -------------------------------- ### Example JSON response with account configuration Source: https://www.exness-api.com/trading/get-started/send-first-request This is an example of a successful response from the API, showing account details such as currency, leverage, margin call level, and stop-out level. The exact fields may vary; always refer to the API Reference documentation for the definitive response structure. ```json { "account_id": 123456, "currency": "USD", "leverage": "1:2000", "margin_call_level": "60", "stop_out_level": "0" } ``` -------------------------------- ### HTTP request for GET /v1/partnership/reports/progress-reward Source: https://www.exness-api.com/partnership/guides/partner-tiers Request-shape example for the progress-reward report. Replace the authentication placeholders with a fresh signature. ```http GET /v1/partnership/reports/progress-reward HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### Python: Calculate REST capacity for openPosition Source: https://www.exness-api.com/trading/guides/api-configuration-and-limits Python example showing how to fetch limits, find the matching method by api_operation_id, and check local request count before sending a request. ```python limits_response = client.get(f"/v1/configuration/accounts/{account_id}/limits") method_limits = next( item for item in limits_response["limits"]["rest"]["methods"] if item["api_operation_id"] == "openPosition" ) limit = method_limits["rate_limit"]["limit"] window_seconds = method_limits["rate_limit"]["window_seconds"] if local_request_count("openPosition", window_seconds) < limit: send_open_position_request() else: wait_until_capacity_is_available() ``` -------------------------------- ### Pseudo-code for recommended integration flow Source: https://www.exness-api.com/trading/get-started/recommended-integration-flow Illustrates the recommended sequence of API calls and event subscriptions for a typical Exness API integration. It covers loading credentials, fetching limits and instruments, subscribing to transactions, instruments, HMR, and ticks, opening a position, and handling the final result or error. Includes a reconnect handler that resubscribes and reconciles with the trading snapshot. ```python credentials = load_credentials() base_url = load_configured_api_host() 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() ``` -------------------------------- ### Set environment variables for Exness API authentication Source: https://www.exness-api.com/authentication/api-key-and-host-setup Example of setting environment variables for the Exness API. The values are placeholders; use the private-key input required by your signer. A file path and the contents of a private key are different inputs. ```bash export EXN_API_KEY="exnsk_your_public_api_key" export EXN_PRIVATE_KEY="your_private_secret_key" export EXN_ACCOUNT_ID="123456" export EXN_API_BASE_URL="https://api.exness.com" ``` -------------------------------- ### GET /v1/partnership/reports/conversion Source: https://www.exness-api.com/partnership/guides/reports Analyzes the client acquisition-to-reward funnel by a single grouping. This example shows how to repeat the 'tags' query parameter for multiple values and group results by country. ```APIDOC ## GET /v1/partnership/reports/conversion ### Description Analyzes the client acquisition-to-reward funnel by a single grouping. This example shows how to repeat the 'tags' query parameter for multiple values and group results by country. ### Method GET ### Endpoint /v1/partnership/reports/conversion ### Parameters #### Query Parameters - **group_by** (string) - Required - Grouping dimension, e.g., 'country'. - **date_from** (string) - Required - Start date in YYYY-MM-DD format. - **date_to** (string) - Required - End date in YYYY-MM-DD format. - **tags** (string) - Optional - Repeatable query parameter for filtering by tags, e.g., 'tags=spring&tags=email'. ### Request Example ```http GET /v1/partnership/reports/conversion?group_by=country&date_from=2026-07-01&date_to=2026-07-30&tags=spring&tags=email HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` ### Response #### Success Response (200) - **group_fields** (array of objects) - Grouping fields, e.g., [{"day":"2026-07-30"},{"country":"CY"}]. #### Response Example ```json { "group_fields": [ {"day": "2026-07-30"}, {"country": "CY"} ] } ``` ``` -------------------------------- ### Decoded EXN-DATA payload JSON Source: https://www.exness-api.com/authentication/request-signing Example of the decoded EXN-DATA payload for a signed GET request. The idempotency_key is an empty string, and the body_hash is the SHA-256 hash of the empty byte sequence. ```json { "api_key": "exnsk_your_public_api_key", "idempotency_key": "", "timestamp": 1773656070123, "sign_version": 1, "method": "GET", "path": "/v1/configuration/accounts/123456/account", "body_hash": "47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU" } ``` -------------------------------- ### Conversion tags example: GET /v1/partnership/reports/conversion Source: https://www.exness-api.com/partnership/guides/reports Shows how to repeat the `tags` query parameter for multiple values. The request groups results by country for the specified date range. Requires signing the query exactly as transmitted. ```http GET /v1/partnership/reports/conversion?group_by=country&date_from=2026-07-01&date_to=2026-07-30&tags=spring&tags=email HTTP/1.1 Host: EXN-API-KEY: EXN-TIMESTAMP: EXN-SIGN-VERSION: 1 EXN-DATA: EXN-SIGN: ``` -------------------------------- ### GET /v1/partnership/partner/summary Source: https://www.exness-api.com/reference/partnership/get-partner-summary Returns the partner profile summary including identity, entity, country, accounts, reward and equity totals, client count, permissions, reward schemas, and default link. Use it as the starting point for partner-level integrations. ```APIDOC ## GET /v1/partnership/partner/summary ### Description Return the partner profile summary, including identity, entity, country, accounts, reward and equity totals, client count, permissions, reward schemas, and default link. Use it as the starting point for partner-level integrations. ### Method GET ### Endpoint /v1/partnership/partner/summary ### Required Scopes - `partnership.all:read` or `partnership.all` ### Rate Limits - This operation counts toward the shared limit of **600 requests per 60 seconds per partner**, across all of the partner's API keys and all Partnership API operations. ### Consistency and Recovery Notes - For temporary errors, retry the request with backoff and fresh authentication headers. Honor `Retry-After` when returned. For authentication or access errors, correct the cause before retrying. See Troubleshooting for code-specific actions. ### Possible Errors - `Throttled` - `ServiceTransportError` - `Error` - `AuthenticationFailed` - `PermissionDenied` - `ValidationError` ### Responses - 200 - Successful response. - 400 - Bad request or validation error. The response uses either the numeric request-processing error response or the Partnership string-code error response. - 401 - Authentication failed. Authentication processing errors use numeric codes; a Partnership operation authentication error uses a string code. - 403 - Operation is not permitted for the authenticated API key, partner, or operation scope. - 429 - Rate limit exceeded. - 500 - The API or a service required by the operation could not complete the request. - 502 - The API could not complete the request to the Partnership service. - 503 - A required service is temporarily unavailable or the request deadline was exceeded. - 504 - A service required by the Partnership operation could not be reached or timed out. ### Response Headers - **Retry-After** - Seconds to wait before retrying when the API provides a throttle wait time. ```