# Archive Account > Archive a trading account by ID. Archived accounts are no longer treated as active trading accounts. Source: /admin/accounts-funding/accounts/accounts-service_-account-archive ## `DELETE /accounts/{id}` **Archive Account** Archive a trading account by ID. Archived accounts are no longer treated as active trading accounts. Tags: `Accounts` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Empty response payload returned by RPCs that have no data to return. `object` #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Create Account > Create a new trading account for a client profile. The account defines the client trading environment, including group and currency settings. Source: /admin/accounts-funding/accounts/accounts-service_-account-create ## `POST /accounts` **Create Account** Create a new trading account for a client profile. The account defines the client trading environment, including group and currency settings. Tags: `Accounts` ### Request body The account to be created. **Content-Type:** `application/json` - `id` (string) - `groupId` (string) - `profileId` (string) - `currency` (string) - `positionMode` (string) - enum: `POSITIONING_MODE_UNSPECIFIED`, `POSITIONING_MODE_NETTING`, `POSITIONING_MODE_HEDGING` - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `nop` (number) - `balance` (number) - `maxLeverage` (string) - `version` (string) - `isSb` (boolean) - `isDemo` (boolean) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` - `account` (object) — The created account. The created account. - `id` (string) - `groupId` (string) - `profileId` (string) - `currency` (string) - `positionMode` (string) - enum: `POSITIONING_MODE_UNSPECIFIED`, `POSITIONING_MODE_NETTING`, `POSITIONING_MODE_HEDGING` - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `nop` (number) - `balance` (number) - `maxLeverage` (string) - `version` (string) - `isSb` (boolean) - `isDemo` (boolean) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Get Account > Return the trading account properties for the specified account ID. Source: /admin/accounts-funding/accounts/accounts-service_-account-get ## `GET /accounts/{id}` **Get Account** Return the trading account properties for the specified account ID. Tags: `Accounts` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` - `id` (string) - `groupId` (string) - `profileId` (string) - `currency` (string) - `positionMode` (string) - enum: `POSITIONING_MODE_UNSPECIFIED`, `POSITIONING_MODE_NETTING`, `POSITIONING_MODE_HEDGING` - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `nop` (number) - `balance` (number) - `maxLeverage` (string) - `version` (string) - `isSb` (boolean) - `isDemo` (boolean) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Groups > Return the account groups available when creating or updating trading accounts. Source: /admin/accounts-funding/accounts/accounts-service_-account-group-list ## `GET /account-groups` **List Groups** Return the account groups available when creating or updating trading accounts. Tags: `Accounts` #### Query parameters - `id` (array) - `name` (string) - `currency` (string) - `status` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Paginated list of account groups matching the request filters. - `groups` (array) - items: - `id` (string) - `marginCallLevel` (number) - `stopOutLevel` (number) - `description` (string) - `name` (string) - `negativeBalanceProtect` (boolean) - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `externalGatewayId` (string) — Deprecated: routing decisions are owned by RoutingService; this field is no longer consulted. - `permissions` (array) - items: - `id` (string) - `enabled` (boolean) - `groupId` (string) - `symbolId` (string) - `marginTemplateId` (string) - `commissionTemplateId` (string) - `volumeTemplateId` (string) - `protectionTemplateId` (string) - `markupBid` (string) - `markupAsk` (string) - `maxNop` (string) - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `swapFree` (boolean) - `isDemo` (boolean) - `symbolProfileId` (string) - `marginCalculationType` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `marginRecalcScope` (string) - enum: `MARGIN_RECALC_SCOPE_UNSPECIFIED`, `MARGIN_RECALC_SCOPE_SYMBOL_IMPACT`, `MARGIN_RECALC_SCOPE_FULL` - `fundingProfileId` (string) - `statementHeading` (string) - `page` (string) - `perPage` (string) - `total` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Accounts > Return a list of trading accounts based on the provided search, filter, and pagination criteria. Source: /admin/accounts-funding/accounts/accounts-service_-account-list ## `GET /accounts` **List Accounts** Return a list of trading accounts based on the provided search, filter, and pagination criteria. Tags: `Accounts` #### Query parameters - `id` (array) - `profileId` (string) - `groupId` (string) - `currency` (string) - `status` (string) - `page` (string) - `perPage` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Page of trading accounts with pagination metadata. - `accounts` (array) - items: - `id` (string) - `groupId` (string) - `profileId` (string) - `currency` (string) - `positionMode` (string) - enum: `POSITIONING_MODE_UNSPECIFIED`, `POSITIONING_MODE_NETTING`, `POSITIONING_MODE_HEDGING` - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `nop` (number) - `balance` (number) - `maxLeverage` (string) - `version` (string) - `isSb` (boolean) - `isDemo` (boolean) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) - `page` (string) - `perPage` (string) - `total` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Update Account > Update an existing trading account. Use this to change account-level properties such as status, group, or other account configuration. Source: /admin/accounts-funding/accounts/accounts-service_-account-update ## `PUT /accounts/{accountId}` **Update Account** Update an existing trading account. Use this to change account-level properties such as status, group, or other account configuration. Tags: `Accounts` #### Path parameters - `accountId` (string) (required) — Required to identify the account to update ### Request body **Content-Type:** `application/json` - `groupId` (string) - `maxLeverage` (string) - `maxNop` (number) - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `dailyStatement` (boolean) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` - `id` (string) - `groupId` (string) - `profileId` (string) - `currency` (string) - `positionMode` (string) - enum: `POSITIONING_MODE_UNSPECIFIED`, `POSITIONING_MODE_NETTING`, `POSITIONING_MODE_HEDGING` - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `nop` (number) - `balance` (number) - `maxLeverage` (string) - `version` (string) - `isSb` (boolean) - `isDemo` (boolean) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Currencies > Return the account currencies supported for creating or configuring trading accounts. Source: /admin/accounts-funding/accounts/accounts-service_-options-currencies ## `GET /options/currencies` **List Currencies** Return the account currencies supported for creating or configuring trading accounts. Tags: `Accounts` ### Responses #### `200` — A successful response. **Content-Type:** `application/json` List of supported currencies with display metadata for account creation pickers. - `currencies` (array) - items: CurrencyMeta carries display metadata for a single currency. Added for currency metadata propagation to admin UI. - `code` (string) - `sign` (string) - `decimals` (integer) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Get Setting > Return a single client profile setting by profile ID and setting key. Source: /admin/accounts-funding/client--profiles/accounts-service_-get-client-settings ## `GET /profiles/{profileId}/settings/{key}` **Get Setting** Return a single client profile setting by profile ID and setting key. Tags: `Client Profiles` #### Path parameters - `profileId` (string) (required) — The client profile ID that owns this setting. - `key` (string) (required) — Setting key. Pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars. ### Responses #### `200` — A successful response. **Content-Type:** `application/json` ClientSettings represents a single key-value entry scoped to a client profile. This is a general-purpose store for per-profile data such as watchlists, UI preferences, notes, or account-level configuration. Keys must match ^[A-Za-z0-9_\-:#]+$ (max 256 chars). Values are arbitrary strings; callers typically encode structured data (e.g. JSON) before storing. The body accepted by the Trader REST endpoint is capped at 128 KB. - `profileId` (string) — The client profile ID that owns this setting. - `key` (string) — Setting key. Pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars. - `value` (string) — Stored string value. Callers may encode JSON or any text. Max ~128 KB via the REST endpoint. - `updatedAt` (string) — Timestamp of the last write. #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Accounts > Return all trading accounts owned by the specified client profile. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-accounts ## `GET /profiles/{id}/accounts` **List Accounts** Return all trading accounts owned by the specified client profile. Tags: `Client Profiles` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` All trading accounts owned by a profile, returned as portfolio snapshots. - `accounts` (array) - items: Snapshot of an account's balance, equity, free margin, and open P&L. - `accountId` (string) - `currency` (string) - `balance` (number) - `unrealizedPnl` (number) - `usedMargin` (number) - `pendingMargin` (number) - `accountVersion` (string) - `inMarginCall` (boolean) - `inStopOut` (boolean) - `positions` (array) - items: Net open exposure on a symbol for a single account, with average entry price, current floating P&L, and any attached protection (stop loss / take profit) levels. - `id` (string) - `symbolId` (string) - `accountId` (string) - `orderId` (string) - `symbolName` (string) - `openPrice` (number) - `openPriceRaw` (number) - `closePrice` (number) - `closePriceRaw` (number) - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED` - `commission` (number) - `swap` (number) - `profit` (number) - `units` (number) - `qty` (number) - `qtyClosed` (number) - `comment` (string) - `createdAt` (string) - `updatedAt` (string) - `realizedPnl` (number) - `unitsClosed` (number) - `usdPnl` (number) - `currentPrice` (number) - `margin` (number) - `fundingAccrued` (number) - `orders` (array) - items: A working or completed trading instruction on an account: market, limit, stop, or protection (SL/TP). Carries side, type, time-in-force, status, requested protection distances/prices, and the fill price once executed. - `id` (string) - `accountId` (string) - `groupId` (string) - `symbolId` (string) - `symbolName` (string) - `positionId` (string) - `clientOrderId` (string) - `ipAddress` (string) - `managerId` (string) - `parentOrderId` (string) - `cancelsOrderId` (string) - `venueId` (string) - `venueOrderId` (string) - `createdAt` (string) - `updatedAt` (string) - `expirationDate` (string) - `qtyOriginal` (number) - `qtyFilled` (number) - `seenPrice` (number) - `limitPrice` (number) - `stopPrice` (number) - `slippage` (number) - `isClosing` (boolean) — Is this a closing order - `trailingOffset` (string) - `trailingStep` (string) - `stopLossPts` (string) - `takeProfitPts` (string) - `stopLossPrice` (number) - `takeProfitPrice` (number) - `status` (string) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_STARTED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_ACCEPTED`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_PENDING_EXECUTION`, `ORDER_STATUS_P_FILLED`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED` - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `timeInForce` (string) - enum: `ORDER_TIF_UNSPECIFIED`, `ORDER_TIF_FILL_OR_KILL`, `ORDER_TIF_GOOD_TILL_CANCEL`, `ORDER_TIF_IMMEDIATE_OR_CANCEL`, `ORDER_TIF_GOOD_TILL_DATE`, `ORDER_TIF_GOOD_TILL_DAY` - `comment` (string) - `fillPrice` (number) - `fillPriceRaw` (number) - `unitsOriginal` (number) - `unitsFilled` (number) - `completed` (boolean) - `initialMargin` (number) - `triggerQuote` (object) — Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. - `symbolId` (string) - `bid` (number) - `ask` (number) - `volume` (string) - `datetime` (string) - `md` (string) - `groupId` (string) - `usdPnl` (number) - `maxLeverage` (string) - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `isSb` (boolean) - `isDemo` (boolean) - `profileId` (string) - `createdAt` (string) - `updatedAt` (string) - `nop` (number) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) - `total` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Change Password > Change the password used by a client profile to authenticate and access client-facing trading services. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-change-password ## `PUT /profiles/change-password` **Change Password** Change the password used by a client profile to authenticate and access client-facing trading services. Tags: `Client Profiles` ### Request body Sets a new password for the given profile. **Content-Type:** `application/json` Sets a new password for the given profile. - `id` (string) - `newPassword` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Empty response payload returned by RPCs that have no data to return. `object` #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Create Profile > Create a new client profile. Create one profile per client. A client profile can hold multiple trading accounts. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-create ## `POST /profiles` **Create Profile** Create a new client profile. Create one profile per client. A client profile can hold multiple trading accounts. Tags: `Client Profiles` ### Request body The client profile **Content-Type:** `application/json` The client profile - `id` (string) - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` The client profile - `id` (string) - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Delete Profile > Delete a client profile by ID. Use this when the client profile should no longer be available through the Accounts & Funding API. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-delete ## `DELETE /profiles/{id}` **Delete Profile** Delete a client profile by ID. Use this when the client profile should no longer be available through the Accounts & Funding API. Tags: `Client Profiles` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Empty response payload returned by RPCs that have no data to return. `object` #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Get Profile > Return the client profile properties, including profile identity details such as name and email, and the trading accounts linked to the profile. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-get ## `GET /profiles/{id}` **Get Profile** Return the client profile properties, including profile identity details such as name and email, and the trading accounts linked to the profile. Tags: `Client Profiles` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` The client profile - `id` (string) - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Profiles > Return a list of client profiles based on the provided search, filter, and pagination criteria. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-list ## `GET /profiles` **List Profiles** Return a list of client profiles based on the provided search, filter, and pagination criteria. Tags: `Client Profiles` #### Query parameters - `text` (string) — search text in firstname, lastname, email, phone and ID - `page` (string) — The page number to return - `pageSize` (string) — the max number of rows returned ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Page of matching profiles with pagination metadata. - `profiles` (array) - items: The client profile - `id` (string) - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) - `page` (string) - `total` (string) - `pages` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Update Profile > Replace the client profile data. Send the full updated profile object, including all fields that should remain on the profile. Source: /admin/accounts-funding/client--profiles/accounts-service_-profile-update ## `PUT /profiles/{profile.id}` **Update Profile** Replace the client profile data. Send the full updated profile object, including all fields that should remain on the profile. Tags: `Client Profiles` #### Path parameters - `profile.id` (string) (required) ### Request body profile The client profile **Content-Type:** `application/json` The client profile - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` The client profile - `id` (string) - `email` (string) - `firstName` (string) - `lastName` (string) - `ipAddress` (string) - `language` (string) - `address` (string) - `zipCode` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `metaData` (string) - `birthDate` (string) - `timezone` (string) - `password` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Update Setting > Create or update a single client profile setting by profile ID and setting key. Source: /admin/accounts-funding/client--profiles/accounts-service_-update-client-settings ## `PUT /profiles/{profileId}/settings/{key}` **Update Setting** Create or update a single client profile setting by profile ID and setting key. Tags: `Client Profiles` #### Path parameters - `profileId` (string) (required) — The client profile ID that owns this setting. - `key` (string) (required) — Setting key. Pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars. #### Query parameters - `value` (string) — Stored string value. Callers may encode JSON or any text. Max ~128 KB via the REST endpoint. - `updatedAt` (string) — Timestamp of the last write. ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Empty response payload returned by RPCs that have no data to return. `object` #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # List Deals > Return balance and trading deals for the specified account based on the provided criteria. Source: /admin/accounts-funding/funding/accounts-service_-deals-list ## `GET /accounts/{accountId}/deals` **List Deals** Return balance and trading deals for the specified account based on the provided criteria. Tags: `Funding` #### Path parameters - `accountId` (string) (required) #### Query parameters - `limit` (integer) - `from` (string) - `to` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Page of ledger deals for an account, with a flag indicating whether more remain. - `deals` (array) - items: Single ledger entry for an account: a trade execution (Buy/Sell) or a fund movement (ActionType = Balance for deposits/withdrawals). Carries the post-deal balance and any P&L, commission, and swap components. - `id` (string) - `symbolName` (string) - `comment` (string) - `accountId` (string) - `orderId` (string) - `positionId` (string) - `createdAt` (string) - `updatedAt` (string) - `symbolId` (string) - `closedVolume` (string) - `volume` (number) - `amount` (number) — Amount in account currency - `amountRaw` (number) - `closePrice` (number) - `closePriceRaw` (number) - `openPrice` (number) - `openPriceRaw` (number) - `margin` (number) - `commission` (number) - `commissionRaw` (number) - `action` (string) - enum: `DEAL_ACTION_UNSPECIFIED`, `DEAL_ACTION_BUY`, `DEAL_ACTION_SELL`, `DEAL_ACTION_CREDIT`, `DEAL_ACTION_CORRECTION`, `DEAL_ACTION_COMMISSION`, `DEAL_ACTION_DIVIDEND`, `DEAL_ACTION_TAX`, `DEAL_ACTION_BONUS`, `DEAL_ACTION_OTHER`, `DEAL_ACTION_SWAP`, `DEAL_ACTION_INTEREST`, `DEAL_ACTION_BALANCE`, `DEAL_ACTION_REBATE`, `DEAL_ACTION_FEE`, `DEAL_ACTION_FUNDING` - `direction` (string) - enum: `DEAL_DIRECTION_UNSPECIFIED`, `DEAL_DIRECTION_IN`, `DEAL_DIRECTION_OUT` - `userId` (string) - `clientDealId` (string) - `rawRate` (number) — FUNDING deals only; zero for other actions. side-selected provider rate, before rescale/markup - `appliedRate` (number) - `prevBalance` (number) — Account balance immediately before this deal is applied, in account currency, rounded to the currency's decimals. Together with new_balance these form a running ledger: summing (new_balance - prev_balance) over all deals reconstructs the account balance. - `newBalance` (number) — Account balance immediately after this deal is applied. - `fxRate` (number) — FX-conversion audit trail. Zero when no conversion ran. FxRate: clean mid rate (before markup). Internal. FxRateMarked: rate the customer was charged at (after markup). Customer-facing. FxMarkupAmount: captured FX spread (markup), signed (≤ 0), account currency. ALREADY embedded in `amount` via FxRateMarked — audit-only, NOT a separate ledger posting. Reconstruct the no-markup amount as `amount − fx_markup_amount`. - `fxRateMarked` (number) - `fxMarkupAmount` (number) - `fxRateComm` (number) — Per-leg FX audit fields for the commission leg (USD → account ccy). FxRate / FxRateMarked / FxMarkupAmount above carry the PnL-leg values on close deals (and are zero on open deals); these carry the commission-leg values regardless of open/close. All zero when the account is denominated in USD or when no commission is charged. - `fxRateCommMarked` (number) - `fxMarkupAmountComm` (number) - `amountUsd` (number) — USD denormalisation. Stamped at deal-write time and frozen. Audit-only — never participate in prev/new_balance. All rounded to USD decimals; zero pre-rollout or on rate miss. FxToUSD: mid rate accountCcy → USD (1.0 for USD accounts; 0 = not stamped). Notional USD = Volume * ContractSize * raw price * quoteCcy→USD; unsigned. - `commissionUsd` (number) - `fxMarkupAmountUsd` (number) - `fxMarkupAmountCommUsd` (number) - `fxToUsd` (number) - `notionalUsd` (number) - `priceMarkupAmountUsd` (number) - `hasMore` (boolean) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Deposit Funds > Create a deposit transaction that credits funds to the specified trading account. Source: /admin/accounts-funding/funding/accounts-service_-deposit-transaction ## `POST /accounts/{accountId}/deposit` **Deposit Funds** Create a deposit transaction that credits funds to the specified trading account. Tags: `Funding` #### Path parameters - `accountId` (string) (required) — The account id to deposit to ### Request body **Content-Type:** `application/json` Funding instruction to credit or debit an account's cash balance. amount is in the account's own currency and is rounded to that currency's decimals at write time. For the deposit/withdraw endpoints the sign is encoded in the URL and amount must be positive; the deprecated balance endpoint accepts a signed amount. comment is an optional free-text memo persisted on the resulting BALANCE deal. - `comment` (string) - `amount` (number) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Identifier of the BALANCE deal posted to the ledger. - `dealId` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Withdraw Funds > Create a withdrawal transaction that debits funds from the specified trading account. Source: /admin/accounts-funding/funding/accounts-service_-withdraw-transaction ## `POST /accounts/{accountId}/withdraw` **Withdraw Funds** Create a withdrawal transaction that debits funds from the specified trading account. Tags: `Funding` #### Path parameters - `accountId` (string) (required) — The account id to deposit to ### Request body **Content-Type:** `application/json` Funding instruction to credit or debit an account's cash balance. amount is in the account's own currency and is rounded to that currency's decimals at write time. For the deposit/withdraw endpoints the sign is encoded in the URL and amount must be positive; the deprecated balance endpoint accepts a signed amount. comment is an optional free-text memo persisted on the resulting BALANCE deal. - `comment` (string) - `amount` (number) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Identifier of the BALANCE deal posted to the ledger. - `dealId` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Accounts & Funding > REST API for brokers to onboard end-user clients, open trading accounts, and move funds. Used by CRMs, in-house back-office tools, and client cabinet/portal integrations. Source: /admin/accounts-funding **You can:** - Onboard a client (create a profile, attach trading accounts). - Deposit, withdraw, and post balance adjustments. - Read orders, positions, portfolios, and deal history. - Issue end-user access tokens so clients can call the [Trader API](/trader). This API does **not** configure platform-level objects (account groups, symbols, margin/commission templates). Those are managed by your Helio admins through the full Admin API. ## Prerequisites Before you start, make sure you have: - The **Helio admin endpoint** for your environment (provided by your Helio contact). - Either **(a)** a back-office username + password, or **(b)** a long-lived admin access token. - Your outbound **IP whitelisted** by Helio operations — non-whitelisted requests are rejected. ## Authentication Every request to this API must include a bearer admin token in the `Authorization` header: ```http Authorization: Bearer ``` Tokens are valid for **30 days**. Refresh by calling [Admin Login](/admin/accounts-funding/sessions/accounts-service_-user-login) again before expiry, or whenever a request returns `401 Unauthorized`. ### Obtain a token ```bash curl -X POST "$HELIO_ADMIN_URL/user/login" \ -H "Content-Type: application/json" \ -d '{"username": "ops@yourbroker.com", "password": "***"}' # => { "token": "eyJhbGciOi..." } ``` ```js const res = await fetch(`${process.env.HELIO_ADMIN_URL}/user/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username: 'ops@yourbroker.com', password: '***' }), }) const { token } = await res.json() ``` ```python res = requests.post( f"{os.environ['HELIO_ADMIN_URL']}/user/login", json={"username": "ops@yourbroker.com", "password": "***"}, ) token = res.json()["token"] ``` ```go body, _ := json.Marshal(map[string]string{ "username": "ops@yourbroker.com", "password": "***", }) res, _ := http.Post(os.Getenv("HELIO_ADMIN_URL")+"/user/login", "application/json", bytes.NewReader(body)) var out struct{ Token string `json:"token"` } json.NewDecoder(res.Body).Decode(&out) ``` ### Reuse the token Cache the token and pass it on every subsequent call: ```bash curl "$HELIO_ADMIN_URL/account-groups" \ -H "Authorization: Bearer $TOKEN" ``` ```js const res = await fetch(`${HELIO_ADMIN_URL}/account-groups`, { headers: { Authorization: `Bearer ${token}` }, }) ``` ```python res = requests.get( f"{HELIO_ADMIN_URL}/account-groups", headers={"Authorization": f"Bearer {token}"}, ) ``` ```go req, _ := http.NewRequest("GET", HELIO_ADMIN_URL+"/account-groups", nil) req.Header.Set("Authorization", "Bearer "+token) res, _ := http.DefaultClient.Do(req) ``` All requests must originate from a whitelisted IP. Calls from any other source are rejected at the edge before reaching this API. ## Onboard a client Onboarding a new client takes four calls. Keep the IDs returned at each step — later steps need them. ### Fetch reference data Currencies and account groups are configured by your Helio admins. Read what's available in your environment before creating accounts. - **`GET /options/currencies`**  →  the currencies an account can be denominated in. - **`GET /account-groups`**  →  the account groups a new account can be assigned to. Note each group's `id`, whether it's `isDemo`, and any `description` your admins have provided. ### Create a client profile A profile represents one end-user. One profile can own many trading accounts (e.g. one per currency or strategy). **`POST /profiles`**  →  capture the returned `profile.id`. ### Create a trading account **`POST /accounts`** with `profileId`, `currency`, and `groupId` from the previous steps. The account's **currency is fixed at creation** and cannot be changed. The **`spreadBetting` flag is also immutable** after creation. ### (Optional) Fund the account Credit the opening balance with **`POST /accounts/{accountId}/deposit`**. Use `withdraw` to debit, or `BalanceTransactionCreate` for adjustments. ### End-to-end example ```js const base = process.env.HELIO_ADMIN_URL const headers = (token) => ({ 'Content-Type': 'application/json', Authorization: `Bearer ${token}`, }) // 1. Login const { token } = await fetch(`${base}/user/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username: 'ops@yourbroker.com', password: '***' }), }).then((r) => r.json()) // 2. Reference data const groups = await fetch(`${base}/account-groups`, { headers: headers(token) }) .then((r) => r.json()) const liveGroup = groups.groups.find((g) => !g.isDemo) // 3. Create profile const profile = await fetch(`${base}/profiles`, { method: 'POST', headers: headers(token), body: JSON.stringify({ email: 'jane.doe@example.com', firstName: 'Jane', lastName: 'Doe', }), }).then((r) => r.json()) // 4. Create account const { account } = await fetch(`${base}/accounts`, { method: 'POST', headers: headers(token), body: JSON.stringify({ profileId: profile.id, currency: 'USD', groupId: liveGroup.id, }), }).then((r) => r.json()) // 5. Deposit opening balance await fetch(`${base}/accounts/${account.id}/deposit`, { method: 'POST', headers: headers(token), body: JSON.stringify({ amount: '10000', comment: 'Opening deposit' }), }) ``` ```python base = os.environ["HELIO_ADMIN_URL"] # 1. Login token = requests.post( f"{base}/user/login", json={"username": "ops@yourbroker.com", "password": "***"}, ).json()["token"] auth = {"Authorization": f"Bearer {token}"} # 2. Reference data groups = requests.get(f"{base}/account-groups", headers=auth).json()["groups"] live_group = next(g for g in groups if not g.get("isDemo")) # 3. Create profile profile = requests.post( f"{base}/profiles", headers=auth, json={ "email": "jane.doe@example.com", "firstName": "Jane", "lastName": "Doe", }, ).json() # 4. Create account account = requests.post( f"{base}/accounts", headers=auth, json={ "profileId": profile["id"], "currency": "USD", "groupId": live_group["id"], }, ).json()["account"] # 5. Deposit opening balance requests.post( f"{base}/accounts/{account['id']}/deposit", headers=auth, json={"amount": "10000", "comment": "Opening deposit"}, ) ``` ## Key concepts A **profile** is the end-user (one per client). An **account** is a trading book under that profile. One profile can own many accounts — for example, one per currency or one live and one demo. A group is a pre-configured bundle of trading rules — margin call / stop-out levels, margin calculation type, swap-free flag, demo vs live, and the linked symbol profile that determines which symbols the account can trade. Groups are **read-only here**: brokers select an existing group when creating an account, but groups themselves (and the symbols, margin templates, and commission templates they reference) are configured by your Helio admins outside this API. An account's `currency` and `spreadBetting` flag are fixed at creation and cannot be changed later. Choose deliberately. Other settings (group, leverage cap, statement emails) can be updated via [Update Account](/admin/accounts-funding/accounts/accounts-service_-account-update). This API does not place orders. Once a client has a profile and account, issue them a Trader API token via [Create Session](/admin/accounts-funding/sessions/accounts-service_-client-login) (`POST /trade/login`) — they then trade against the [Trader API](/trader) directly. ## Next steps Credit a trading account. Debit a trading account. Historical orders for an account over a date range. Historical positions for an account over a date range. # Create Session > Authenticate a client profile and issue an end-user access token for client-facing trading services. Source: /admin/accounts-funding/sessions/accounts-service_-client-login ## `POST /trade/login` **Create Session** Authenticate a client profile and issue an end-user access token for client-facing trading services. Tags: `Sessions` ### Request body End-user (client) credentials for issuing a trading access token. **Content-Type:** `application/json` End-user (client) credentials for issuing a trading access token. - `email` (string) - `password` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Issued bearer token for the end-user trading session. access_token is the JWT to be passed as `Authorization: Bearer ...` to the Trader API. expires_at is a Unix epoch (seconds) absolute expiry — clients should refresh before this time. accounts lists the trading accounts available to the authenticated profile, each with its account-group ID. - `accessToken` (string) - `expiresAt` (string) - `accounts` (array) - items: Minimal (id, group_id) pair returned in the login response. - `id` (string) - `gId` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Admin Login > Authenticate a back-office user (CRM/broker operator) and issue a bearer admin access token used to call this API. Tokens are valid for 30 days. Requests must originate from a whitelisted IP address. Source: /admin/accounts-funding/sessions/accounts-service_-user-login ## `POST /user/login` **Admin Login** Authenticate a back-office user (CRM/broker operator) and issue a bearer admin access token used to call this API. Tokens are valid for 30 days. Requests must originate from a whitelisted IP address. Tags: `Sessions` ### Request body **Content-Type:** `application/json` - `username` (string) - `password` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` - `token` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Open Positions > Return the open positions for the specified trading account. Source: /admin/accounts-funding/trading/accounts-service_-get-positions ## `GET /accounts/{id}/positions` **Open Positions** Return the open positions for the specified trading account. Tags: `Trading` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` List of positions (open or historical depending on the RPC). - `positions` (array) - items: Net open exposure on a symbol for a single account, with average entry price, current floating P&L, and any attached protection (stop loss / take profit) levels. - `id` (string) - `symbolId` (string) - `accountId` (string) - `orderId` (string) - `symbolName` (string) - `openPrice` (number) - `openPriceRaw` (number) - `closePrice` (number) - `closePriceRaw` (number) - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED` - `commission` (number) - `swap` (number) - `profit` (number) - `units` (number) - `qty` (number) - `qtyClosed` (number) - `comment` (string) - `createdAt` (string) - `updatedAt` (string) - `realizedPnl` (number) - `unitsClosed` (number) - `usdPnl` (number) - `currentPrice` (number) - `margin` (number) - `fundingAccrued` (number) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Order History > Return historical orders for the specified trading account within the requested date range. Source: /admin/accounts-funding/trading/accounts-service_-order-history ## `GET /accounts/{id}/history/orders` **Order History** Return historical orders for the specified trading account within the requested date range. Tags: `Trading` #### Path parameters - `id` (string) (required) #### Query parameters - `from` (string) - `to` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Historical orders for an account within a requested date range. - `orders` (array) - items: A working or completed trading instruction on an account: market, limit, stop, or protection (SL/TP). Carries side, type, time-in-force, status, requested protection distances/prices, and the fill price once executed. - `id` (string) - `accountId` (string) - `groupId` (string) - `symbolId` (string) - `symbolName` (string) - `positionId` (string) - `clientOrderId` (string) - `ipAddress` (string) - `managerId` (string) - `parentOrderId` (string) - `cancelsOrderId` (string) - `venueId` (string) - `venueOrderId` (string) - `createdAt` (string) - `updatedAt` (string) - `expirationDate` (string) - `qtyOriginal` (number) - `qtyFilled` (number) - `seenPrice` (number) - `limitPrice` (number) - `stopPrice` (number) - `slippage` (number) - `isClosing` (boolean) — Is this a closing order - `trailingOffset` (string) - `trailingStep` (string) - `stopLossPts` (string) - `takeProfitPts` (string) - `stopLossPrice` (number) - `takeProfitPrice` (number) - `status` (string) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_STARTED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_ACCEPTED`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_PENDING_EXECUTION`, `ORDER_STATUS_P_FILLED`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED` - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `timeInForce` (string) - enum: `ORDER_TIF_UNSPECIFIED`, `ORDER_TIF_FILL_OR_KILL`, `ORDER_TIF_GOOD_TILL_CANCEL`, `ORDER_TIF_IMMEDIATE_OR_CANCEL`, `ORDER_TIF_GOOD_TILL_DATE`, `ORDER_TIF_GOOD_TILL_DAY` - `comment` (string) - `fillPrice` (number) - `fillPriceRaw` (number) - `unitsOriginal` (number) - `unitsFilled` (number) - `completed` (boolean) - `initialMargin` (number) - `triggerQuote` (object) — Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. - `symbolId` (string) - `bid` (number) - `ask` (number) - `volume` (string) - `datetime` (string) - `md` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Pending Orders > Return the working/inactive orders for the specified trading account. Source: /admin/accounts-funding/trading/accounts-service_-orders-list ## `GET /accounts/{id}/orders` **Pending Orders** Return the working/inactive orders for the specified trading account. Tags: `Trading` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` List of currently open / working orders for an account. - `orders` (array) - items: A working or completed trading instruction on an account: market, limit, stop, or protection (SL/TP). Carries side, type, time-in-force, status, requested protection distances/prices, and the fill price once executed. - `id` (string) - `accountId` (string) - `groupId` (string) - `symbolId` (string) - `symbolName` (string) - `positionId` (string) - `clientOrderId` (string) - `ipAddress` (string) - `managerId` (string) - `parentOrderId` (string) - `cancelsOrderId` (string) - `venueId` (string) - `venueOrderId` (string) - `createdAt` (string) - `updatedAt` (string) - `expirationDate` (string) - `qtyOriginal` (number) - `qtyFilled` (number) - `seenPrice` (number) - `limitPrice` (number) - `stopPrice` (number) - `slippage` (number) - `isClosing` (boolean) — Is this a closing order - `trailingOffset` (string) - `trailingStep` (string) - `stopLossPts` (string) - `takeProfitPts` (string) - `stopLossPrice` (number) - `takeProfitPrice` (number) - `status` (string) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_STARTED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_ACCEPTED`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_PENDING_EXECUTION`, `ORDER_STATUS_P_FILLED`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED` - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `timeInForce` (string) - enum: `ORDER_TIF_UNSPECIFIED`, `ORDER_TIF_FILL_OR_KILL`, `ORDER_TIF_GOOD_TILL_CANCEL`, `ORDER_TIF_IMMEDIATE_OR_CANCEL`, `ORDER_TIF_GOOD_TILL_DATE`, `ORDER_TIF_GOOD_TILL_DAY` - `comment` (string) - `fillPrice` (number) - `fillPriceRaw` (number) - `unitsOriginal` (number) - `unitsFilled` (number) - `completed` (boolean) - `initialMargin` (number) - `triggerQuote` (object) — Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. - `symbolId` (string) - `bid` (number) - `ask` (number) - `volume` (string) - `datetime` (string) - `md` (string) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Get Portfolio > Return the account portfolio snapshot, including balance, equity, margin, and related trading state values. Source: /admin/accounts-funding/trading/accounts-service_-portfolio-get ## `GET /portfolios/{id}` **Get Portfolio** Return the account portfolio snapshot, including balance, equity, margin, and related trading state values. Tags: `Trading` #### Path parameters - `id` (string) (required) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` Snapshot of an account's balance, equity, free margin, and open P&L. - `accountId` (string) - `currency` (string) - `balance` (number) - `unrealizedPnl` (number) - `usedMargin` (number) - `pendingMargin` (number) - `accountVersion` (string) - `inMarginCall` (boolean) - `inStopOut` (boolean) - `positions` (array) - items: Net open exposure on a symbol for a single account, with average entry price, current floating P&L, and any attached protection (stop loss / take profit) levels. - `id` (string) - `symbolId` (string) - `accountId` (string) - `orderId` (string) - `symbolName` (string) - `openPrice` (number) - `openPriceRaw` (number) - `closePrice` (number) - `closePriceRaw` (number) - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED` - `commission` (number) - `swap` (number) - `profit` (number) - `units` (number) - `qty` (number) - `qtyClosed` (number) - `comment` (string) - `createdAt` (string) - `updatedAt` (string) - `realizedPnl` (number) - `unitsClosed` (number) - `usdPnl` (number) - `currentPrice` (number) - `margin` (number) - `fundingAccrued` (number) - `orders` (array) - items: A working or completed trading instruction on an account: market, limit, stop, or protection (SL/TP). Carries side, type, time-in-force, status, requested protection distances/prices, and the fill price once executed. - `id` (string) - `accountId` (string) - `groupId` (string) - `symbolId` (string) - `symbolName` (string) - `positionId` (string) - `clientOrderId` (string) - `ipAddress` (string) - `managerId` (string) - `parentOrderId` (string) - `cancelsOrderId` (string) - `venueId` (string) - `venueOrderId` (string) - `createdAt` (string) - `updatedAt` (string) - `expirationDate` (string) - `qtyOriginal` (number) - `qtyFilled` (number) - `seenPrice` (number) - `limitPrice` (number) - `stopPrice` (number) - `slippage` (number) - `isClosing` (boolean) — Is this a closing order - `trailingOffset` (string) - `trailingStep` (string) - `stopLossPts` (string) - `takeProfitPts` (string) - `stopLossPrice` (number) - `takeProfitPrice` (number) - `status` (string) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_STARTED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_ACCEPTED`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_PENDING_EXECUTION`, `ORDER_STATUS_P_FILLED`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED` - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `timeInForce` (string) - enum: `ORDER_TIF_UNSPECIFIED`, `ORDER_TIF_FILL_OR_KILL`, `ORDER_TIF_GOOD_TILL_CANCEL`, `ORDER_TIF_IMMEDIATE_OR_CANCEL`, `ORDER_TIF_GOOD_TILL_DATE`, `ORDER_TIF_GOOD_TILL_DAY` - `comment` (string) - `fillPrice` (number) - `fillPriceRaw` (number) - `unitsOriginal` (number) - `unitsFilled` (number) - `completed` (boolean) - `initialMargin` (number) - `triggerQuote` (object) — Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. Top-of-book bid/ask snapshot for a symbol at a point in time, used for streaming market data and to record the trigger price on filled orders. - `symbolId` (string) - `bid` (number) - `ask` (number) - `volume` (string) - `datetime` (string) - `md` (string) - `groupId` (string) - `usdPnl` (number) - `maxLeverage` (string) - `status` (string) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `isSb` (boolean) - `isDemo` (boolean) - `profileId` (string) - `createdAt` (string) - `updatedAt` (string) - `nop` (number) - `marginCalcTypeOverride` (string) — MarginCalculationType defines how opposing positions on the same symbol are combined. - MARGIN_CALC_TYPE_UNSPECIFIED: unspecified — behaves as SUM - MARGIN_CALC_TYPE_SUM: long_margin + short_margin (most conservative) - MARGIN_CALC_TYPE_MAX: max(long_margin, short_margin) — partial hedging relief - MARGIN_CALC_TYPE_NET: margin on abs(long_qty - short_qty) — full hedging offset - enum: `MARGIN_CALC_TYPE_UNSPECIFIED`, `MARGIN_CALC_TYPE_SUM`, `MARGIN_CALC_TYPE_MAX`, `MARGIN_CALC_TYPE_NET` - `dailyStatement` (boolean) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Position History > Return historical positions for the specified trading account within the requested date range. Source: /admin/accounts-funding/trading/accounts-service_-position-history ## `GET /accounts/{id}/history/positions` **Position History** Return historical positions for the specified trading account within the requested date range. Tags: `Trading` #### Path parameters - `id` (string) (required) #### Query parameters - `from` (string) - `to` (string) ### Responses #### `200` — A successful response. **Content-Type:** `application/json` List of positions (open or historical depending on the RPC). - `positions` (array) - items: Net open exposure on a symbol for a single account, with average entry price, current floating P&L, and any attached protection (stop loss / take profit) levels. - `id` (string) - `symbolId` (string) - `accountId` (string) - `orderId` (string) - `symbolName` (string) - `openPrice` (number) - `openPriceRaw` (number) - `closePrice` (number) - `closePriceRaw` (number) - `side` (string) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED` - `commission` (number) - `swap` (number) - `profit` (number) - `units` (number) - `qty` (number) - `qtyClosed` (number) - `comment` (string) - `createdAt` (string) - `updatedAt` (string) - `realizedPnl` (number) - `unitsClosed` (number) - `usdPnl` (number) - `currentPrice` (number) - `margin` (number) - `fundingAccrued` (number) #### `default` — An unexpected error response. **Content-Type:** `application/json` - `code` (integer) - `message` (string) - `details` (array) - items: - `@type` (string) # Admin APIs > gRPC-gateway REST endpoints for platform administration — CRM, accounts, funding, and corporate actions. Source: /admin # Home > Official API documentation for the Helio multi-asset trading platform — Admin REST APIs and Trader REST plus WebSocket APIs. Source: / # Login > Authenticates a client profile and returns JWT token with account information Source: /trader/api/authentication/client-login ## `POST /public/ticker` **Login** Authenticates a client profile and returns JWT token with account information Tags: `Authentication` ### Request body **Content-Type:** `application/json` - `email` (string) (required) — Client profile email address - `password` (string) (required) — Client profile password ### Responses #### `200` — Successfully authenticated **Content-Type:** `application/json` - `access_token` (string) (required) — JWT access token for authentication - `expires_at` (integer) (required) — Token expiration timestamp (Unix seconds) - `accounts` (array) (required) — List of trading accounts accessible by the client - items: - `id` (string) (required) — Account identifier - `gid` (string) (required) — Account group identifier #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid credentials) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # OHLCV Bars > Returns historical OHLCV bars for the specified symbol and timeframe Source: /trader/api/charting/get-bars ## `GET /history/bars` **OHLCV Bars** Returns historical OHLCV bars for the specified symbol and timeframe Tags: `Charting` #### Query parameters - `sid` (string) (required) — Symbol ID to fetch bars for - `timeframe` (string) (required) — Bar timeframe/resolution - enum: `1M`, `2M`, `3M`, `5M`, `15M`, `30M`, `1H`, `4H`, `12H`, `D`, `W`, `M` - `from` (integer) — Start timestamp (Unix time in seconds). Either 'from' or 'count' must be provided. - `to` (integer) (required) — End timestamp (Unix time in seconds) - `count` (integer) — Maximum number of bars to return. Either 'from' or 'count' must be provided. ### Responses #### `200` — Successfully retrieved bars **Content-Type:** `application/json` - `bars` (array) (required) - items: - `open` (number) (required) — Opening price - `high` (number) (required) — Highest price - `low` (number) (required) — Lowest price - `close` (number) (required) — Closing price - `volume` (integer) (required) — Trading volume - `datetime` (string) (required) — Bar timestamp #### `400` — Bad request (missing or invalid parameters) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `404` — Symbol not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Current OHLC Bars > Returns the last OHLCV bar for each requested symbol and timeframe in a single call Source: /trader/api/charting/get-current-bars ## `GET /trendbars/current` **Current OHLC Bars** Returns the last OHLCV bar for each requested symbol and timeframe in a single call Tags: `Charting` #### Query parameters - `sids` (array) (required) — Symbol IDs to fetch the current bar for (repeat parameter for multiple) - `timeframe` (string) (required) — Bar timeframe/resolution - enum: `1M`, `2M`, `3M`, `5M`, `15M`, `30M`, `1H`, `4H`, `12H`, `D`, `W`, `M` ### Responses #### `200` — Successfully retrieved current bars **Content-Type:** `application/json` - `bars` (array) (required) - items: - `symbol_id` (string) (required) — Symbol identifier - `bar` (object) (required) - `open` (number) (required) — Opening price - `high` (number) (required) — Highest price - `low` (number) (required) — Lowest price - `close` (number) (required) — Closing price - `volume` (integer) (required) — Trading volume - `datetime` (string) (required) — Bar timestamp #### `400` — Bad request (missing or invalid parameters) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Symbols > Returns a list of trading symbols for a specific account group, enriched with template data Source: /trader/api/configuration/get-symbols ## `GET /accounts/{account_id}/symbols` **Symbols** Returns a list of trading symbols for a specific account group, enriched with template data Tags: `Configuration` #### Path parameters - `account_id` (string) (required) — Account ID to fetch symbols for ### Responses #### `200` — Successfully retrieved symbols **Content-Type:** `application/json` Array of: - `id` (string) (required) — Symbol identifier - `name` (string) (required) — Symbol display name - `group_id` (string) — Account group identifier that this symbol belongs to - `group_name` (string) — Human-readable name of the symbol group this symbol belongs to - `description` (string) — Symbol description - `asset_class` (string) (required) - enum: `ASSET_CLASS_UNSPECIFIED`, `ASSET_CLASS_FOREX_CFD`, `ASSET_CLASS_CFD`, `ASSET_CLASS_STOCK_CFD`, `ASSET_CLASS_ETF_CFD`, `ASSET_CLASS_INDEX_CFD`, `ASSET_CLASS_CRYPTO_CFD`, `ASSET_CLASS_COMMODITY_CFD` - `instrument_type` (string) - enum: `INSTRUMENT_TYPE_UNSPECIFIED`, `INSTRUMENT_TYPE_CFD`, `INSTRUMENT_TYPE_SPOT`, `INSTRUMENT_TYPE_PERPETUAL`, `INSTRUMENT_TYPE_FUTURE` - `status` (string) (required) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `digits` (integer) (required) — Number of decimal places for price display - `contract_size` (integer) (required) — Contract size in base currency units - `tick_size` (number) (required) — Minimum price movement - `base_asset` (string) — Base asset symbol - `quote_asset` (string) — Quote asset symbol - `lot_name` (string) — Name for the lot unit - `timezone` (string) — Trading timezone - `volume_min` (number) (required) — Minimum trade volume - `volume_max` (number) (required) — Maximum trade volume - `volume_step` (number) (required) — Volume step increment - `stop_loss_min_distance` (integer) (required) — Minimum stop loss distance in points - `take_profit_min_distance` (integer) (required) — Minimum take profit distance in points - `limit_min_distance` (integer) — Minimum limit order distance in points - `stop_min_distance` (integer) — Minimum stop order distance in points - `margin_rate` (number) — Margin rate (1 / first-tier leverage) - `leverage_tiers` (array) — Tiered leverage schedule; first tier applies at lowest exposure - items: - `leverage` (integer) (required) — Leverage multiplier for this tier - `exposure_level_usd` (number) (required) — Upper bound exposure in USD for this tier (0 = unlimited) - `commission_rate` (number) — Commission rate - `commission_mode` (string) - enum: `COMMISSION_MODE_UNSPECIFIED`, `COMMISSION_MODE_USD_PER_MILLION`, `COMMISSION_MODE_USD_PER_LOT`, `COMMISSION_MODE_PERCENT` - `min_commission` (number) — Minimum commission amount - `trade_sessions` (array) — Trading session times - items: - `from` (integer) (required) — Session start time (seconds since midnight) - `to` (integer) (required) — Session end time (seconds since midnight) - `quote_sessions` (array) — Quote session times - items: - `bid` (number) (required) — Current bid price - `ask` (number) (required) — Current ask price - `change` (number) — Price change percentage - `timestamp` (integer) (required) — Market data timestamp (Unix seconds) #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account group not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` #### `503` — Service not ready (cache not initialized) **Content-Type:** `application/json` # Exchange Rates Source: /trader/api/data/get-exchange-rate ## `GET /exchange-rates` **Exchange Rates** Tags: `Data` #### Query parameters - `from` (string) (required) - `to` (string) (required) ### Responses #### `200` — Exchange rate retrieved successfully **Content-Type:** `application/json` - `from` (string) (required) - `to` (string) (required) - `rate` (number) (required) #### `400` — Missing or invalid parameters #### `401` — Unauthorized #### `404` — Exchange rate not available # Get Tickers > Returns live mid prices and % change for all symbols, optionally filtered by asset class or symbol names. No authentication required. Source: /trader/api/data/get-public-ticker ## `GET /public/ticker` **Get Tickers** Returns live mid prices and % change for all symbols, optionally filtered by asset class or symbol names. No authentication required. Tags: `Data` #### Query parameters - `asset_classes` (string) — Comma-separated asset classes (e.g. ASSET_CLASS_FOREX_CFD,ASSET_CLASS_CRYPTO_CFD) - `symbols` (string) — Comma-separated symbol names (e.g. EURUSD,BTCUSD). Takes precedence over asset_classes. ### Responses #### `200` — List of ticker items **Content-Type:** `application/json` Array of: - `s` (string) (required) — Symbol name - `p` (number) (required) — Mid price (bid + ask) / 2 - `c` (number) (required) — Percentage change vs previous close, rounded to 2dp - `a` (string) (required) - enum: `ASSET_CLASS_UNSPECIFIED`, `ASSET_CLASS_FOREX_CFD`, `ASSET_CLASS_CFD`, `ASSET_CLASS_STOCK_CFD`, `ASSET_CLASS_ETF_CFD`, `ASSET_CLASS_INDEX_CFD`, `ASSET_CLASS_CRYPTO_CFD`, `ASSET_CLASS_COMMODITY_CFD` # List Deals > Returns deal history for the authenticated user Source: /trader/api/history/deal-history ## `GET /accounts/{account_id}/history/deals` **List Deals** Returns deal history for the authenticated user Tags: `History` #### Path parameters - `account_id` (string) (required) — Account ID to fetch deal history for #### Query parameters - `from` (string) — From date created to fetch deal history for - `to` (string) (required) — To date created to fetch deal history for ### Responses #### `200` — Successfully retrieved account history **Content-Type:** `application/json` - `deals` (array) (required) - items: - `id` (string) (required) - `user_id` (string) (required) — The account that the deal is associated with - `symbol_name` (string) (required) - `comment` (string) (required) - `client_deal_id` (string) (required) — The helio user who created the deal, if via API - `account_id` (string) (required) - `order_id` (string) (required) - `position_id` (string) (required) - `created_at` (string) (required) - `updated_at` (string) - `symbol_id` (string) (required) - `volume` (number) (required) - `amount` (number) (required) — Amount in account currency - `amount_raw` (number) (required) - `exchange_rate` (number) (required) - `close_price` (number) (required) — Last price with the markup applied Avg+Markup - `close_price_raw` (number) (required) - `open_price` (number) (required) — Last price with the markup applied Avg+Markup - `open_price_raw` (number) (required) — last price - `commission` (number) (required) — Commission in account currency - `commission_raw` (number) (required) — Commission in symbol currency - `action` (string) (required) - enum: `DEAL_ACTION_UNSPECIFIED`, `DEAL_ACTION_BUY`, `DEAL_ACTION_SELL`, `DEAL_ACTION_CREDIT`, `DEAL_ACTION_CORRECTION`, `DEAL_ACTION_COMMISSION`, `DEAL_ACTION_DIVIDEND`, `DEAL_ACTION_TAX`, `DEAL_ACTION_BONUS`, `DEAL_ACTION_OTHER`, `DEAL_ACTION_SWAP`, `DEAL_ACTION_INTEREST`, `DEAL_ACTION_BALANCE`, `DEAL_ACTION_REBATE`, `DEAL_ACTION_FEE`, `DEAL_ACTION_FUNDING` - `direction` (string) (required) - enum: `DEAL_DIRECTION_UNSPECIFIED`, `DEAL_DIRECTION_IN`, `DEAL_DIRECTION_OUT` #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # List Orders > Returns order history for the authenticated user Source: /trader/api/history/order-history ## `GET /accounts/{account_id}/history/orders` **List Orders** Returns order history for the authenticated user Tags: `History` #### Path parameters - `account_id` (string) (required) — Account ID to fetch order history for #### Query parameters - `from` (string) — From date created to fetch order history for - `to` (string) (required) — To date created to fetch order history for ### Responses #### `200` — Successfully retrieved order history **Content-Type:** `application/json` - `orders` (array) (required) - items: - `id` (string) (required) — Order identifier - `account_id` (string) (required) — Account identifier - `symbol_id` (string) (required) — Trading symbol identifier - `symbol_name` (string) (required) — Symbol display name - `position_id` (string) — Related position identifier - `client_order_id` (string) — Client-provided order identifier - `parent_order_id` (string) — Parent order identifier for bracket orders - `cancels_order_id` (string) — Order that this order cancels - `created_at` (string) — Order creation timestamp - `updated_at` (string) — Order last update timestamp - `expiration_date` (string) — Order expiration timestamp - `qty_original` (number) (required) — Original order quantity - `qty_filled` (number) (required) — Filled quantity - `qty_remaining` (number) — Remaining quantity - `limit_price` (number) — Limit price for limit orders - `stop_price` (number) — Stop price for stop orders - `fill_price` (number) — The average fill price (VWAP) for filled/partially filled orders - `side` (string) (required) — Trade side (buy/sell) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) (required) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `status` (string) (required) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED`, `ORDER_STATUS_PARTIALLY_FILLED` - `time_in_force` (string) - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD` - `comment` (string) — Order comment #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # List Positions > Returns position history for the authenticated user Source: /trader/api/history/position-history ## `GET /accounts/{account_id}/history/positions` **List Positions** Returns position history for the authenticated user Tags: `History` #### Path parameters - `account_id` (string) (required) — Account ID to fetch position history for #### Query parameters - `from` (string) — From date created to fetch position history for - `to` (string) (required) — To date created to fetch position history for ### Responses #### `200` — Successfully retrieved position history **Content-Type:** `application/json` - `positions` (array) (required) - items: - `id` (string) (required) — Position identifier - `symbol_id` (string) (required) — Trading symbol identifier - `account_id` (string) (required) — Account identifier - `order_id` (string) — Opening order identifier - `symbol_name` (string) (required) — Symbol display name - `open_price` (number) (required) — Position opening price - `close_price` (number) (required) — Position closing price (if closed) - `side` (string) (required) — Trade side (buy/sell) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) (required) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED`, `POSITION_STATUS_CANCELLED` - `is_closing` (boolean) — Whether this order closes a position. e.g. stop loss or take profit - `commission` (number) (required) — Commission charged for the position - `swap` (number) (required) — Swap charges - `profit` (number) (required) — Current profit/loss - `units` (number) (required) — Position size in units - `qty` (number) (required) — Position quantity in lots - `qty_closed` (number) — Quantity already closed - `comment` (string) — Position comment - `created_at` (string) — Position creation timestamp - `updated_at` (string) — Position last update timestamp - `funding_accrued` (number) — Cumulative funding charges accrued on this position (account currency) #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # HTTP API > End-user trading — symbols, portfolio, history, metrics, exchange rates, orders, positions, and authentication. Source: /trader/api # HTTP API End-user trading endpoints: symbols, portfolio, order/position/deal history, account metrics, exchange rates, bars, order placement and amendment, position management, and authentication. Select an endpoint from the sidebar. # Funding Rates History > Returns raw historical funding rates for a perpetual symbol. If `to` is omitted, defaults to the current UTC time. Source: /trader/api/perps/get-funding-rate-history-by-symbol ## `GET /accounts/{account_id}/funding-rates/{symbol_id}/history` **Funding Rates History** Returns raw historical funding rates for a perpetual symbol. If `to` is omitted, defaults to the current UTC time. Tags: `Perps` #### Path parameters - `account_id` (string) (required) — Account ID - `symbol_id` (string) (required) — Internal symbol ID #### Query parameters - `to` (integer) — End timestamp (Unix seconds, UTC). Defaults to now. - `count` (integer) — Maximum number of records to return ### Responses #### `200` — Funding rate history **Content-Type:** `application/json` - `items` (array) - items: - `t` (integer) — Rate timestamp (Unix seconds) - `raw` (number) — Raw funding rate - `price` (number) — Price at the time of the rate - `settlement_period_end` (string) — Settlement period end timestamp - `fetched_at` (string) — When the rate was fetched from the provider - `applied_at` (string) — When the rate was applied to client positions #### `401` — Unauthorized **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `500` — Internal server error **Content-Type:** `application/json` # Funding Rates > Returns the live funding rate and next settlement for a perpetual symbol, scoped to the authenticated user's funding profile. Returns 404 if the symbol has no active funding rate or the account group has no funding profile. Source: /trader/api/perps/get-funding-rate ## `GET /accounts/{account_id}/funding-rates/{symbol_id}` **Funding Rates** Returns the live funding rate and next settlement for a perpetual symbol, scoped to the authenticated user's funding profile. Returns 404 if the symbol has no active funding rate or the account group has no funding profile. Tags: `Perps` #### Path parameters - `account_id` (string) (required) — Account ID - `symbol_id` (string) (required) — Internal symbol ID ### Responses #### `200` — Current funding rate **Content-Type:** `application/json` - `rate_percentage` (string) — Raw provider rate over the quote interval (e.g. "0.01000") - `debit_rate` (string) — Paying-side rate if supplied separately by provider - `credit_rate` (string) — Receiving-side rate if supplied separately by provider - `projected_rate` (string) — Provider rate applied at each settlement (no rescaling) - `quote_interval` (string) — Funding period: 1H, 4H, 8H, or 12H - `next_payment_at` (integer) — Unix timestamp of the next settlement anchor for this profile #### `401` — Unauthorized **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `404` — Symbol has no active funding rate or account group has no funding profile **Content-Type:** `application/json` # Get Key > Returns the string value stored for the authenticated profile under the given key. This is a general-purpose key-value store used for per-profile data such as watchlists, UI preferences, notes, or account-level configuration. Callers may store any string; JSON-encoded objects are common but not required. Returns 400 if the key format is invalid, or 404 if the key has never been written. Source: /trader/api/settings/get-client-setting ## `GET /settings/{key}` **Get Key** Returns the string value stored for the authenticated profile under the given key. This is a general-purpose key-value store used for per-profile data such as watchlists, UI preferences, notes, or account-level configuration. Callers may store any string; JSON-encoded objects are common but not required. Returns 400 if the key format is invalid, or 404 if the key has never been written. Tags: `Settings` #### Path parameters - `key` (string) (required) — Setting key (pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars) ### Responses #### `200` — Setting retrieved successfully **Content-Type:** `application/json` A single key-value entry scoped to the authenticated profile. Keys identify the setting (e.g. "watchlist:default", "ui:theme"). Values are arbitrary strings; callers typically encode structured data (e.g. JSON) before storing. - `key` (string) (required) — The setting key. Pattern ^[A-Za-z0-9_\-:#]+$, max 256 chars. - `value` (string) — The stored string value. Null if no value has been written yet. Callers may store any text (JSON-encoded objects are common but not required). - `updated_at` (string) — ISO 8601 timestamp of the last write. Null if the setting has never been set. #### `400` — Invalid key format (key must match ^[A-Za-z0-9_\-:#]+$, max 256 chars) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized **Content-Type:** `application/json` #### `404` — Key not found — no value has been stored under this key yet **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Settings > Returns the stored values for one or more keys belonging to the authenticated profile. Pass a single key or a comma-separated list of keys via the `keys` query parameter. Keys that have never been written are included in the response with a null value. Returns 400 if any key fails the format validation (^[A-Za-z0-9_\-:#]+$, max 256 chars each). Max 50 keys per request. Source: /trader/api/settings/get-client-settings-batch ## `GET /settings` **Settings** Returns the stored values for one or more keys belonging to the authenticated profile. Pass a single key or a comma-separated list of keys via the `keys` query parameter. Keys that have never been written are included in the response with a null value. Returns 400 if any key fails the format validation (^[A-Za-z0-9_\-:#]+$, max 256 chars each). Max 50 keys per request. Tags: `Settings` #### Query parameters - `keys` (string) (required) — Comma-separated setting keys (pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars each, max 50 keys) ### Responses #### `200` — Settings retrieved successfully **Content-Type:** `application/json` Batch response for multi-key settings lookup. Each requested key is present as a property. Keys that have never been written are included with a null value. - `settings` (object) (required) — Map of key → ClientSettingResponse for each requested key. #### `400` — Missing or invalid keys parameter (each key must match ^[A-Za-z0-9_\-:#]+$, max 256 chars, max 50 keys) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Update Key > Stores a string value under the given key for the authenticated profile (upsert). This is a general-purpose key-value store used for per-profile data such as watchlists, UI preferences, notes, or account-level configuration. Callers may store any text; JSON-encoded objects are common but not required. Max body size: 128 KB. Keys must match ^[A-Za-z0-9_\-:#]+$ (max 256 chars). Source: /trader/api/settings/update-client-setting ## `PUT /settings/{key}` **Update Key** Stores a string value under the given key for the authenticated profile (upsert). This is a general-purpose key-value store used for per-profile data such as watchlists, UI preferences, notes, or account-level configuration. Callers may store any text; JSON-encoded objects are common but not required. Max body size: 128 KB. Keys must match ^[A-Za-z0-9_\-:#]+$ (max 256 chars). Tags: `Settings` #### Path parameters - `key` (string) (required) — Setting key (pattern: ^[A-Za-z0-9_\-:#]+$, max 256 chars) ### Request body **Content-Type:** `application/json` Request body for creating or updating a client setting. The value is stored as-is; callers may store any text up to the 128 KB body limit. JSON-encoded objects are a common pattern but the server treats the value as an opaque string. - `value` (string) (required) — The string value to store. Any text is accepted; callers typically JSON-encode structured data. Max ~128 KB (enforced by body size limit). ### Responses #### `204` — Setting updated successfully (no body) #### `400` — Invalid key format or malformed body **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Amend Order > Amends an existing trading order for the authenticated user's account, including support for multi-level take profit and stop loss Source: /trader/api/trading/amend-order ## `PATCH /accounts/{account_id}/orders/{order_id}` **Amend Order** Amends an existing trading order for the authenticated user's account, including support for multi-level take profit and stop loss Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where order to amend belongs - `order_id` (string) (required) — Order ID to amend ### Request body **Content-Type:** `application/json` - `order_id` (string) — The order identifier to amend (required for WebSocket, extracted from URL for HTTP) - `volume` (number) — Trading volume in lots - `limit_price` (number) — The new limit price of a limit order - `stop_price` (number) — The new stop price of a stop order - `time_in_force` (string) - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD` - `expire_time` (string) — Order expiration time - `good_till_date` (string) — Expiry datetime for GTD (Good Till Date) orders (ISO 8601 / RFC 3339). Required when time_in_force is TIF_GTD; ignored for all other time_in_force values. - `tp_levels` (array) — Multi-level take profit configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify - items: - `level_id` (string) — Optional: If provided, modifies existing TP/SL order; if empty, creates new - `price` (number) (required) — Trigger price for this protection level - `qty` (number) (required) — Quantity in lots for this level - `sl_levels` (array) — Multi-level stop loss configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify - items: ### Responses #### `200` — Order amended successfully **Content-Type:** `application/json` - `message` (string) (required) — The message that conveys the status of the request - `operation_id` (string) (required) — The operation ID of the API request #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account or symbol not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Amend Position > Modifies multi-level take profit and stop loss orders for an existing position Source: /trader/api/trading/amend-position ## `PATCH /accounts/{account_id}/positions/{position_id}/amend` **Amend Position** Modifies multi-level take profit and stop loss orders for an existing position Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where position to amend belongs - `position_id` (string) (required) — Position ID to amend ### Request body **Content-Type:** `application/json` - `position_id` (string) — Position ID to amend (required for WebSocket, extracted from URL for HTTP) - `tp_levels` (array) — Multi-level take profit configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify - items: - `level_id` (string) — Optional: If provided, modifies existing TP/SL order; if empty, creates new - `price` (number) (required) — Trigger price for this protection level - `qty` (number) (required) — Quantity in lots for this level - `sl_levels` (array) — Multi-level stop loss configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify - items: ### Responses #### `200` — Position amended successfully **Content-Type:** `application/json` - `message` (string) (required) — The message that conveys the status of the request - `operation_id` (string) (required) — The operation ID of the API request #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (position access denied) **Content-Type:** `application/json` #### `404` — Position not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Cancel Order > Cancel a trading order for the authenticated user's account Source: /trader/api/trading/cancel-order ## `DELETE /accounts/{account_id}/orders/{order_id}` **Cancel Order** Cancel a trading order for the authenticated user's account Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where order to cancel belongs - `order_id` (string) (required) — Order ID to cancel ### Responses #### `200` — Order cancelled successfully **Content-Type:** `application/json` - `message` (string) (required) — The message that conveys the status of the request - `operation_id` (string) (required) — The operation ID of the API request #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Order ID not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Close Position > Creates a market order to close an existing position (partial or full closing supported) Source: /trader/api/trading/close-position ## `PATCH /accounts/{account_id}/positions/{position_id}` **Close Position** Creates a market order to close an existing position (partial or full closing supported) Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where position to close belongs - `position_id` (string) (required) — Position ID to close #### Query parameters - `qty` (number) (required) — Quantity to close (in lots). Use position's full qty to close completely. ### Responses #### `201` — Position close order created successfully **Content-Type:** `application/json` - `order_id` (string) (required) — The created closing order identifier #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (position access denied) **Content-Type:** `application/json` #### `404` — Position not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # New Order > Creates a new trading order for the authenticated user's account Source: /trader/api/trading/create-order ## `POST /accounts/{account_id}/orders` **New Order** Creates a new trading order for the authenticated user's account Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where order to create belongs ### Request body **Content-Type:** `application/json` - `client_order_id` (string) — Client-provided order identifier - `symbol_id` (string) (required) — Trading symbol identifier - `side` (string) (required) — Trade side (buy/sell) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `type` (string) (required) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `time_in_force` (string) (required) - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD` - `volume` (number) (required) — Trading volume in lots - `price` (number) — Seen bid/ask price for market orders - `stop_loss_points` (integer) — Stop loss distance in points for market orders - `take_profit_points` (integer) — Take profit distance in points for market orders - `limit_price` (number) — Limit price for limit orders - `stop_price` (number) — Stop price for stop orders - `stop_loss_price` (number) — Stop loss price for limit/stop orders - `take_profit_price` (number) — Take profit price for limit/stop orders - `expire_time` (string) — Order expiration time - `good_till_date` (string) — Expiry datetime for GTD (Good Till Date) orders (ISO 8601 / RFC 3339). Required when time_in_force is TIF_GTD; ignored for all other time_in_force values. ### Responses #### `201` — Order created successfully **Content-Type:** `application/json` - `order_id` (string) (required) — The created order identifier #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account or symbol not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Double Position > Places a market order matching the position's symbol, side, and remaining open quantity. When the order fills, the resulting deal is merged into the existing position (VWAP recalculation + quantity increase). Source: /trader/api/trading/double-position ## `POST /accounts/{account_id}/positions/{position_id}/double` **Double Position** Places a market order matching the position's symbol, side, and remaining open quantity. When the order fills, the resulting deal is merged into the existing position (VWAP recalculation + quantity increase). Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where the position to double belongs - `position_id` (string) (required) — Position ID to double ### Responses #### `201` — Position double order created successfully **Content-Type:** `application/json` - `order_id` (string) (required) — The created doubling market order identifier #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (position access denied) **Content-Type:** `application/json` #### `404` — Position not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation, e.g. position not open) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Account Metrics > Returns latest metrics snapshot for the authenticated user's account (PnL, Equity, Balance, Margins) Source: /trader/api/trading/get-account-metrics ## `GET /accounts/{account_id}/metrics` **Account Metrics** Returns latest metrics snapshot for the authenticated user's account (PnL, Equity, Balance, Margins) Tags: `Trading` #### Path parameters - `account_id` (string) (required) — Account ID to fetch metrics for ### Responses #### `200` — Successfully retrieved account metrics **Content-Type:** `application/json` - `account_id` (string) (required) — Account identifier - `timestamp` (integer) (required) — Snapshot timestamp (Unix milliseconds) - `pnl` (number) (required) — Unrealized profit/loss - `equity` (number) (required) — Account equity (balance + unrealized PnL) - `balance` (number) (required) — Account balance - `used_margin` (number) (required) — Margin currently used by open positions - `free_margin` (number) (required) — Margin available for new positions - `margin_level` (number) (required) — Margin level percentage (equity/used_margin * 100) - `position_pnl_by_id` (object) (required) — Map of position IDs to their individual PnL values #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account metrics not available **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # My Profile > Returns the profile of the authenticated user, identified by the JWT subject. Includes identity fields (id, email, first/last name) and profile metadata (language, country, address, etc.). Source: /trader/api/trading/get-my-profile ## `GET /profiles/me` **My Profile** Returns the profile of the authenticated user, identified by the JWT subject. Includes identity fields (id, email, first/last name) and profile metadata (language, country, address, etc.). Tags: `Trading` ### Responses #### `200` — Profile retrieved successfully **Content-Type:** `application/json` The authenticated user's client profile. - `id` (string) (required) — Profile ID (matches the JWT subject). - `email` (string) (required) - `first_name` (string) - `last_name` (string) - `language` (string) — Preferred UI language (e.g. "en", "fr"). - `address` (string) - `zip_code` (string) - `city` (string) - `state` (string) - `country` (string) - `phone` (string) - `company` (string) - `birth_date` (integer) — Birth date as Unix timestamp (seconds). 0 if not set. #### `401` — Unauthorized **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `404` — Profile not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Portfolio > Returns account balances, metrics, positions, and orders for the authenticated user Source: /trader/api/trading/get-portfolio ## `GET /accounts/{account_id}/portfolio` **Portfolio** Returns account balances, metrics, positions, and orders for the authenticated user Tags: `Trading` #### Path parameters - `account_id` (string) (required) — Account ID to fetch portfolio for ### Responses #### `200` — Successfully retrieved portfolio **Content-Type:** `application/json` - `account_id` (string) (required) — Account identifier - `currency` (string) (required) — Account base currency - `balance` (number) (required) — Account balance - `unrealized_pnl` (number) (required) — Unrealized profit/loss from open positions - `used_margin` (number) (required) — Margin currently used by open positions - `in_margin_call` (boolean) (required) — Whether account is in margin call - `in_stop_out` (boolean) (required) — Whether account is in stop out - `status` (string) (required) - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY` - `positions` (array) (required) — List of open positions - items: - `id` (string) (required) — Position identifier - `symbol_id` (string) (required) — Trading symbol identifier - `account_id` (string) (required) — Account identifier - `order_id` (string) — Opening order identifier - `symbol_name` (string) (required) — Symbol display name - `open_price` (number) (required) — Position opening price - `close_price` (number) (required) — Position closing price (if closed) - `side` (string) (required) — Trade side (buy/sell) - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL` - `status` (string) (required) - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED`, `POSITION_STATUS_CANCELLED` - `is_closing` (boolean) — Whether this order closes a position. e.g. stop loss or take profit - `commission` (number) (required) — Commission charged for the position - `swap` (number) (required) — Swap charges - `profit` (number) (required) — Current profit/loss - `units` (number) (required) — Position size in units - `qty` (number) (required) — Position quantity in lots - `qty_closed` (number) — Quantity already closed - `comment` (string) — Position comment - `created_at` (string) — Position creation timestamp - `updated_at` (string) — Position last update timestamp - `funding_accrued` (number) — Cumulative funding charges accrued on this position (account currency) - `orders` (array) (required) — List of active orders - items: - `id` (string) (required) — Order identifier - `account_id` (string) (required) — Account identifier - `symbol_id` (string) (required) — Trading symbol identifier - `symbol_name` (string) (required) — Symbol display name - `position_id` (string) — Related position identifier - `client_order_id` (string) — Client-provided order identifier - `parent_order_id` (string) — Parent order identifier for bracket orders - `cancels_order_id` (string) — Order that this order cancels - `created_at` (string) — Order creation timestamp - `updated_at` (string) — Order last update timestamp - `expiration_date` (string) — Order expiration timestamp - `qty_original` (number) (required) — Original order quantity - `qty_filled` (number) (required) — Filled quantity - `qty_remaining` (number) — Remaining quantity - `limit_price` (number) — Limit price for limit orders - `stop_price` (number) — Stop price for stop orders - `fill_price` (number) — The average fill price (VWAP) for filled/partially filled orders - `side` (any) (required) - `type` (string) (required) - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP` - `status` (string) (required) - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED`, `ORDER_STATUS_PARTIALLY_FILLED` - `time_in_force` (string) - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD` - `comment` (string) — Order comment #### `400` — Bad request (missing or invalid account_id) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (account access denied) **Content-Type:** `application/json` #### `404` — Account not found **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Reverse Position > Closes an open position with a market order and, on terminal fill, automatically opens an opposing position with the same filled quantity. Source: /trader/api/trading/reverse-position ## `POST /accounts/{account_id}/positions/{position_id}/reverse` **Reverse Position** Closes an open position with a market order and, on terminal fill, automatically opens an opposing position with the same filled quantity. Tags: `Trading` #### Path parameters - `account_id` (string) (required) — The account ID where the position to reverse belongs - `position_id` (string) (required) — Position ID to reverse ### Responses #### `201` — Position reverse closing order created successfully **Content-Type:** `application/json` - `closing_order_id` (string) (required) — The created reverse closing market order identifier #### `400` — Bad request (missing or invalid fields) **Content-Type:** `application/json` - `error` (object) (required) - `type` (string) (required) — Error type code - `message` (string) (required) — Human-readable error message - `field` (string) — Field name if error is field-specific #### `401` — Unauthorized (invalid or missing JWT token) **Content-Type:** `application/json` #### `403` — Forbidden (position access denied) **Content-Type:** `application/json` #### `404` — Position not found **Content-Type:** `application/json` #### `422` — Unprocessable entity (business rule violation, e.g. position not open) **Content-Type:** `application/json` #### `500` — Internal server error **Content-Type:** `application/json` # Trader APIs > Market data, trading, and streaming endpoints for building custom terminals, mobile apps, and algo/API trading. Source: /trader # Websocket API > Real-time streaming over a single authenticated WebSocket connection — quotes, depth, account metrics, and execution events. Source: /trader/websocket The Trader WebSocket API delivers real-time market data and account events over a single authenticated connection. ## Connect ``` wss:///api/v1/ws?token= ``` Pass the JWT obtained from [`POST /api/v1/login`](/trader/api/client-login) as the `token` query parameter. Connections without a valid token are closed immediately. Respond to server pings with WebSocket pong frames to keep the connection alive. ## Message envelope Every message — client → server and server → client — uses the same envelope: ```json { "type": "", "payload": { ... } } ``` The `type` field selects the payload schema below. ## Client → server messages | Type | Purpose | Payload | | --- | --- | --- | | `subscribe` | Subscribe to quote / execution / portfolio events for a symbol list | `{ symbols: string[], events: ("quoteEvent" \| "executionEvent" \| "portfolioEvent")[] }` | | `unsubscribe` | Stop a `subscribe` stream | `{ symbols: string[], events: string[] }` | | `depthSubscribe` | Subscribe to order-book depth for a symbol | `{ symbol: string, depth?: number }` | | `depthUnsubscribe` | Stop depth stream | `{ symbol: string }` | | `metricsSubscribe` | Subscribe to account metrics updates | `{ accountId: string }` | | `createOrder` / `cancelOrder` / `amendOrder` | Trading actions | Same body as the equivalent REST endpoint, e.g. [`POST /accounts/{account_id}/orders`](/trader/api/create-order) | | `closePosition` / `amendPosition` | Position management | Same body as the equivalent REST endpoint | | `orderHistory` / `positionHistory` / `dealHistory` | Historical queries | Same body as the equivalent REST endpoint | ## Server → client messages | Type | Sent when | | --- | --- | | `subscribed` | Acknowledges a `subscribe` request | | `unsubscribed` | Acknowledges an `unsubscribe` request | | `quoteEvent` | A subscribed symbol's quote changes | | `executionEvent` | An order belonging to the authenticated account fills, partially fills, or is cancelled | | `portfolioEvent` | The account's portfolio (positions, balances) changes | | `depthEvent` | Order-book depth update for a subscribed symbol | | `metricsEvent` | Account metrics update (equity, margin, P&L) | | `error` | The server rejected a message; payload includes a `code` and `message` | ## Example Subscribe to quotes and executions for two symbols, then stream events: ```json // → client { "type": "subscribe", "payload": { "symbols": ["EURUSD", "GBPUSD"], "events": ["quoteEvent", "executionEvent"] } } // ← server { "type": "subscribed", "payload": { "symbols": ["EURUSD", "GBPUSD"], "events": ["quoteEvent", "executionEvent"] } } // ← server (continuous) { "type": "quoteEvent", "payload": { "symbol": "EURUSD", "bid": 1.0843, "ask": 1.0844, "ts": "2026-06-01T12:00:00Z" } } ``` To send a trading action, wrap the REST request body in the envelope: ```json { "type": "createOrder", "payload": { "accountId": "acc_123", "symbol": "EURUSD", "side": "BUY", "quantity": 10000, "type": "MARKET" } } ``` The server replies with an `executionEvent` once the order is accepted, then again on each fill.