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 /alertsJAFX's market alerts (sharp price moves), newest firstmarket:read
GET /live-scansWhich markets and timeframes JAFX AI's Live Scan covers, and how fresh each scan ismarket:read
GET /live-scans/{symbol}JAFX AI's Live Scan of a market on a timeframemarket:read
GET /market-sessionsWhether the Tokyo, London and New York stock exchanges are openmarket: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}/positions/{ticket}/share-imageThe JAFX share picture of an open position (PNG)account:read
GET /accounts/{account}/ordersPending ordersaccount:read
GET /accounts/{account}/tradesTrades closed in a window (by close time), newest firstaccount:read
GET /accounts/{account}/trades/{ticket}/share-imageThe JAFX share picture of a closed trade (PNG)account: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, candles, JAFX's market alerts, JAFX AI's Live Scan and the stock exchanges' sessions, from the central JAFX quote board, and quotes at your account's own prices.

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,
      "stops_level": 0,
      "trading_hours": {
        "open_now": true,
        "next_open": "2026-10-13T21:05:00.000Z",
        "next_close": "2026-10-13T20:58:00.000Z",
        "sessions": [
          {
            "open": "2026-10-13T09:30:00.000Z",
            "close": "2026-10-13T20:58:00.000Z"
          },
          {
            "open": "2026-10-13T21:05:00.000Z",
            "close": "2026-10-14T20:58:00.000Z"
          }
        ]
      }
    },
    {
      "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,
      "stops_level": 0,
      "trading_hours": {
        "open_now": true,
        "next_open": "2026-10-13T21:05:00.000Z",
        "next_close": "2026-10-13T20:58:00.000Z",
        "sessions": [
          {
            "open": "2026-10-13T09:30:00.000Z",
            "close": "2026-10-13T20:58:00.000Z"
          },
          {
            "open": "2026-10-13T21:05:00.000Z",
            "close": "2026-10-14T20:58:00.000Z"
          }
        ]
      }
    }
  ]
}

GET /symbols/{symbol}

One instrument

Scope: market:read

Parameters

NameInTypeDescription
symbol requiredpathstringAs GET /symbols lists it, in any case (USOil or usoil).

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,
  "stops_level": 0,
  "trading_hours": {
    "open_now": true,
    "next_open": "2026-10-13T21:05:00.000Z",
    "next_close": "2026-10-13T20:58:00.000Z",
    "sessions": [
      {
        "open": "2026-10-13T09:30:00.000Z",
        "close": "2026-10-13T20:58:00.000Z"
      },
      {
        "open": "2026-10-13T21:05:00.000Z",
        "close": "2026-10-14T20:58:00.000Z"
      }
    ]
  }
}

GET /quotes

Current quotes

The central board's prices by default (price_basis=raw). With price_basis=account, your account's own: its server's prices with its account type's markup, the bid and ask your account trades at, read from that server at most once a second. While they can't be read the answer is 503 broker_unavailable, and the raw board still answers.

Scope: market:read

Parameters

NameInTypeDescription
symbolsquerystringComma-separated, at most 50. All instruments when omitted.
price_basisquerystringraw (default): the central JAFX quote board, the same for every key. account: your account's own prices. One of raw, account. Default "raw".

Responses

FieldTypeDescription
dataarray of Quote
missingarray of stringThe symbols asked for that have no quote: unknown, or, with price_basis=account, not priced or not shown for your account. Empty when no symbols are asked for.
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)

The newest limit bars that opened between from and to (default: up to now), oldest first. To read further back, ask again with to just before the oldest bar you got, until a page comes back empty. How far back: M1, M5, M15 and M30 from about March 2, 2026 (shares from early February 2026), H1 and H4 from about November 2025 (shares from January 2025), D1 and W1 from 2018 (cryptocurrencies from 2020), as JAFX's price history holds each instrument. A bar is only ever the timeframe's own: where the history is coarser, there are no bars. A page never holds a bar twice and has no gap the market didn't have.

Scope: market:read

Parameters

NameInTypeDescription
symbol requiredpathstringAs GET /symbols lists it, in any case (USOil or usoil).
timeframequerystringOne of M1, M5, M15, M30, H1, H4, D1, W1. Default "M1".
fromquerystring (date-time) | integerBars opened at or after this time: ISO-8601 (UTC), or epoch milliseconds. A value that reads as neither answers 422.
toquerystring (date-time) | integerBars opened at or before this time: ISO-8601 (UTC), or epoch milliseconds. A value that reads as neither answers 422.
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
    }
  ]
}

GET /alerts

JAFX's market alerts (sharp price moves), newest first

The sharp moves JAFX's central price feed flagged, the alerts JAFX Terminal's Alerts tab shows: a market that moved at least 5 times its usual 15- or 60-minute move, and by a good share of its typical daily range. The same for every key. Information about past price moves, not trading signals or advice.

The last 24 hours unless since says otherwise; alerts are kept, so since reads back as far as you like, a page at a time. To poll for new alerts and new legs, pass updated_since with the newest updated_at you have seen and keep each alert by its id (one changed at that same millisecond comes again). The stream's alerts channel pushes them instead.

Scope: market:read

Parameters

NameInTypeDescription
symbolsquerystringComma-separated instruments, at most 50, in any case. Names JAFX doesn't list come back in missing.
sincequerystring (date-time) | integerAlerts fired at or after this time. Default: 24 hours ago.
after_idqueryintegerOnly alerts with a larger id, which fired after the one you last saw. Must be ≥ 0.
updated_sincequerystring (date-time) | integerOnly alerts that changed at or after this time (fired, extended by a new leg, or followed up).
cursorquerystring
limitqueryintegerDefault 100. Must be ≥ 1 and ≤ 1000.

Responses

FieldTypeDescription
dataarray of Alert
next_cursorstring | nullPass it as cursor for older alerts; null when there are none.
sincestring (date-time)The start of the window this answer covers.
missingarray of stringInstruments asked for that JAFX doesn't list.
price_basisstringOne of raw.
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/alerts?symbols=XMRUSD,XMRBTC&limit=20" \
  -H "Authorization: Bearer $JAFX_API_KEY"
Response 200
JSON
{
  "data": [
    {
      "id": 1204,
      "symbol": "XMRBTC",
      "asset_class": "Cryptos",
      "direction": "down",
      "pct": -3.294,
      "window_minutes": 60,
      "times_usual": 8.54,
      "share_of_day": 0.71,
      "tier": "normal",
      "start_price": 0.00759,
      "price": 0.00734,
      "window_start": "2026-11-14T19:35:00.000Z",
      "fired_at": "2026-11-14T20:36:00.000Z",
      "legs": 1,
      "last_leg_at": "2026-11-14T20:36:00.000Z",
      "updated_at": "2026-11-14T21:39:31.727Z",
      "group_id": 1203,
      "group_size": 2,
      "group_label": "XMR weakening",
      "follow_up": {
        "until": "2026-11-15T00:36:00.000Z",
        "peak_price": 0.0072,
        "peak_at": "2026-11-14T21:18:00.000Z",
        "worst_price": 0.00735,
        "price_1h": 0.00732,
        "price_4h": null,
        "outcome": null
      }
    },
    {
      "id": 1203,
      "symbol": "XMRUSD",
      "asset_class": "Cryptos",
      "direction": "down",
      "pct": -3.615,
      "window_minutes": 60,
      "times_usual": 7.99,
      "share_of_day": 0.888,
      "tier": "normal",
      "start_price": 497.89,
      "price": 479.89,
      "window_start": "2026-11-14T19:35:00.000Z",
      "fired_at": "2026-11-14T20:36:00.000Z",
      "legs": 1,
      "last_leg_at": "2026-11-14T20:36:00.000Z",
      "updated_at": "2026-11-14T21:39:31.706Z",
      "group_id": 1203,
      "group_size": 2,
      "group_label": "XMR weakening",
      "follow_up": {
        "until": "2026-11-15T00:36:00.000Z",
        "peak_price": 462.69,
        "peak_at": "2026-11-14T21:18:00.000Z",
        "worst_price": 479.89,
        "price_1h": 472.5,
        "price_4h": null,
        "outcome": null
      }
    }
  ],
  "next_cursor": null,
  "since": "2026-11-13T21:40:00.000Z",
  "missing": [],
  "price_basis": "raw"
}

GET /live-scans

Which markets and timeframes JAFX AI's Live Scan covers, and how fresh each scan is

JAFX AI keeps a Live Scan (its read of a market on a chart timeframe, as JAFX Terminal shows it beside the price) for EURUSD, GBPUSD, USDJPY, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD and BTCUSD on M15, H1, H4, D1 and W1, written a few minutes after each bar of that timeframe closes while forex trades. The API serves only those and never makes one. General market information, not financial advice.

Scope: market:read

Responses

  • 200 Every market and timeframe covered
  • 4xx/5xx Problem document with a stable code
FieldTypeDescription
marketsarray of string
timeframesarray of stringItems: M15, H1, H4, D1, W1.
refreshstringHow often scans are written.
dataarray of LiveScanEntry
disclaimerstringGeneral market information, not financial advice. Every trading decision, and its risk, is yours. JAFX AI can make mistakes.
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/live-scans" \
  -H "Authorization: Bearer $JAFX_API_KEY"

GET /live-scans/{symbol}

JAFX AI's Live Scan of a market on a timeframe

The scan JAFX Terminal shows for the market and timeframe: its bias, trend and structure, patterns, levels, indicators, chart lines and what would change the read, with when it was written. Fresh until the bar it was written in closes (fresh_until); after that the same scan is served with fresh: false until the next is written. JAFX AI's sentences come in untrusted_content. Every scan carries its disclaimer: show it wherever you show the scan. A scan is not a signal, a forecast or a recommendation.

404 live_scan_not_available: the market or timeframe isn't covered (details lists those that are). 503 live_scan_not_ready with Retry-After: covered, but no scan is there now (none made yet, or the last attempt failed); details.retry_at is the bar close after which the next is written.

Scope: market:read

Parameters

NameInTypeDescription
symbol requiredpathstringThe market, in any case (EURUSD, eurusd, EUR/USD).
timeframequerystringThe chart timeframe. One of M15, H1, H4, D1, W1. Default "H1".

Responses

Request
curl
curl "https://terminal.jafx.com/trading-api/v1/live-scans/EURUSD" \
  -H "Authorization: Bearer $JAFX_API_KEY"

GET /market-sessions

Whether the Tokyo, London and New York stock exchanges are open

The exchanges' sessions as JAFX Terminal's top bar shows them: open, lunch break (Tokyo), closed or holiday, when each opened or opens next and when it closes, today's holiday or early close, and its next holiday. These are the exchanges' own cash-market hours, not an instrument's: JAFX's instruments trade on their own hours, often longer (trading_hours in GET /symbols).

Scope: market:read

Parameters

NameInTypeDescription
symbolquerystringA market: the answer then names exchange_for_symbol, the exchange whose hours matter for it.

Responses

  • 200 The three exchanges, in the order Tokyo, London, New York
  • 4xx/5xx Problem document with a stable code
FieldTypeDescription
as_ofstring (date-time)
valid_untilstring (date-time)When one of them next changes.
exchangesarray of ExchangeSession
notestring
symbolstringThe market asked about.
exchange_for_symbolstring | nullnyse for US indices and shares, lse for UK100, tse for JP225, null for currencies, metals, energies and crypto (only with symbol). One of tse, lse, nyse, null.
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/market-sessions" \
  -H "Authorization: Bearer $JAFX_API_KEY"

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}/positions/{ticket}/share-image

The JAFX share picture of an open position (PNG)

The picture JAFX Terminal's Share button makes: the market, long or short with the leverage its margin was charged at, the return on that margin (ROI), the entry and the market price now (your account's own), the date, and DEMO on a demo account, beside the market's real candles since the position opened, their size set by how long that is, with its entry and price now marked (one opened about a minute ago: the market's last one-minute candles). Never your name, account number or balance; the P&L amount only with show_amount=true. Every figure is read from your account. A ticket your account has no open position with is 404 order_not_found. At most 10 pictures a minute per key, 5 at once, REST and MCP together (429 rate_limited).

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
sizequerystringportrait 1080 × 1350 (a post), story 1080 × 1920 or landscape 1200 × 675. One of portrait, story, landscape. Default "portrait".
show_amountquerybooleanThe P&L in the account's currency under the ROI. Default false.
utc_offsetqueryintegerMinutes east of UTC the date is written in (120 for UTC+2). Default 0. Must be ≥ -720 and ≤ 840.

Responses

  • 200 The picture, a PNG of the size asked; Cache-Control: no-store, and Content-Disposition names it as the terminal does (jafx-EURUSD-2026-11-14.png)
  • 4xx/5xx Problem document with a stable code
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/positions/5001/share-image?size=landscape" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -o jafx-EURUSD-2026-10-13.png

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) | integerISO-8601 (UTC), or epoch milliseconds. Default: 7 days before to.
toquerystring (date-time) | integerISO-8601 (UTC), or epoch milliseconds. 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}/trades/{ticket}/share-image

The JAFX share picture of a closed trade (PNG)

The picture JAFX Terminal's Share button makes of a closed trade, as for an open position, with its close price and the day it closed, and its chart ending with the candle it closed in. A trade older than the price history kept for its length has no chart. The ticket is one GET /accounts/{account}/trades lists: a ticket your account's history has no closed trade with is 404 trade_not_found.

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
ticket requiredpathintegerMust be ≥ 1.
sizequerystringportrait 1080 × 1350 (a post), story 1080 × 1920 or landscape 1200 × 675. One of portrait, story, landscape. Default "portrait".
show_amountquerybooleanThe P&L in the account's currency under the ROI. Default false.
utc_offsetqueryintegerMinutes east of UTC the date is written in (120 for UTC+2). Default 0. Must be ≥ -720 and ≤ 840.

Responses

  • 200 The picture, a PNG of the size asked; Cache-Control: no-store, and Content-Disposition names it as the terminal does (jafx-EURUSD-2026-11-14.png)
  • 4xx/5xx Problem document with a stable code
Request
curl
curl "https://terminal.jafx.com/trading-api/v1/accounts/123456/trades/5001/share-image?size=story&show_amount=true" \
  -H "Authorization: Bearer $JAFX_API_KEY" \
  -o jafx-EURUSD-2026-10-13.png

GET /accounts/{account}/transactions

Balance and credit operations

Scope: account:read

Parameters

NameInTypeDescription
account requiredpathinteger
fromquerystring (date-time) | integerISO-8601 (UTC), or epoch milliseconds.
toquerystring (date-time) | integerISO-8601 (UTC), or epoch milliseconds.
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.

Outside the instrument's trading hours (trading_hours on GET /symbols/{symbol}) the broker refuses it with 422 market_closed, whose details.opens_at says when it opens again; nothing is traded, and the order goes again with a new Idempotency-Key once it opens.

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) | integerLimit and stop only: a future time, ISO-8601 (UTC) or epoch milliseconds, after which the order is removed.
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) | integer | nullA future time: ISO-8601 (UTC) or epoch milliseconds; null removes the expiry.

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.
modestringThe key's mode, which follows its account: demo keys (jafx_demo_…) for Demo Server accounts, live keys (jafx_live_…) for Live Server accounts. One of demo, live.
profilestringclient for every key made on the Developers page or by an app the client connected. strategy is kept for keys a JAFX service would hold to run a strategy for the client; none exist today. One of client, strategy.
scopesarray of stringItems: market:read, account:read, trade, trade:propose.
constraintsConstraints
expires_atstring (date-time)
tradingobjectWhether JAFX lets this key trade now (its kill switches). Anything but on refuses orders with 423 trading_halted.
trading.modestringon: trading as usual. close_only: only closes, cancels and stop changes. off: no orders at all. One of on, close_only, off.
trading.levelstringWhere the switch that applies is set: global (every key), account, key, or env (the service's own setting).
trading.reasonstring | nullWhy JAFX switched it, when it said.
sessionSession
live_trading_enabledbooleanWhether JAFX has switched on trading live accounts through the API, for every key. While false, an order on a live account answers 403 live_trading_disabled; demo keys trade either way.

Constraints

FieldTypeDescription
demo_onlybooleanTrue on demo keys: the key can only ever trade a Demo Server account (a demo key never trades a live one). It follows the key's mode and can't be changed.
max_volume_per_orderdecimal string
max_open_positionsinteger
orders_per_minuteinteger
modifications_per_minuteinteger
daily_loss_limitnull | objectThe daily loss stop: new positions are refused once the day's loss reaches it, until the next broker day. The Developers page sets it as a percentage of the day's starting equity, or none (null). amount (a sum in the account currency) appears only on keys JAFX sets up.
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
tick_valuenumber | nullWhat one tick (tick_size) moves the profit of one lot, in profit_currency: contract_size × tick_size. A lot is contract_size units, which differs by instrument (EURUSD 100,000 euros, BTCUSD 10 bitcoins).
profit_currencystring | nullThe currency profit is counted in on the key's server: a pair's second currency (EURUSD: USD, USDJPY: JPY). Null when that server's instruments aren't known right now.
stops_levelintegerThe least distance, in points (1 point = 10^-digits), between the price and a stop loss, a take profit or a pending order's price. 0: no minimum, which is what JAFX's servers set today; a stop must still be on the correct side of the price the position would close at (the bid for a buy, the ask for a sell), or the order answers 422 invalid_stops. Must be ≥ 0.
trading_hoursnull | TradingHoursWhen this instrument trades on the key's own server, whose clock decides when its orders are taken. Null when that server's hours aren't known right now. An order outside them answers 422 market_closed.

TradingHours

An instrument's trading hours from its server's weekly schedule, in UTC. Holidays and early closes the weekly schedule doesn't show still answer 422 market_closed.

FieldTypeDescription
open_nowbooleanWhether the instrument is in a trading session now.
next_openstring (date-time) | nullWhen it next opens (after the current session, when it is open now); null when it doesn't within a week, or never closes.
next_closestring (date-time) | nullWhen it next closes; null when it doesn't within a week (open around the clock).
sessionsarray of TradeSessionIts trading sessions over the next 7 days, oldest first; back-to-back sessions are one, and one already open starts now. Empty when it doesn't trade in that time.

TradeSession

FieldTypeDescription
openstring (date-time)
closestring (date-time)The first moment it no longer trades.

Quote

FieldTypeDescription
symbolstring
bidnumber
asknumber
timestring (date-time)When the price last changed.
price_basisstringraw: the central board's price. account: your account's own, as its server quotes it to your account. One of raw, account.

Candle

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

Alert

A sharp move JAFX's central feed flagged (see the developer guide's Market alerts page). Prices are the feed's bid (price_basis raw). Information, not advice.

FieldTypeDescription
idintegerIds only grow, in the order alerts fire.
symbolstring
asset_classstringThe instrument's group, as /symbols names it (group there).
directionstringOne of up, down.
pctnumberThe move in percent from start_price to price, negative when down.
window_minutesintegerThe window the first leg was measured over: a 15-minute alert belongs on M15, a 60-minute one on H1. One of 15, 60.
times_usualnumberHow many times the market's usual move over the same window (the median of the last 7 days) it was: at least 5. For several legs, the sharpest.
share_of_daynumberThe move as a share of the market's typical daily range (the median of its last 20 trading days): 0.65 is 65% of a typical day.
tierstringstrong: a big move, at least 12 times usual, or half again the market's size bar and at least half a typical day. One of normal, strong.
start_pricenumberThe price at window_start, where the move started.
pricenumberThe price at the latest leg.
window_startstring (date-time)
fired_atstring (date-time)The close of the minute that confirmed the move.
legsintegerSharp legs of the move so far: each new one in the same direction, within 2 hours of the last, updates the alert. Must be ≥ 1.
last_leg_atstring (date-time)
updated_atstring (date-time)The last change: a new leg, or the follow-up.
group_idintegerAlerts that fire within 15 minutes and share a driver share a group, named by its first alert's id; an alert on its own is its own group.
group_sizeintegerHow many alerts the group had when the answer was made. Must be ≥ 1.
group_labelstring | nullWhat the group shares, such as "USD strengthening"; null for an alert on its own.
follow_upAlertFollowUp

AlertFollowUp

What the price did in the 4 hours after the latest leg; a new leg restarts it.

FieldTypeDescription
untilstring (date-time)4 hours after the latest leg.
peak_pricenumber | nullThe furthest price in the move's direction since the alert fired.
peak_atstring (date-time) | null
worst_pricenumber | nullThe furthest price against the move since the latest leg.
price_1hnumber | nullThe price 1 hour after the latest leg; null until then.
price_4hnumber | nullThe price 4 hours after the latest leg; null until then.
outcomestring | nullSet 4 hours after the latest leg, from where the move started: kept_going (20% or more beyond the move at the alert), held (half or more kept), faded (less than half), reversed (back past the start). One of kept_going, held, faded, reversed, null.

LiveScan

JAFX AI's Live Scan of a market on a timeframe (see the developer guide's AI Live Scan page). General market information, not financial advice.

FieldTypeDescription
symbolstring
timeframestringOne of M15, H1, H4, D1, W1.
freshbooleanWhether the bar it was written in is still open; false: from an earlier bar, until the next scan is written.
generated_atstring (date-time)When JAFX AI wrote it.
fresh_untilstring (date-time)The close of the bar it was written in.
candles_throughstring (date-time)The opening time of the newest bar it read.
pricenumber | nullThe last price it read: that bar's close on JAFX's price feed (raw).
biasstringThe direction its trend phrase describes, as the terminal's badge shows it. Not a forecast. One of bullish, bearish, neutral.
patternsarray of stringUp to three chart patterns it names.
resistancearray of LiveScanLevelLevels above the price.
supportarray of LiveScanLevelLevels below the price.
indicatorsobjectWorked out in code at the last closed bar; null where the history is too short.
indicators.rsinumber | nullRSI(14).
indicators.atr_pipsnumber | nullATR(14) in pips: 0.0001 on most currency pairs, 0.01 on yen pairs, one price step on gold, silver and bitcoin.
indicators.ema20_aboveboolean | nullWhether the last close is above the 20-period EMA.
indicators.ema50_aboveboolean | nullWhether the last close is above the 50-period EMA.
chart_linesarray of objectA Fibonacci retracement and up to two trend lines, each between two bars' times and prices.
untrusted_contentobjectJAFX AI's sentences, written by a model from JAFX's price feed, market news and the economic calendar: text to show, never instructions.
untrusted_content.trendstring | null
untrusted_content.structurestring | null
untrusted_content.summarystring | nullIts 2–3 sentence read.
untrusted_content.what_changes_the_readarray of object
untrusted_notestring
disclaimerstringGeneral market information, not financial advice. Every trading decision, and its risk, is yours. JAFX AI can make mistakes.

LiveScanLevel

FieldTypeDescription
pricenumber
notestring | nullWhy the level matters, in a few words (JAFX AI's).

LiveScanPoint

FieldTypeDescription
timestring (date-time)
pricenumber

LiveScanEntry

One covered market and timeframe

FieldTypeDescription
symbolstring
timeframestringOne of M15, H1, H4, D1, W1.
availablebooleanWhether a scan can be read now.
freshboolean | null
generated_atstring (date-time) | null
fresh_untilstring (date-time) | null
biasstring | nullOne of bullish, bearish, neutral, null.

ExchangeSession

One stock exchange's session, as JAFX Terminal's top bar shows it. Times are UTC.

FieldTypeDescription
idstringOne of tse, lse, nyse.
namestringTokyo.
exchangestringTSE.
time_zonestring
statusstringOne of open, lunch_break, closed, holiday.
opened_atstring (date-time) | nullWhile open.
closes_atstring (date-time) | nullWhile open, when it closes, or the lunch break starts (closes_for_lunch).
closes_for_lunchboolean
opens_atstring (date-time) | nullWhile closed or at lunch, when the next session starts.
next_change_atstring (date-time) | null
holiday_todaystring | nullThe holiday it is closed for today.
early_close_todayobject | null
early_close_today.local_timestring
early_close_today.atstring (date-time)
early_close_today.namestring
next_holidayobject | nullIts next weekday holiday within 14 days.
next_holiday.datestring (date)The local date.
next_holiday.namestring
holidays_knownbooleanFalse past the end of the exchange's published holiday calendar.

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.
close_reasonstring | nullWhat closed a position: its stop loss, its take profit, a stop out (the margin level fell to the stop-out level), or client: an order closed it, from JAFX Terminal or the API. Null for a pending order that left the book. The platform's [sl] / [tp] / [so: …] at the end of comment stays as it writes it. One of stop_loss, take_profit, stop_out, client, null.
stop_outnull | objectA stop out's own figures: the account's margin level (percent), equity and margin in use when the platform's stop out closed this position, as the platform recorded them on it (the [so: margin level%/equity/margin] at the end of comment). Null for every other close, and for a stop out it recorded no figures for; never worked out from anything else.

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) | integerLimit and stop only: a future time, ISO-8601 (UTC) or epoch milliseconds, after which the order is removed.
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.