Partner API

Trading accounts

Open live or demo accounts under the brand's rules and read accounts, balance and positions of a user.

GET/api/external/v1/users/{external_id}/accounts

#The user's trading accounts with their balances

Auth X-Api-Key accounts:read Partner API

Scope accounts:read.

Path parameters

external_id string required

Your client id (1-191 letters, digits, . _ @ : + -). Stored on the client as external_user_id.

Responses

200

The accounts.

curl "https://api.your-brand.com/api/external/v1/users/cust_10042/accounts" \
  -H "X-Api-Key: $OCTOLIT_PARTNER_KEY"
Response 200
{
  "accounts": [
    {
      "id": 1042,
      "name": "Main",
      "currency": "USD",
      "demo": false,
      "type": {
        "id": 1042,
        "name": "Main",
        "provider": "string"
      },
      "balance": "10250.00",
      "equity": "10312.40",
      "margin": "108.45",
      "free_margin": "10203.95",
      "margin_level": "9509.3",
      "open_pl": "string",
      "closed_pl": "string",
      "credit": "string",
      "mt_login": "string",
      "created_at": "2026-11-11T09:30:00.000000Z"
    }
  ]
}
POST/api/external/v1/users/{external_id}/accounts

#Open a trading account (live or demo)

Auth X-Api-Key accounts:write Partner API

Scope accounts:write. The brand's own rules apply: the account type decides whether the account is demo or live (a demo type always gives a demo account; demo: true on the default live type gives a demo account on live pricing), the brand's maximum number of live / demo accounts per client is enforced (409 limit_reached), the currency must be one the platform supports.

Path parameters

external_id string required

Your client id (1-191 letters, digits, . _ @ : + -). Stored on the client as external_user_id.

Request body (optional) · application/json

account_type_id integer optional

An account type of the company (default = the company's default type).

currency string optional

3-letter code (USD

demo boolean optional
name string optional

0-64 characters.

Responses

201

The new account (balance 0).

403

insufficient_scope, ip_not_allowed, api_disabled, company_inactive, brand_disabled, sso_disabled, trending_disabled (trading on behalf also: brand_inactive, client_inactive, trading_inactive, trading_denied).

409

email_taken, brand_fixed, limit_reached, already_linked, no_brand, no_app_domain.

422

invalid_request with details.errors = { field: reason }.

curl -X POST "https://api.your-brand.com/api/external/v1/users/cust_10042/accounts" \
  -H "X-Api-Key: $OCTOLIT_PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "account_type_id": 3,
  "currency": "USD",
  "demo": false,
  "name": "Main"
}'
Response 201
{
  "account": {
    "id": 1042,
    "name": "Main",
    "currency": "USD",
    "demo": false,
    "type": {
      "id": 1042,
      "name": "Main",
      "provider": "string"
    },
    "balance": "10250.00",
    "equity": "10312.40",
    "margin": "108.45",
    "free_margin": "10203.95",
    "margin_level": "9509.3",
    "open_pl": "string",
    "closed_pl": "string",
    "credit": "string",
    "mt_login": "string",
    "created_at": "2026-11-11T09:30:00.000000Z"
  }
}
GET/api/external/v1/users/{external_id}/balance

#The user's balance, equity and margin (all accounts)

Auth X-Api-Key accounts:read Partner API

Scope accounts:read. Values are the platform's live figures at as_of; MT accounts show the last figures the connector reported.

Path parameters

external_id string required

Your client id (1-191 letters, digits, . _ @ : + -). Stored on the client as external_user_id.

Responses

200

The balance.

curl "https://api.your-brand.com/api/external/v1/users/cust_10042/balance" \
  -H "X-Api-Key: $OCTOLIT_PARTNER_KEY"
Response 200
{
  "balance": {
    "currency": "USD",
    "balance": "10250.00",
    "equity": "10312.40",
    "margin": "108.45",
    "free_margin": "10203.95",
    "margin_level": "9509.3",
    "open_pl": "string",
    "credit": "string",
    "as_of": "2026-11-11T09:30:00Z",
    "accounts": [
      {
        "id": 1042,
        "name": "Main",
        "currency": "USD",
        "demo": false,
        "type": {
          "id": 1042,
          "name": "Main",
          "provider": "string"
        },
        "balance": "10250.00",
        "equity": "10312.40",
        "margin": "108.45",
        "free_margin": "10203.95",
        "margin_level": "9509.3",
        "open_pl": "string",
        "closed_pl": "string",
        "credit": "string",
        "mt_login": "string",
        "created_at": "2026-11-11T09:30:00.000000Z"
      }
    ]
  }
}
GET/api/external/v1/users/{external_id}/positions

#The user's positions

Auth X-Api-Key accounts:read Partner API

Scope accounts:read. Newest first; page with before_id = the last id you saw (next_before_id).

Path parameters

external_id string required

Your client id (1-191 letters, digits, . _ @ : + -). Stored on the client as external_user_id.

Query parameters

status enum optional
openpendingclosed
account_id integer optional
per_page integer optional
before_id integer optional

Responses

200

One page.

422

invalid_request with details.errors = { field: reason }.

curl "https://api.your-brand.com/api/external/v1/users/cust_10042/positions" \
  -H "X-Api-Key: $OCTOLIT_PARTNER_KEY"
Response 200
{
  "positions": [
    {
      "id": 1042,
      "account_id": 55,
      "symbol": "EURUSD",
      "status": "open",
      "side": "buy",
      "order_type": 1,
      "amount": "100.00",
      "trade_amount": "string",
      "units": 10000,
      "lot_size": 1.5,
      "leverage": 100,
      "open_price": "string",
      "stop_loss": "string",
      "take_profit": "string",
      "profit": "19.00",
      "commission": "0.00",
      "swap": "-0.12",
      "market": "string",
      "opened_at": "2026-11-11T09:30:00Z",
      "closed_at": "2026-11-11T10:05:12Z",
      "closed_by": "string",
      "created_at": "2026-11-11T09:30:00.000000Z"
    }
  ],
  "next_before_id": 42
}