Skip to main content
Developers

REST API reference

Every endpoint of the JAFX Trading API v1, generated from the OpenAPI 3.1 specification. Base URL https://terminal.jafx.com/trading-api/v1. Send your key on every request as Authorization: Bearer <key>; every write also needs an Idempotency-Key header (see Conventions).

EndpointWhat it doesScope
GET /statusService status (no key needed)No key needed
GET /meThe calling key, its limits and the trading stateAny valid key
GET /symbolsTradable instrumentsmarket:read
GET /symbols/{symbol}One instrumentmarket:read
GET /quotesCurrent quotesmarket:read
GET /candles/{symbol}OHLC candles (the last one may still be forming)market:read
GET /accountsThe key's account (a list of one)account:read
GET /accounts/{account}Account summaryaccount:read
GET /accounts/{account}/positionsOpen positionsaccount:read
GET /accounts/{account}/ordersPending ordersaccount:read
GET /accounts/{account}/tradesTrades closed in a window (by close time), newest firstaccount:read
GET /accounts/{account}/transactionsBalance and credit operationsaccount:read
PATCH /accounts/{account}/positions/{ticket}Change stop loss / take profit (null removes one; an omitted one is kept)trade or trade:propose
POST /accounts/{account}/positions/{ticket}/closeClose a position, wholly or partlytrade or trade:propose
POST /accounts/{account}/ordersPlace a market or pending ordertrade or trade:propose
PATCH /accounts/{account}/orders/{ticket}Change a pending order (omitted fields are kept; null removes a stop or the expiry)trade or trade:propose
DELETE /accounts/{account}/orders/{ticket}Cancel a pending ordertrade or trade:propose
GET /accounts/{account}/requests/{request_id}Where an order request standsaccount:read
GET /accounts/{account}/proposalsProposals created by this key (confirm mode)trade or trade:propose

Status and key

Service status and the calling key's scopes, limits and trading state.

GET /status

Service status (no key needed)

Scope: No key needed

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/status" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "status": "ok",
  "api_version": "v1",
  "time": "2026-10-13T09:30:00.000Z",
  "market_data": {
    "connected": true,
    "symbols": 39,
    "last_tick_age_ms": 180
  },
  "broker": {
    "state": "connected"
  },
  "live_trading_enabled": false
}

GET /me

The calling key, its limits and the trading state

Scope: Any valid key

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/me" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "key_id": "k7mx2v9qr4tz8w1b6nfa",
  "name": "breakout bot",
  "account": 123456,
  "mode": "demo",
  "profile": "client",
  "scopes": [
    "market:read",
    "account:read",
    "trade"
  ],
  "constraints": {
    "demo_only": true,
    "max_volume_per_order": "1.00",
    "max_open_positions": 20,
    "orders_per_minute": 30,
    "modifications_per_minute": 60,
    "daily_loss_limit": {
      "type": "percent",
      "value": "10"
    },
    "symbols": null,
    "ip_allowlist": null,
    "confirm_mode": false,
    "mcp_enabled": true
  },
  "expires_at": "2027-01-11T09:30:00.000Z",
  "trading": {
    "mode": "on",
    "level": "env",
    "reason": null
  },
  "live_trading_enabled": false
}

Market data

Instruments, quotes and candles from the central JAFX quote board.

GET /symbols

Tradable instruments

Scope: market:read

Responses

FieldTypeDescription
dataarray of Symbol
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/symbols" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "symbol": "EURUSD",
      "description": "Euro vs US Dollar",
      "group": "Forex",
      "digits": 5,
      "contract_size": 100000,
      "tick_size": 0.00001,
      "volume_min": "0.01",
      "volume_max": "100",
      "volume_step": "0.01",
      "trade_mode": "full",
      "long_only": false
    },
    {
      "symbol": "GBPUSD",
      "description": "Great Britain Pound vs US Dollar",
      "group": "Forex",
      "digits": 5,
      "contract_size": 100000,
      "tick_size": 0.00001,
      "volume_min": "0.01",
      "volume_max": "100",
      "volume_step": "0.01",
      "trade_mode": "full",
      "long_only": false
    }
  ]
}

GET /symbols/{symbol}

One instrument

Scope: market:read

Parameters

NameInTypeDescription
symbol requiredpathstring

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/symbols/EURUSD" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "symbol": "EURUSD",
  "description": "Euro vs US Dollar",
  "group": "Forex",
  "digits": 5,
  "contract_size": 100000,
  "tick_size": 0.00001,
  "volume_min": "0.01",
  "volume_max": "100",
  "volume_step": "0.01",
  "trade_mode": "full",
  "long_only": false
}

GET /quotes

Current quotes

Scope: market:read

Parameters

NameInTypeDescription
symbolsquerystringComma-separated, at most 50. All instruments when omitted.

Responses

FieldTypeDescription
dataarray of Quote
missingarray of string
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/quotes?symbols=EURUSD,XAUUSD" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "symbol": "EURUSD",
      "bid": 1.11554,
      "ask": 1.11555,
      "time": "2026-10-13T09:30:01.242Z",
      "price_basis": "raw"
    },
    {
      "symbol": "XAUUSD",
      "bid": 4170.05,
      "ask": 4170.72,
      "time": "2026-10-13T09:30:01.834Z",
      "price_basis": "raw"
    }
  ],
  "missing": []
}

GET /candles/{symbol}

OHLC candles (the last one may still be forming)

Scope: market:read

Parameters

NameInTypeDescription
symbol requiredpathstring
timeframequerystringOne of M1, M5, M15, M30, H1, H4, D1, W1. Default "M1".
fromquerystring (date-time)
toquerystring (date-time)
limitqueryintegerDefault 500. Must be ≥ 1 and ≤ 2000.

Responses

FieldTypeDescription
symbolstring
timeframestring
price_basisstringOne of raw.
dataarray of Candle
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/candles/EURUSD?timeframe=M5&limit=3" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "symbol": "EURUSD",
  "timeframe": "M5",
  "price_basis": "raw",
  "data": [
    {
      "time": "2026-10-13T09:20:00.000Z",
      "open": 1.11511,
      "high": 1.11528,
      "low": 1.11507,
      "close": 1.11524,
      "tick_volume": 412,
      "complete": true
    },
    {
      "time": "2026-10-13T09:25:00.000Z",
      "open": 1.11524,
      "high": 1.11561,
      "low": 1.11519,
      "close": 1.11549,
      "tick_volume": 388,
      "complete": true
    },
    {
      "time": "2026-10-13T09:30:00.000Z",
      "open": 1.11549,
      "high": 1.11558,
      "low": 1.11546,
      "close": 1.11554,
      "tick_volume": 41,
      "complete": false
    }
  ]
}

Account

The key's trading account — summary, positions, pending orders, history.

GET /accounts

The key's account (a list of one)

Scope: account:read

Responses

FieldTypeDescription
dataarray of Account
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "account": 123456,
      "group": "demo-usd",
      "mode": "demo",
      "currency": "USD",
      "leverage": 100,
      "balance": "10000.00",
      "credit": "0.00",
      "equity": "10003.20",
      "margin": "223.11",
      "free_margin": "9780.09",
      "floating_profit": "3.20",
      "margin_level": 4483.53,
      "as_of": "2026-10-13T09:30:02.114Z"
    }
  ]
}

GET /accounts/{account}

Account summary

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "account": 123456,
  "group": "demo-usd",
  "mode": "demo",
  "currency": "USD",
  "leverage": 100,
  "balance": "10000.00",
  "credit": "0.00",
  "equity": "10003.20",
  "margin": "223.11",
  "free_margin": "9780.09",
  "floating_profit": "3.20",
  "margin_level": 4483.53,
  "as_of": "2026-10-13T09:30:02.114Z"
}

GET /accounts/{account}/positions

Open positions

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
client_tagquerystringPattern ^[A-Za-z0-9._:-]{1,32}$.

Responses

FieldTypeDescription
dataarray of Position
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/positions?client_tag=breakout-v2" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "ticket": 5001,
      "symbol": "EURUSD",
      "side": "buy",
      "volume": "0.02",
      "open_price": 1.11555,
      "open_time": "2026-10-13T09:29:47.512Z",
      "stop_loss": 1.11,
      "take_profit": null,
      "swap": "0.00",
      "commission": "0.00",
      "taxes": "0.00",
      "profit": "-0.02",
      "comment": "",
      "origin": "api",
      "client_tag": "breakout-v2",
      "from_ticket": null
    }
  ]
}

GET /accounts/{account}/orders

Pending orders

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
client_tagquerystringPattern ^[A-Za-z0-9._:-]{1,32}$.

Responses

FieldTypeDescription
dataarray of PendingOrder
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/orders" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "ticket": 5003,
      "symbol": "EURUSD",
      "type": "buy_limit",
      "volume": "0.10",
      "price": 1.108,
      "stop_loss": 1.104,
      "take_profit": 1.118,
      "expires_at": "2026-10-20T00:00:00.000Z",
      "placed_at": "2026-10-13T09:31:12.003Z",
      "comment": "",
      "origin": "api",
      "client_tag": "breakout-v2"
    }
  ]
}

GET /accounts/{account}/trades

Trades closed in a window (by close time), newest first

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
fromquerystring (date-time)Default: 7 days before to.
toquerystring (date-time)Default: now. The window may span 90 days.
client_tagquerystringPattern ^[A-Za-z0-9._:-]{1,32}$.
cursorquerystring
limitqueryintegerDefault 100. Must be ≥ 1 and ≤ 1000.

Responses

FieldTypeDescription
dataarray of ClosedTrade
next_cursorstring | null
fromstring (date-time)
tostring (date-time)
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/trades?from=2026-10-06T00:00:00Z&client_tag=breakout-v2" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "ticket": 5002,
      "symbol": "EURUSD",
      "side": "buy",
      "type": "market",
      "volume": "0.01",
      "open_price": 1.11555,
      "open_time": "2026-10-13T09:29:47.512Z",
      "close_price": 1.11602,
      "close_time": "2026-10-13T10:02:15.880Z",
      "stop_loss": 1.1105,
      "take_profit": null,
      "swap": "0.00",
      "commission": "0.00",
      "taxes": "0.00",
      "profit": "0.47",
      "state": "closed",
      "comment": "",
      "origin": "api",
      "client_tag": "breakout-v2"
    },
    {
      "ticket": 5001,
      "symbol": "EURUSD",
      "side": "buy",
      "type": "market",
      "volume": "0.01",
      "open_price": 1.11555,
      "open_time": "2026-10-13T09:29:47.512Z",
      "close_price": 1.11564,
      "close_time": "2026-10-13T09:33:40.101Z",
      "stop_loss": 1.1105,
      "take_profit": null,
      "swap": "0.00",
      "commission": "0.00",
      "taxes": "0.00",
      "profit": "0.09",
      "state": "closed_partial",
      "comment": "",
      "origin": "api",
      "client_tag": "breakout-v2"
    }
  ],
  "next_cursor": null,
  "from": "2026-10-06T00:00:00.000Z",
  "to": "2026-10-13T10:05:00.000Z"
}

GET /accounts/{account}/transactions

Balance and credit operations

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
fromquerystring (date-time)
toquerystring (date-time)
cursorquerystring
limitqueryintegerDefault 100. Must be ≥ 1 and ≤ 1000.

Responses

FieldTypeDescription
dataarray of Transaction
next_cursorstring | null
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/transactions" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "ticket": 4001,
      "type": "balance",
      "amount": "10000.00",
      "time": "2026-10-01T08:00:00.000Z",
      "comment": "Demo deposit"
    }
  ],
  "next_cursor": null
}

Trading

Orders, changes and closes. Every write needs an Idempotency-Key header.

PATCH /accounts/{account}/positions/{ticket}

Change stop loss / take profit (null removes one; an omitted one is kept)

Scope: trade or trade:proposeIdempotency-Key: required

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
waitquerynumberSeconds to wait for a held broker decision before answering 202. Default 5. Must be ≥ 0 and ≤ 10.

Request body

FieldTypeDescription
stop_lossnumber | nullMust be > 0.
take_profitnumber | nullMust be > 0.

Responses

Request
curl
curl -X PATCH "https://terminal.jafx.com/trading-api/v1/accounts/123456/positions/5001" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"stop_loss":1.1105}'
Response 200
JSON
{
  "request_id": "01JQ8ZC4M7Q2X9T5RN3VW8KH1A",
  "kind": "modify_position",
  "status": "placed",
  "ticket": 5001,
  "broker_status": "dc-answered",
  "failure": null,
  "client_tag": null,
  "position": {
    "ticket": 5001,
    "symbol": "EURUSD",
    "side": "buy",
    "volume": "0.02",
    "open_price": 1.11555,
    "open_time": "2026-10-13T09:29:47.512Z",
    "stop_loss": 1.1105,
    "take_profit": null,
    "swap": "0.00",
    "commission": "0.00",
    "taxes": "0.00",
    "profit": "0.18",
    "comment": "",
    "origin": "api",
    "client_tag": "breakout-v2",
    "from_ticket": null
  }
}

POST /accounts/{account}/positions/{ticket}/close

Close a position, wholly or partly

Scope: trade or trade:proposeIdempotency-Key: required

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
waitquerynumberSeconds to wait for a held broker decision before answering 202. Default 5. Must be ≥ 0 and ≤ 10.

Request body (optional)

FieldTypeDescription
volumedecimal string

Responses

Request
curl
curl -X POST "https://terminal.jafx.com/trading-api/v1/accounts/123456/positions/5001/close" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"volume":"0.01"}'
Response 200
JSON
{
  "request_id": "01JQ8ZD9R2K6W4T8NB1XQ5VH3M",
  "kind": "close",
  "status": "filled",
  "ticket": 5002,
  "broker_status": "dc-answered",
  "failure": null,
  "client_tag": null,
  "position": {
    "ticket": 5002,
    "symbol": "EURUSD",
    "side": "buy",
    "volume": "0.01",
    "open_price": 1.11555,
    "open_time": "2026-10-13T09:29:47.512Z",
    "stop_loss": 1.1105,
    "take_profit": null,
    "swap": "0.00",
    "commission": "0.00",
    "taxes": "0.00",
    "profit": "0.09",
    "comment": "",
    "origin": "api",
    "client_tag": "breakout-v2",
    "from_ticket": 5001
  }
}

POST /accounts/{account}/orders

Place a market or pending order

201 executed or placed · 202 pending (broker still deciding), awaiting_confirmation (confirm-mode key) or outcome_unknown (poll the request; never resend under a new key) · 4xx problem.

Scope: trade or trade:proposeIdempotency-Key: required

Parameters

NameInTypeDescription
account requiredpathinteger
waitquerynumberSeconds to wait for a held broker decision before answering 202. Default 5. Must be ≥ 0 and ≤ 10.

Request body

FieldTypeDescription
symbol requiredstring
side requiredstringOne of buy, sell.
typestringOne of market, limit, stop. Default "market".
volume requireddecimal string
pricenumberRequired for limit and stop. Must be > 0.
stop_lossnumberMust be > 0.
take_profitnumberMust be > 0.
expires_atstring (date-time)Limit and stop only.
commentstringUp to 200 characters.
client_tagstringStored with the trade (e.g. an MT magic number as "magic:42"). Pattern ^[A-Za-z0-9._:-]{1,32}$.

Responses

Request
curl
curl -X POST "https://terminal.jafx.com/trading-api/v1/accounts/123456/orders" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"EURUSD","side":"buy","type":"market","volume":"0.02","stop_loss":1.11,"client_tag":"breakout-v2"}'
Response 201
JSON
{
  "request_id": "01JQ8Z6M3S4X7T2N9CKV5W0HRB",
  "kind": "market",
  "status": "filled",
  "ticket": 5001,
  "broker_status": "dc-answered",
  "failure": null,
  "client_tag": "breakout-v2",
  "position": {
    "ticket": 5001,
    "symbol": "EURUSD",
    "side": "buy",
    "volume": "0.02",
    "open_price": 1.11555,
    "open_time": "2026-10-13T09:29:47.512Z",
    "stop_loss": 1.11,
    "take_profit": null,
    "swap": "0.00",
    "commission": "0.00",
    "taxes": "0.00",
    "profit": "-0.02",
    "comment": "",
    "origin": "api",
    "client_tag": "breakout-v2",
    "from_ticket": null
  }
}

PATCH /accounts/{account}/orders/{ticket}

Change a pending order (omitted fields are kept; null removes a stop or the expiry)

Scope: trade or trade:proposeIdempotency-Key: required

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
waitquerynumberSeconds to wait for a held broker decision before answering 202. Default 5. Must be ≥ 0 and ≤ 10.

Request body

FieldTypeDescription
pricenumberMust be > 0.
stop_lossnumber | nullMust be > 0.
take_profitnumber | nullMust be > 0.
expires_atstring (date-time) | null

Responses

Request
curl
curl -X PATCH "https://terminal.jafx.com/trading-api/v1/accounts/123456/orders/5001" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"price":1.1075,"take_profit":null}'
Response 200
JSON
{
  "request_id": "01JQ8ZF2T6N8V1X4KR7QW3MB9C",
  "kind": "modify_order",
  "status": "placed",
  "ticket": 5003,
  "broker_status": "dc-answered",
  "failure": null,
  "client_tag": null,
  "order": {
    "ticket": 5003,
    "symbol": "EURUSD",
    "type": "buy_limit",
    "volume": "0.10",
    "price": 1.1075,
    "stop_loss": 1.104,
    "take_profit": null,
    "expires_at": "2026-10-20T00:00:00.000Z",
    "placed_at": "2026-10-13T09:31:12.003Z",
    "comment": "",
    "origin": "api",
    "client_tag": "breakout-v2"
  }
}

DELETE /accounts/{account}/orders/{ticket}

Cancel a pending order

Scope: trade or trade:proposeIdempotency-Key: required

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
waitquerynumberSeconds to wait for a held broker decision before answering 202. Default 5. Must be ≥ 0 and ≤ 10.

Responses

Request
curl
curl -X DELETE "https://terminal.jafx.com/trading-api/v1/accounts/123456/orders/5001" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200
JSON
{
  "request_id": "01JQ8ZG7W3R5M9T2XN6KQ1VB4D",
  "kind": "cancel",
  "status": "placed",
  "ticket": 5003,
  "broker_status": "dc-answered",
  "failure": null,
  "client_tag": null
}

GET /accounts/{account}/requests/{request_id}

Where an order request stands

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
request_id requiredpathstring

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/requests/01JQ8Z6M3S4X7T2N9CKV5W0HRB" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "request_id": "01JQ8Z6M3S4X7T2N9CKV5W0HRB",
  "kind": "market",
  "status": "filled",
  "ticket": 5001,
  "failure": null,
  "client_tag": "breakout-v2",
  "created_at": "2026-10-13T09:29:47.301Z",
  "decided_at": "2026-10-13T09:29:47.512Z"
}

GET /accounts/{account}/proposals

Proposals created by this key (confirm mode)

Scope: trade or trade:propose

Parameters

NameInTypeDescription
account requiredpathinteger

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/proposals" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "proposal_id": "01JQ8ZB0Y4D2PQ7RS1VW3XHN6E",
      "status": "pending",
      "summary": "BUY 0.01 EURUSD market",
      "created_at": "2026-10-13T09:40:00.000Z",
      "expires_at": "2026-10-13T09:50:00.000Z",
      "decided_at": null,
      "result": null
    }
  ]
}

Schemas

Objects returned and accepted by the endpoints above. Money and volume are decimal strings; prices are numbers.

Status

FieldTypeDescription
statusstringOne of ok, degraded.
api_versionstring
timestring (date-time)
market_dataobject
brokerobjectHow account data and trading reach the broker, per server. state is the worst of them.
broker.stateBrokerState
broker.serversobject
broker.servers.liveServerStatus
broker.servers.demoServerStatus
broker.notestringOrders go through each account's own session: an account's keys trade for 24 hours after its owner signs in to JAFX Terminal, or around the clock when the owner switches that on in Developers.
live_trading_enabledboolean

ServerStatus

FieldTypeDescription
stateBrokerState
sign_in_needed_forarray of stringWhat needs the account owner's sign-in in the last 24 hours on this server: always trading; account data too where nothing else serves it (account_data). Items: trading, account_data.

BrokerState

ready: up; each account's session opens when its keys are used. connected: up, with a standing connection. disabled: not available on that server right now (503 broker_unavailable).

string

Session

The account's trading session that its keys trade through. It lasts 24 hours from the owner's last sign-in to JAFX Terminal (or Renew on its Developers page), whether or not the terminal stays open. With around-the-clock trading on, JAFX signs it in again by itself before it ends, or at the next request after it ended.

FieldTypeDescription
activeboolean
renews_automaticallybooleanThe owner switched on Keep my bots trading around the clock in Developers: JAFX signs this session in again by itself, so the keys keep trading past expires_at.
signed_in_atstring (date-time) | null
expires_atstring (date-time) | nullUntil when this sign-in lasts (present while active). With renews_automatically, the next one follows by itself.
ended_atstring (date-time) | null
ended_reasonstring | nullstopped: the owner pressed Stop API trading. expired: 24 hours passed. ended_by_broker, resume_refused: the session ended at the broker (a sign-out of it, a password change). no_active_key: the account's last key went. password_refused: around-the-clock trading stopped because the trading account refused the saved password (for example after a password change); the owner switches it on again in Developers. One of stopped, expired, ended_by_broker, resume_refused, no_active_key, not_master, unreadable, password_refused, null.
notestring

Me

FieldTypeDescription
key_idstring
namestring
accountinteger
serverstringThe server the account is on: Live Server or Demo Server. Account numbers are per server. One of live, demo.
modestringOne of demo, live.
profilestringOne of client, strategy.
scopesarray of stringItems: market:read, account:read, trade, trade:propose.
constraintsConstraints
expires_atstring (date-time)
tradingobject
trading.modestringOne of on, close_only, off.
trading.levelstring
trading.reasonstring | null
sessionSession
live_trading_enabledboolean

Constraints

FieldTypeDescription
demo_onlyboolean
max_volume_per_orderdecimal string
max_open_positionsinteger
orders_per_minuteinteger
modifications_per_minuteinteger
daily_loss_limitnull | object
symbolsarray of string | null
ip_allowlistarray of string | nullThe key's IP lock: up to 20 IP addresses or CIDR ranges it may be used from (any other answers 403 ip_not_allowed); null when the owner left it open to any IP address.
confirm_modeboolean
mcp_enabledboolean

Symbol

FieldTypeDescription
symbolstring
descriptionstring
groupstring
digitsinteger
contract_sizenumber
tick_sizenumber
volume_mindecimal string
volume_maxdecimal string
volume_stepdecimal string
trade_modestringOne of full, disabled.
long_onlyboolean

Quote

FieldTypeDescription
symbolstring
bidnumber
asknumber
timestring (date-time)
price_basisstringOne of raw, group.

Candle

FieldTypeDescription
timestring (date-time)Bar open time.
opennumber
highnumber
lownumber
closenumber
tick_volumeinteger
completeboolean

Account

FieldTypeDescription
accountinteger
groupstring
modestringOne of demo, live.
currencystring
leverageinteger
balancedecimal string
creditdecimal string
equitydecimal string
margindecimal string
free_margindecimal string
floating_profitdecimal string
margin_levelnumber | null
as_ofstring (date-time)

Position

FieldTypeDescription
ticketinteger
symbolstring
sidestringOne of buy, sell.
volumedecimal string
open_pricenumber
open_timestring (date-time)
stop_lossnumber | null
take_profitnumber | null
swapdecimal string
commissiondecimal string
taxesdecimal string
profitdecimal string
commentstring
originstringOne of api, web, mobile, dealer, expert, signal, client, other.
client_tagstring | null
from_ticketinteger | nullOriginal ticket of a partial-close remainder.

PendingOrder

FieldTypeDescription
ticketinteger
symbolstring
typestringOne of buy_limit, sell_limit, buy_stop, sell_stop.
volumedecimal string
pricenumber
stop_lossnumber | null
take_profitnumber | null
expires_atstring (date-time) | null
placed_atstring (date-time)
commentstring
originstring
client_tagstring | null

ClosedTrade

FieldTypeDescription
ticketinteger
symbolstring
sidestringOne of buy, sell.
volumedecimal string
open_pricenumber
open_timestring (date-time)
stop_lossnumber | null
take_profitnumber | null
swapdecimal string
commissiondecimal string
taxesdecimal string
profitdecimal string
commentstring
originstringOne of api, web, mobile, dealer, expert, signal, client, other.
client_tagstring | null
from_ticketinteger | nullOriginal ticket of a partial-close remainder.
typestringOne of market, buy_limit, sell_limit, buy_stop, sell_stop.
close_pricenumber | null
close_timestring (date-time)
statestringOne of closed, closed_partial, closed_by, cancelled, expired.

Transaction

FieldTypeDescription
ticketinteger
typestringOne of balance, credit.
amountdecimal string
timestring (date-time)
commentstring

OrderRequest

FieldTypeDescription
symbol requiredstring
side requiredstringOne of buy, sell.
typestringOne of market, limit, stop. Default "market".
volume requireddecimal string
pricenumberRequired for limit and stop. Must be > 0.
stop_lossnumberMust be > 0.
take_profitnumberMust be > 0.
expires_atstring (date-time)Limit and stop only.
commentstringUp to 200 characters.
client_tagstringStored with the trade (e.g. an MT magic number as "magic:42"). Pattern ^[A-Za-z0-9._:-]{1,32}$.

OrderResult

FieldTypeDescription
request_idstring
kindstringOne of market, pending, modify_position, modify_order, cancel, close.
statusstringOne of filled, placed, pending, rejected, outcome_unknown, awaiting_confirmation.
ticketinteger | null
broker_statusstring | null
failurestring | null
client_tagstring | null
positionPosition
orderPendingOrder
proposal_idstring
expires_atstring (date-time)
notestring

RequestStatus

FieldTypeDescription
request_idstring
kindstring
statusstringOne of received, sent, filled, placed, pending, rejected, outcome_unknown, refused, refused_by_broker, not_sent, proposed.
ticketinteger | null
failurestring | null
client_tagstring | null
created_atstring (date-time)
decided_atstring (date-time) | null

Problem

FieldTypeDescription
type requiredstring (uri)
title requiredstring
status requiredinteger
code requiredstringStable error code (see the developer guide's error table).
detailstring
request_idstring
detailsany

Automated and AI-driven trading can lose money quickly; nothing in these docs is investment advice.

JAFX (PTY) LTD · FSCA FSP No. 52058 · Trading leveraged derivatives with JAFX carries a high risk of losing money rapidly. It is not suitable for everyone.