Broker API HubMenu

DXtrade API GET /accounts/{accountCode}/orders/history

GET/accounts/{accountCode}/orders/historyUsers and Accounts

List an account's orders, both working and final, filtered by status, type, side, instrument or time.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialdemo.dx.tradechecked

Read on 12 Oct 2026 in the DXtrade REST API specification on DXtrade's developer portal. The portal draws its pages in the browser from Markdown files it also serves directly, and the Markdown file of this page (DXtrade-REST-API.md) is what was read, with the model files it includes. The portal writes each address after a base address it fills in from its own settings, which on this portal is https://demo.dx.trade/dxsca-web. A broker or firm that offers DXtrade hosts its own, so the path here is what follows that base. The page writes the placeholder in the address as {account code} and names the parameter accountCode or account code. This record uses accountCode. The specification says every request needs authentication unless it says otherwise, and this section says the Authorization header should be included, which is why it is recorded as required. The page lists the same address under POST as well, to get round the length limit of a GET address when a query is long. Only GET is recorded here. Several values in one filter are treated as alternatives. The reply is a historic order list, with no ETag header. The page also gives a second address for several accounts at once, /accounts/orders/history, with the account codes as a comma separated accounts query parameter. That form is not recorded separately.

Parameters

NameInTypeDescription
accountCoderequiredpathstringThe account code, two strings joined by a colon in the form clearing:account, assigned by the platform. URL-encode it.
limitqueryintegerMarked optional. The most orders on a page of results. The server sets the largest value allowed.
in-statusquerystringMarked optional. Order statuses, comma separated.
of-typequerystringMarked optional. Order types, comma separated. Possible values: market, limit, stop.
issued-fromquerystringMarked optional. Earliest issue time in UTC, inclusive.
issued-toquerystringMarked optional. Latest issue time in UTC, inclusive.
periodquerystringMarked optional. A shortcut for the issue time. One of: today, previous-day, week, previous-week.
transaction-fromquerystringMarked optional. Earliest last modification time in UTC, inclusive.
transaction-toquerystringMarked optional. Latest last modification time in UTC, inclusive.
at-least-versionqueryintegerMarked optional. Only orders whose last update has this account version or a greater one.
at-most-versionqueryintegerMarked optional. Only orders whose last update has this account version or a smaller one.
sidequerystringMarked optional. One of: buy, sell.
with-client-idnot marked by the vendorquerystringOrder ids assigned by the client, comma separated, at most 50.
with-order-idnot marked by the vendorquerystringNumeric order ids assigned by the server, at most 50.
for-instrumentnot marked by the vendorquerystringInstrument symbols, comma separated.
include-offsetquerybooleanMarked optional. If true and no account codes are given, offset accounts are processed too.
include-linksquerybooleanMarked optional. If true, orders linked to a matched order are returned too.

3 fields are tagged not marked by the vendor: with-client-id, with-order-id, for-instrument. The vendor's page lists them and marks them neither required nor optional. That describes the page, not a test of what the host accepts, so the samples send them with a placeholder.

Authentication headers

NameTypeDescription
AuthorizationrequiredstringWith token authentication, send DXAPI followed by the sessionToken from POST /login. With HMAC authentication the same header carries DXAPI with a principal, a timestamp and a hash, signed for each request as the specification describes. Placeholder only: never paste a real token into this site.

Request

Written from the method, path and parameters recorded on this page. No demo host is recorded as a plain address for this API, so the samples read the base address from an environment variable. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder writes these same snippets, from the same record.

Python
# Set DXTRADE_BASE_URL, DXTRADE_SESSION_TOKEN as environment variables first. Never paste real values into code.
# DXTRADE_SESSION_TOKEN holds the Authorization header that POST /login returns.
# No demo host is recorded as a plain address for this API, so the base address is read from DXTRADE_BASE_URL.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: query parameters limit, in-status, of-type, issued-from, issued-to, period, transaction-from, transaction-to, at-least-version, at-most-version, side, include-offset, include-links.
import os
import requests

BASE_URL = os.environ["DXTRADE_BASE_URL"]
headers = {
    "Authorization": "DXAPI " + os.environ["DXTRADE_SESSION_TOKEN"],
}
params = {"with-client-id": "{with-client-id}", "with-order-id": "{with-order-id}", "for-instrument": "{for-instrument}"}
resp = requests.get(BASE_URL + "/accounts/{accountCode}/orders/history", headers=headers, params=params, timeout=10)
resp.raise_for_status()
print(resp.json())
JavaScript
// Set DXTRADE_BASE_URL, DXTRADE_SESSION_TOKEN as environment variables first. Never paste real values into code.
// DXTRADE_SESSION_TOKEN holds the Authorization header that POST /login returns.
// No demo host is recorded as a plain address for this API, so the base address is read from DXTRADE_BASE_URL.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Optional and not shown: query parameters limit, in-status, of-type, issued-from, issued-to, period, transaction-from, transaction-to, at-least-version, at-most-version, side, include-offset, include-links.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = process.env.DXTRADE_BASE_URL;
const res = await fetch(BASE_URL + "/accounts/{accountCode}/orders/history" + "?with-client-id={with-client-id}&with-order-id={with-order-id}&for-instrument={for-instrument}", {
  method: "GET",
  headers: {
    "Authorization": "DXAPI " + process.env.DXTRADE_SESSION_TOKEN,
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
curl
# Set DXTRADE_BASE_URL, DXTRADE_SESSION_TOKEN as environment variables first. Never paste real values into code.
# DXTRADE_SESSION_TOKEN holds the Authorization header that POST /login returns.
# No demo host is recorded as a plain address for this API, so the base address is read from DXTRADE_BASE_URL.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: query parameters limit, in-status, of-type, issued-from, issued-to, period, transaction-from, transaction-to, at-least-version, at-most-version, side, include-offset, include-links.
curl -X GET "$DXTRADE_BASE_URL/accounts/{accountCode}/orders/history?with-client-id={with-client-id}&with-order-id={with-order-id}&for-instrument={for-instrument}" \
  -H "Authorization: DXAPI $DXTRADE_SESSION_TOKEN"

Response

No mock response is recorded for this endpoint. Where the record says why, or names the fields of the reply, it does so in the note at the top of this page. That is a statement about this record, not about what the API returns: read the shape of the reply in the official reference.

DXtrade API errors you may meet

All DXtrade API error codes, including 73 more not listed here.