Orders
Order lifecycle — create, cancel, list, trades
Base URL https://api.lexx-trade.com/api/v2 · All endpoints
require Ed25519 request signatures unless marked "no auth" — see Authentication.
List orders (from cache)
Returns orders from in-memory cache. No database queries. Use status=open (default) for currently active orders, or status=recent to include recently closed/cancelled orders from the last ~1 hour.
Query parameters
| exchange | string | Optional exchange account filter (e.g., binance-futures). When omitted, orders across all connected exchanges are returned. |
| symbol | string | Filter by trading pair (e.g., BTCUSDT) |
| status | string | open — only active orders (NEW + OPENED). recent — all orders from cache including recently closed/cancelled (~1 hour window). |
Request samples
# Sign: timestamp + "GET" + "/v2/orders" + "" → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/orders' \
-H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
-H "X-LEXX-SIGN: $SIGNATURE" \
-H "X-LEXX-TIMESTAMP: $TIMESTAMP" // lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("GET", "/orders");
console.log(data); # lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/orders")
print(res["data"]) Response 200 — Orders list
data id required LEXX order identifier — the platform-generated client order id (the exchange's native numeric order id is never exposed). Format is exchange-specific: x-MTB46TF3-{uid} (binance-spot), x-MZ8FjHFm-{uid} (binance-futures), lexxO{uid} (OKX — no dashes), lexx-{uid} (Bybit). Bot orders append the run id as a final segment (e.g. x-MZ8FjHFm-{uid}_{runId}). The id is stable for the lifetime of an order, but a modify/split creates NEW orders with new ids.
exchange required Exchange account identifier (e.g., binance-spot, binance-futures, bybit-spot, bybit-futures, okx-swap).
symbol required Trading pair symbol (e.g., BTCUSDT, SOLUSDT).
side required Order direction: BUY to go long/close short, SELL to go short/close long.
enum: "BUY" · "SELL"
type required Order type (from the internal OrderType enum). MARKET = immediate execution at best price. LIMIT = execute at specified price or better. LIMIT_MAKER = post-only limit (rejected if it would take liquidity). STOP_MARKET = market order triggered at stopPrice. STOP_LIMIT = limit order triggered at stopPrice. TAKE_PROFIT_MARKET = market order at take-profit level. TAKE_PROFIT_LIMIT = limit order at take-profit level. Note: trailing stops are represented as STOP_MARKET plus a populated trailing object, not a distinct order type.
enum: "MARKET" · "LIMIT" · "LIMIT_MAKER" · "STOP_MARKET" · "STOP_LIMIT" · "TAKE_PROFIT_MARKET" · "TAKE_PROFIT_LIMIT"
status required Order lifecycle state. NEW = accepted but not yet live on exchange. OPENED = active on exchange. CLOSED = fully filled. CANCELLED = cancelled. ERROR = rejected.
enum: "NEW" · "OPENED" · "CLOSED" · "CANCELLED" · "ERROR"
positionSide Position direction for hedge-mode futures. BOTH = one-way mode.
enum: "LONG" · "SHORT" · "BOTH"
price Limit price. String-encoded decimal.
stopPrice Trigger price for stop/take-profit orders.
fillPrice Volume-weighted average fill price. Null if no fills yet.
origQty Originally requested quantity in base asset.
executedQty Quantity already filled.
reduceOnly If true, order can only reduce an existing position.
closePosition If true, closes the entire position.
trailing Trailing stop parameters. Present (populated) when the order is a trailing stop; the type field remains STOP_MARKET in that case.
delta Callback rate in basis points (100 = 1%).
time Activation timestamp (Unix ms).
isContract True for futures/perpetual contracts, false for spot.
creatorId Identifier of the entity that created this order (bot ID, user short ID).
creator Source that created this order.
enum: "API" · "UI" · "BOT"
isWorking True if the order is currently active on the exchange order book.
metadata JSON-encoded metadata string. Contains allocation info for bot orders, creation timestamps, etc. Parse with JSON.parse().
specific Exchange-specific fields (e.g., goodTillDate). Structure varies by exchange.
orderTime required Timestamp when the order was submitted, in Unix milliseconds.
meta Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.
requestId required Unique identifier for this API request, useful for support tickets and debugging
timestamp required Response timestamp in Unix milliseconds
version required API version
idempotencyKey Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.
Error responses (401, 429, 500)
| 401 | Invalid or missing API key/signature |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
All errors share the { error: { code, status, message }, meta } envelope —
see Errors for every code.
Create order
Place a new trading order. Requires trade or full tier API key.
Use X-Idempotency-Key header to prevent duplicate orders.
Headers
| X-Idempotency-Key | string | Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation. |
Request body required
exchange required Target exchange account (e.g., binance-spot, bybit-futures). Required. Must match a connected exchange account. Order placement rejects a missing or unrecognized exchange with a 400.
symbol required Trading pair (e.g., BTCUSDT). Required. Must be a valid symbol on the target exchange.
side required BUY or SELL. Required. For futures, BUY opens a long or closes a short, SELL opens a short or closes a long.
enum: "BUY" · "SELL"
type required Order type (MARKET, LIMIT, STOP_MARKET, etc.). Required. Determines which additional fields are needed (e.g., LIMIT requires price, STOP_MARKET requires stopPrice). For a trailing stop, send STOP_MARKET with trailingDelta (and optionally activationPrice); the connector maps it to a trailing order downstream.
enum: "MARKET" · "LIMIT" · "LIMIT_MAKER" · "STOP_MARKET" · "STOP_LIMIT" · "TAKE_PROFIT_MARKET" · "TAKE_PROFIT_LIMIT"
quantity Order quantity in base asset. String-encoded decimal for precision. Required unless quoteOrderQty is specified.
price Limit price. Required for LIMIT, STOP_LIMIT, TAKE_PROFIT_LIMIT orders. String-encoded decimal for precision.
stopPrice Trigger price for conditional orders (STOP_*, TAKE_PROFIT_*). String-encoded decimal for precision.
quoteOrderQty Order quantity in quote asset (e.g., spend 1000 USDT). Alternative to quantity for MARKET orders only. String-encoded decimal for precision. When specified, quantity is ignored.
timeInForce Time-in-force policy. Optional — when omitted (including for LIMIT orders) the platform defaults to GTC. Ignored for MARKET-style types. Use IOC or FOK for orders that must fill immediately.
enum: "GTC" · "IOC" · "FOK" · "GTD"
default: "GTC"
icebergQty Visible quantity for iceberg orders. Only the specified portion is visible on the order book; the remainder is hidden. String-encoded decimal for precision.
activationPrice Activation price for trailing stop orders. The trailing stop becomes active when the market reaches this price. String-encoded decimal for precision.
percentPrice Price as percentage from current price. Used with trailing stops. String-encoded decimal for precision.
closePosition If true, closes the entire position regardless of quantity. Futures only. When set, the quantity field is ignored.
default: false
reduceOnly If true, order can only reduce position size. Futures only. Prevents accidentally increasing a position.
default: false
trailingDelta Callback rate for trailing stop orders in basis points (e.g., 100 = 1%). Determines how far the price must move against the trailing direction to trigger the order.
positionSide Required in hedge mode: LONG or SHORT. Default: BOTH (one-way mode). Only applicable to futures markets.
enum: "LONG" · "SHORT" · "BOTH"
default: "BOTH"
workingType Price type used for triggering conditional orders. MARK_PRICE (default) = uses mark price to avoid manipulation. CONTRACT_PRICE = uses last traded price.
enum: "MARK_PRICE" · "CONTRACT_PRICE"
goodTillDate Expiration time for GTD orders as a Unix timestamp in milliseconds. Required when timeInForce is GTD. The order is automatically canceled after this timestamp.
marginType Margin mode for this order: ISOLATED = margin is isolated to this position, CROSSED = shares margin across all positions. Futures only.
enum: "ISOLATED" · "CROSSED"
marketType Target market: spot, margin, or futures. Determines available order types and features.
enum: "spot" · "margin" · "futures"
Request samples
# Sign: timestamp + "POST" + "/v2/orders" + body → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/orders' \
-H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
-H "X-LEXX-SIGN: $SIGNATURE" \
-H "X-LEXX-TIMESTAMP: $TIMESTAMP" \
-H 'Content-Type: application/json' \
-d '{"exchange":"binance-spot","symbol":"BTCUSDT","side":"BUY","type":"LIMIT","quantity":"0.010","price":"67500.00","timeInForce":"GTC","marketType":"spot"}' // lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/orders", {
body: {
"exchange": "binance-spot",
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": "0.010",
"price": "67500.00",
"timeInForce": "GTC",
"marketType": "spot"
}
});
console.log(data); # lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/orders", body={
"exchange": "binance-spot",
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": "0.010",
"price": "67500.00",
"timeInForce": "GTC",
"marketType": "spot"
})
print(res["data"]) Body examples (8)
Spot market buy — spend 100 USDT on SOL
{
"exchange": "binance-spot",
"symbol": "SOLUSDT",
"side": "BUY",
"type": "MARKET",
"quoteOrderQty": "100",
"marketType": "spot"
} Spot limit buy — 0.5 SOL at 150 USDT
{
"exchange": "binance-spot",
"symbol": "SOLUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": "0.5",
"price": "150.00",
"timeInForce": "GTC",
"marketType": "spot"
} Futures market long — 1 SOL with hedge mode
{
"exchange": "binance-futures",
"symbol": "SOLUSDT",
"side": "BUY",
"type": "MARKET",
"quantity": "1",
"positionSide": "LONG",
"marketType": "futures"
} Futures limit short — sell 0.1 ETH at 4000
{
"exchange": "binance-futures",
"symbol": "ETHUSDT",
"side": "SELL",
"type": "LIMIT",
"quantity": "0.1",
"price": "4000.00",
"timeInForce": "GTC",
"positionSide": "SHORT",
"marketType": "futures"
} Stop-loss — close long SOL at 140
{
"exchange": "binance-futures",
"symbol": "SOLUSDT",
"side": "SELL",
"type": "STOP_MARKET",
"quantity": "1",
"stopPrice": "140.00",
"positionSide": "LONG",
"reduceOnly": true,
"workingType": "CONTRACT_PRICE",
"marketType": "futures"
} Take-profit — close long SOL at 200
{
"exchange": "binance-futures",
"symbol": "SOLUSDT",
"side": "SELL",
"type": "TAKE_PROFIT_MARKET",
"quantity": "1",
"stopPrice": "200.00",
"positionSide": "LONG",
"reduceOnly": true,
"workingType": "CONTRACT_PRICE",
"marketType": "futures"
} Trailing stop — 2% callback on BTC long
{
"exchange": "binance-futures",
"symbol": "BTCUSDT",
"side": "SELL",
"type": "STOP_MARKET",
"quantity": "0.01",
"activationPrice": "70000.00",
"trailingDelta": 200,
"positionSide": "LONG",
"reduceOnly": true,
"marketType": "futures"
} Close entire SOL long position
{
"exchange": "binance-futures",
"symbol": "SOLUSDT",
"side": "SELL",
"type": "MARKET",
"quantity": "0",
"positionSide": "LONG",
"closePosition": true,
"marketType": "futures"
} Response 200 — Order created
data Trading order returned by the Public API. Contains the fields selected by orderToPublicData from the internal IOrder model. Covers spot, margin, and futures markets.
id required LEXX order identifier — the platform-generated client order id (the exchange's native numeric order id is never exposed). Format is exchange-specific: x-MTB46TF3-{uid} (binance-spot), x-MZ8FjHFm-{uid} (binance-futures), lexxO{uid} (OKX — no dashes), lexx-{uid} (Bybit). Bot orders append the run id as a final segment (e.g. x-MZ8FjHFm-{uid}_{runId}). The id is stable for the lifetime of an order, but a modify/split creates NEW orders with new ids.
exchange required Exchange account identifier (e.g., binance-spot, binance-futures, bybit-spot, bybit-futures, okx-swap).
symbol required Trading pair symbol (e.g., BTCUSDT, SOLUSDT).
side required Order direction: BUY to go long/close short, SELL to go short/close long.
enum: "BUY" · "SELL"
type required Order type (from the internal OrderType enum). MARKET = immediate execution at best price. LIMIT = execute at specified price or better. LIMIT_MAKER = post-only limit (rejected if it would take liquidity). STOP_MARKET = market order triggered at stopPrice. STOP_LIMIT = limit order triggered at stopPrice. TAKE_PROFIT_MARKET = market order at take-profit level. TAKE_PROFIT_LIMIT = limit order at take-profit level. Note: trailing stops are represented as STOP_MARKET plus a populated trailing object, not a distinct order type.
enum: "MARKET" · "LIMIT" · "LIMIT_MAKER" · "STOP_MARKET" · "STOP_LIMIT" · "TAKE_PROFIT_MARKET" · "TAKE_PROFIT_LIMIT"
status required Order lifecycle state. NEW = accepted but not yet live on exchange. OPENED = active on exchange. CLOSED = fully filled. CANCELLED = cancelled. ERROR = rejected.
enum: "NEW" · "OPENED" · "CLOSED" · "CANCELLED" · "ERROR"
positionSide Position direction for hedge-mode futures. BOTH = one-way mode.
enum: "LONG" · "SHORT" · "BOTH"
price Limit price. String-encoded decimal.
stopPrice Trigger price for stop/take-profit orders.
fillPrice Volume-weighted average fill price. Null if no fills yet.
origQty Originally requested quantity in base asset.
executedQty Quantity already filled.
reduceOnly If true, order can only reduce an existing position.
closePosition If true, closes the entire position.
trailing Trailing stop parameters. Present (populated) when the order is a trailing stop; the type field remains STOP_MARKET in that case.
delta Callback rate in basis points (100 = 1%).
time Activation timestamp (Unix ms).
isContract True for futures/perpetual contracts, false for spot.
creatorId Identifier of the entity that created this order (bot ID, user short ID).
creator Source that created this order.
enum: "API" · "UI" · "BOT"
isWorking True if the order is currently active on the exchange order book.
metadata JSON-encoded metadata string. Contains allocation info for bot orders, creation timestamps, etc. Parse with JSON.parse().
specific Exchange-specific fields (e.g., goodTillDate). Structure varies by exchange.
orderTime required Timestamp when the order was submitted, in Unix milliseconds.
meta Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.
requestId required Unique identifier for this API request, useful for support tickets and debugging
timestamp required Response timestamp in Unix milliseconds
version required API version
idempotencyKey Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.
Error responses (400, 401, 403, 409, 429, 500)
| 400 | Invalid request parameters |
| 401 | Invalid or missing API key/signature |
| 403 | Insufficient permissions or IP not whitelisted |
| 409 | Resource conflict (e.g., idempotency key reuse) |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
All errors share the { error: { code, status, message }, meta } envelope —
see Errors for every code.
Cancel order
Cancel an open order by its ID. The order should be in OPENED or NEW status. Cancelling an order that is already filled or cancelled is usually an idempotent no-op — the platform detects the state and returns 200 with the current order; a genuine exchange rejection is passed through with the exchange's HTTP status (typically 400 INVALID_REQUEST with the exchange message). Requires trade or full tier API key. The path {id} segment may be omitted entirely (DELETE /orders) when the order id is supplied via the order query/body parameter instead.
Path parameters
| id required | string | LEXX order ID to cancel (the platform client order id, e.g. x-MZ8FjHFm-{uid} on binance-futures — see PublicOrder.id for per-exchange formats). Can also be passed as order query/body parameter. |
Query parameters
| exchange required | string | Exchange account identifier (see GET /exchange/supported). Determines which connected exchange account to use. Must match one of your connected accounts. |
Headers
| X-Idempotency-Key | string | Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation. |
Request samples
# Sign: timestamp + "DELETE" + "/v2/orders/<id>?exchange=binance-spot" + "" → see Authentication
curl -X DELETE 'https://api.lexx-trade.com/api/v2/orders/<id>?exchange=binance-spot' \
-H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
-H "X-LEXX-SIGN: $SIGNATURE" \
-H "X-LEXX-TIMESTAMP: $TIMESTAMP" // lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("DELETE", "/orders/<id>", {
query: {"exchange":"binance-spot"}
});
console.log(data); # lexx() — the signing helper from the Quickstart guide
res = lexx("DELETE", "/orders/<id>", query={"exchange": "binance-spot"})
print(res["data"]) Response 200 — Order canceled
data Trading order returned by the Public API. Contains the fields selected by orderToPublicData from the internal IOrder model. Covers spot, margin, and futures markets.
id required LEXX order identifier — the platform-generated client order id (the exchange's native numeric order id is never exposed). Format is exchange-specific: x-MTB46TF3-{uid} (binance-spot), x-MZ8FjHFm-{uid} (binance-futures), lexxO{uid} (OKX — no dashes), lexx-{uid} (Bybit). Bot orders append the run id as a final segment (e.g. x-MZ8FjHFm-{uid}_{runId}). The id is stable for the lifetime of an order, but a modify/split creates NEW orders with new ids.
exchange required Exchange account identifier (e.g., binance-spot, binance-futures, bybit-spot, bybit-futures, okx-swap).
symbol required Trading pair symbol (e.g., BTCUSDT, SOLUSDT).
side required Order direction: BUY to go long/close short, SELL to go short/close long.
enum: "BUY" · "SELL"
type required Order type (from the internal OrderType enum). MARKET = immediate execution at best price. LIMIT = execute at specified price or better. LIMIT_MAKER = post-only limit (rejected if it would take liquidity). STOP_MARKET = market order triggered at stopPrice. STOP_LIMIT = limit order triggered at stopPrice. TAKE_PROFIT_MARKET = market order at take-profit level. TAKE_PROFIT_LIMIT = limit order at take-profit level. Note: trailing stops are represented as STOP_MARKET plus a populated trailing object, not a distinct order type.
enum: "MARKET" · "LIMIT" · "LIMIT_MAKER" · "STOP_MARKET" · "STOP_LIMIT" · "TAKE_PROFIT_MARKET" · "TAKE_PROFIT_LIMIT"
status required Order lifecycle state. NEW = accepted but not yet live on exchange. OPENED = active on exchange. CLOSED = fully filled. CANCELLED = cancelled. ERROR = rejected.
enum: "NEW" · "OPENED" · "CLOSED" · "CANCELLED" · "ERROR"
positionSide Position direction for hedge-mode futures. BOTH = one-way mode.
enum: "LONG" · "SHORT" · "BOTH"
price Limit price. String-encoded decimal.
stopPrice Trigger price for stop/take-profit orders.
fillPrice Volume-weighted average fill price. Null if no fills yet.
origQty Originally requested quantity in base asset.
executedQty Quantity already filled.
reduceOnly If true, order can only reduce an existing position.
closePosition If true, closes the entire position.
trailing Trailing stop parameters. Present (populated) when the order is a trailing stop; the type field remains STOP_MARKET in that case.
delta Callback rate in basis points (100 = 1%).
time Activation timestamp (Unix ms).
isContract True for futures/perpetual contracts, false for spot.
creatorId Identifier of the entity that created this order (bot ID, user short ID).
creator Source that created this order.
enum: "API" · "UI" · "BOT"
isWorking True if the order is currently active on the exchange order book.
metadata JSON-encoded metadata string. Contains allocation info for bot orders, creation timestamps, etc. Parse with JSON.parse().
specific Exchange-specific fields (e.g., goodTillDate). Structure varies by exchange.
orderTime required Timestamp when the order was submitted, in Unix milliseconds.
meta Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.
requestId required Unique identifier for this API request, useful for support tickets and debugging
timestamp required Response timestamp in Unix milliseconds
version required API version
idempotencyKey Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.
Error responses (400, 401, 403, 404, 429, 500)
| 400 | Invalid request parameters |
| 401 | Invalid or missing API key/signature |
| 403 | Insufficient permissions or IP not whitelisted |
| 404 | Resource not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
All errors share the { error: { code, status, message }, meta } envelope —
see Errors for every code.
Split order
Splits a limit order into multiple orders at different prices. The original order is cancelled, and new orders are created at each specified price. Quantity is divided equally among the new price levels. Requires trade or full tier API key.
Path parameters
| id required | string | Order ID to split |
Headers
| X-Idempotency-Key | string | Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation. |
Request body required
exchange required Exchange identifier (e.g., binance-futures)
prices required Array of new price levels (2 to 50). The original order's quantity is split equally across these prices.
Request samples
# Sign: timestamp + "POST" + "/v2/orders/<id>/split" + body → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/orders/<id>/split' \
-H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
-H "X-LEXX-SIGN: $SIGNATURE" \
-H "X-LEXX-TIMESTAMP: $TIMESTAMP" \
-H 'Content-Type: application/json' \
-d '{"exchange":"binance-futures","prices":["148.00","146.00","144.00"]}' // lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/orders/<id>/split", {
body: {
"exchange": "binance-futures",
"prices": [
"148.00",
"146.00",
"144.00"
]
}
});
console.log(data); # lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/orders/<id>/split", body={
"exchange": "binance-futures",
"prices": [
"148.00",
"146.00",
"144.00"
]
})
print(res["data"]) Body examples (2)
Split SOL limit buy into 3 levels
{
"exchange": "binance-futures",
"prices": [
"148.00",
"146.00",
"144.00"
]
} Split BTC order into 2 levels
{
"exchange": "binance-futures",
"prices": [
"67000.00",
"66000.00"
]
} Response 200 — New orders created from the split
data Array of newly created orders
id required LEXX order identifier — the platform-generated client order id (the exchange's native numeric order id is never exposed). Format is exchange-specific: x-MTB46TF3-{uid} (binance-spot), x-MZ8FjHFm-{uid} (binance-futures), lexxO{uid} (OKX — no dashes), lexx-{uid} (Bybit). Bot orders append the run id as a final segment (e.g. x-MZ8FjHFm-{uid}_{runId}). The id is stable for the lifetime of an order, but a modify/split creates NEW orders with new ids.
exchange required Exchange account identifier (e.g., binance-spot, binance-futures, bybit-spot, bybit-futures, okx-swap).
symbol required Trading pair symbol (e.g., BTCUSDT, SOLUSDT).
side required Order direction: BUY to go long/close short, SELL to go short/close long.
enum: "BUY" · "SELL"
type required Order type (from the internal OrderType enum). MARKET = immediate execution at best price. LIMIT = execute at specified price or better. LIMIT_MAKER = post-only limit (rejected if it would take liquidity). STOP_MARKET = market order triggered at stopPrice. STOP_LIMIT = limit order triggered at stopPrice. TAKE_PROFIT_MARKET = market order at take-profit level. TAKE_PROFIT_LIMIT = limit order at take-profit level. Note: trailing stops are represented as STOP_MARKET plus a populated trailing object, not a distinct order type.
enum: "MARKET" · "LIMIT" · "LIMIT_MAKER" · "STOP_MARKET" · "STOP_LIMIT" · "TAKE_PROFIT_MARKET" · "TAKE_PROFIT_LIMIT"
status required Order lifecycle state. NEW = accepted but not yet live on exchange. OPENED = active on exchange. CLOSED = fully filled. CANCELLED = cancelled. ERROR = rejected.
enum: "NEW" · "OPENED" · "CLOSED" · "CANCELLED" · "ERROR"
positionSide Position direction for hedge-mode futures. BOTH = one-way mode.
enum: "LONG" · "SHORT" · "BOTH"
price Limit price. String-encoded decimal.
stopPrice Trigger price for stop/take-profit orders.
fillPrice Volume-weighted average fill price. Null if no fills yet.
origQty Originally requested quantity in base asset.
executedQty Quantity already filled.
reduceOnly If true, order can only reduce an existing position.
closePosition If true, closes the entire position.
trailing Trailing stop parameters. Present (populated) when the order is a trailing stop; the type field remains STOP_MARKET in that case.
delta Callback rate in basis points (100 = 1%).
time Activation timestamp (Unix ms).
isContract True for futures/perpetual contracts, false for spot.
creatorId Identifier of the entity that created this order (bot ID, user short ID).
creator Source that created this order.
enum: "API" · "UI" · "BOT"
isWorking True if the order is currently active on the exchange order book.
metadata JSON-encoded metadata string. Contains allocation info for bot orders, creation timestamps, etc. Parse with JSON.parse().
specific Exchange-specific fields (e.g., goodTillDate). Structure varies by exchange.
orderTime required Timestamp when the order was submitted, in Unix milliseconds.
meta Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.
requestId required Unique identifier for this API request, useful for support tickets and debugging
timestamp required Response timestamp in Unix milliseconds
version required API version
idempotencyKey Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.
Error responses (400, 401, 403, 404, 429, 500)
| 400 | Invalid request parameters |
| 401 | Invalid or missing API key/signature |
| 403 | Insufficient permissions or IP not whitelisted |
| 404 | Resource not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
All errors share the { error: { code, status, message }, meta } envelope —
see Errors for every code.
List trades/fills
Returns user trade/fill history from the exchange. Requires both exchange and symbol parameters.
Query parameters
| exchange required | string | Exchange account identifier (see GET /exchange/supported). Determines which connected exchange account to use. Must match one of your connected accounts. |
| symbol required | string | Trading pair (e.g., SOLUSDT). Required. |
| limit | integer | Maximum number of results to return |
| startTime | integer | Start time filter (Unix milliseconds) |
| endTime | integer | End time filter (Unix milliseconds) |
Request samples
# Sign: timestamp + "GET" + "/v2/orders/trades?exchange=binance-spot&symbol=BTCUSDT" + "" → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/orders/trades?exchange=binance-spot&symbol=BTCUSDT' \
-H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
-H "X-LEXX-SIGN: $SIGNATURE" \
-H "X-LEXX-TIMESTAMP: $TIMESTAMP" // lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("GET", "/orders/trades", {
query: {"exchange":"binance-spot","symbol":"BTCUSDT"}
});
console.log(data); # lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/orders/trades", query={"exchange": "binance-spot", "symbol": "BTCUSDT"})
print(res["data"]) Response 200 — Trade list
data symbol required Trading pair (e.g., BTCUSDT).
side required Trade direction. BUY = purchased base asset, SELL = sold base asset.
enum: "BUY" · "SELL"
price required Execution price. String-encoded decimal for precision.
qty required Filled quantity in base asset. String-encoded decimal for precision.
comm Trading fee for this trade. String-encoded decimal for precision.
commAsset Asset in which commission was charged (e.g., USDT, BNB).
buyer True if the user was the buyer in this trade. Equivalent to side=BUY for the user.
rPnl Realized profit/loss from closing a position. Null for spot trades or position-opening trades. String-encoded decimal for precision. Positive values indicate profit, negative indicate loss.
posSide Position direction for futures trades in hedge mode. LONG = part of a long position, SHORT = part of a short position, BOTH = one-way mode.
enum: "LONG" · "SHORT" · "BOTH"
time required Timestamp when this trade was executed, in Unix milliseconds.
meta Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.
requestId required Unique identifier for this API request, useful for support tickets and debugging
timestamp required Response timestamp in Unix milliseconds
version required API version
idempotencyKey Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.
Error responses (401, 429, 500)
| 401 | Invalid or missing API key/signature |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
All errors share the { error: { code, status, message }, meta } envelope —
see Errors for every code.