Skip to content

MngGetAccountsByFilter

MngGetAccountsByFilter

Command: MngGetAccountsByFilter

Deprecated alias: GetUsersByFilter

GetUsersByFilter is kept only for backward compatibility. New integrations must use MngGetAccountsByFilter; the alias may be removed in a future release.

Description: Returns a paginated table of accounts filtered by groupFilter. Supports optional where, orWhere, whereNot, and orderBy rules and returns aggregate totals for the full matched set before pagination.

Access Control

🛡️ Access Level Required: SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER

Access Scope

The request groupFilter only narrows the result. The server also applies the current cached manager scope: access_backoffice, see_accounts, see_accounts_balance, groups, and brand. count and totals are calculated after this visibility scope. Token payload is used only to resolve the manager id and session type.

Endpoint

GET /accounts

Request Parameters

Name Type Required Description
groupFilter string Yes Group mask used to select accounts, for example STD-* or *
limit int Yes Maximum number of rows to return
offset int Yes Row offset for pagination
where array No Additional filter rules
orWhere array No OR comparison group in [[field, operator, value], ...] format; at least one condition must match
whereNot array No Negated filter rules
whereIn array No Inclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereNotIn array No Exclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereBetween array No Range filter rules in [[field, [from, to]], ...] format
whereNotBetween array No Negative range filter rules in [[field, [from, to]], ...] format
orderBy array No Sort rule in [field, "ASC" \| "DESC"] format

Supported Filter Keys

  • where: [[field, operator, value], ...]
  • orWhere: [[field, operator, value], ...]; at least one condition must match
  • whereNot: [[field, value], ...]
  • whereIn: [[field, [value1, value2, ...]], ...]
  • whereNotIn: [[field, [value1, value2, ...]], ...]
  • whereBetween: [[field, [from, to]], ...]
  • whereNotBetween: [[field, [from, to]], ...]

Supported where Operators

  • =
  • ==
  • !=
  • >
  • <
  • >=
  • <=
  • like

Request Example

{
  "command": "MngGetAccountsByFilter",
  "data": {
    "groupFilter": "STD-*",
    "limit": 100,
    "offset": 0,
    "where": [
      ["enable", "=", 1]
    ],
    "orWhere": [
      ["name", "like", "john"],
      ["email", "like", "john"]
    ]
  }
}

Response Parameters

Name Type Description
structure array Column order used in rows
rows array Account rows
count int Total number of matched accounts
total_balance double Total balance across matched accounts
total_credit double Total credit across matched accounts
total_profit double Total gross floating profit across matched accounts
total_net_profit double Total net profit across matched accounts: profit + storage + commission
total_storage double Total storage/swap across matched accounts
total_commission double Total commission across matched accounts
total_margin double Total used margin across matched accounts
total_margin_free double Total free margin across matched accounts
total_equity double Total equity across matched accounts
total_prevbalance double Total previous-day balance across matched accounts
total_prevmonthbalance double Total previous-month balance across matched accounts

Totals are calculated across all accounts matched by groupFilter and all filter rules, before offset and limit are applied.

Row Fields

  • login
  • enable
  • enable_read_only
  • enable_change_password
  • leverage
  • currency
  • group
  • brand
  • email
  • country
  • phone
  • comment
  • address
  • city
  • zipcode
  • name
  • regdate
  • prevbalance
  • prevmonthbalance
  • balance
  • credit
  • margin
  • margin_free
  • margin_level
  • equity
  • profit
  • net_profit
  • storage
  • commission
  • online
  • magic
  • customer_id
  • update_time

Response Example

{
  "structure": [
    "login", "enable", "enable_read_only", "enable_change_password",
    "leverage", "currency", "group", "email", "country", "phone",
    "comment", "address", "city", "zipcode", "name", "regdate",
    "prevbalance", "prevmonthbalance", "balance", "credit",
    "margin", "margin_free", "margin_level", "equity", "profit", "net_profit", "storage", "commission", "online", "magic", "customer_id", "update_time"
  ],
  "rows": [
    [
      1001, 1, 0, 1, 100, "USD", "STD-1", "[email protected]", "CY", "+35700000000",
      "", "Street 1", "Limassol", "3010", "John Doe", 1713000000,
      1200.5, 1100.0, 1500.0, 0.0, 250.0, 1250.0, 600.0, 1500.0, 0.0, -1.6, -0.4, -1.2, 1, 0, 0, 1713000100
    ]
  ],
  "count": 1,
  "total_balance": 1500.0,
  "total_credit": 0.0,
  "total_profit": 0.0,
  "total_net_profit": -1.6,
  "total_storage": -0.4,
  "total_commission": -1.2,
  "total_margin": 250.0,
  "total_margin_free": 1250.0,
  "total_equity": 1500.0,
  "total_prevbalance": 1200.5,
  "total_prevmonthbalance": 1100.0
}