Developer Portal

Create AccountPOST

Create a new trading account for a client profile. The account defines the client trading environment, including group and currency settings. Required: profileId, groupId, currency, and maxLeverage (must be greater than zero). The currency and spreadBetting (isSb) flags are IMMUTABLE after creation.

View as Markdown
POST
/accounts

Authorization

Authorization<token>

Bearer access token issued by the admin login flow.

In: header

Request Body

application/jsonRequired

The account to be created.

idCan be provided to override the auto generated ID, but it is not recommended as it may lead to data inconsistencies
groupIdstring

Required on create. Account group ID (from List Groups).

profileIdstring

Required on create. The client profile ID that owns this account.

currencystring

Required on create. Account currency; IMMUTABLE after creation (from List Currencies).

positionModePosition mode, NETING or HEDGING
Default: "POSITIONING_MODE_UNSPECIFIED"Value in: "POSITIONING_MODE_UNSPECIFIED" | "POSITIONING_MODE_NETTING" | "POSITIONING_MODE_HEDGING"
statusTrade status, ENABLED, DISABLED or CLOSE_ONLY
Default: "TRADE_STATUS_UNSPECIFIED"Value in: "TRADE_STATUS_UNSPECIFIED" | "TRADE_STATUS_FULL" | "TRADE_STATUS_CLOSE_ONLY" | "TRADE_STATUS_DISABLED" | "TRADE_STATUS_LONG_ONLY"
nopNet open positions limit in account currency
Format: "double"
balancenumber

Account balance. Read-only; set funds via deposit/withdraw, not on create.

Format: "double"
maxLeveragestring

Required on create, must be greater than zero. Maximum leverage allowed for this account.

Format: "uint64"
versionAccount version for optimistic locking
Format: "uint64"
isSbSpread Betting flag - IMMUTABLE after account creation, can only be set during creation
isDemoDemo account flag - indicates if this is a demo account (false = live account)
marginCalcTypeOverridePer-account override for margin calculation type

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
Default: "MARGIN_CALC_TYPE_UNSPECIFIED"Value in: "MARGIN_CALC_TYPE_UNSPECIFIED" | "MARGIN_CALC_TYPE_SUM" | "MARGIN_CALC_TYPE_MAX" | "MARGIN_CALC_TYPE_NET"
dailyStatementWhether daily statement emails are enabled for this account
creditnumber

Account credit ledger. Read-only; set via credit-in / credit-out endpoints.

Format: "double"
curl -X POST "https://example.com/accounts" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "string",
    "groupId": "string",
    "profileId": "string",
    "currency": "string",
    "positionMode": "POSITIONING_MODE_UNSPECIFIED",
    "status": "TRADE_STATUS_UNSPECIFIED",
    "nop": 0.1,
    "balance": 0.1,
    "maxLeverage": "string",
    "version": "string",
    "isSb": true,
    "isDemo": true,
    "marginCalcTypeOverride": "MARGIN_CALC_TYPE_UNSPECIFIED",
    "dailyStatement": true,
    "credit": 0.1
  }'

A successful response.

{
  "account": {
    "id": "string",
    "groupId": "string",
    "profileId": "string",
    "currency": "string",
    "positionMode": "POSITIONING_MODE_UNSPECIFIED",
    "status": "TRADE_STATUS_UNSPECIFIED",
    "nop": 0.1,
    "balance": 0.1,
    "maxLeverage": "string",
    "version": "string",
    "isSb": true,
    "isDemo": true,
    "marginCalcTypeOverride": "MARGIN_CALC_TYPE_UNSPECIFIED",
    "dailyStatement": true,
    "credit": 0.1
  }
}