API documentation

Exchange

Exchange account settings — hedge mode, margin configuration

Base URL https://api.lexx-trade.com/api/v2 · All endpoints require Ed25519 request signatures unless marked "no auth" — see Authentication.

GET /exchange/supported

Get supported exchanges

Returns the list of supported exchanges and their basic capabilities. Note: unlike /server/*, this endpoint requires authentication (a signed request with at least read permission) even though the list itself is static — it is mounted behind the auth pipeline by design.

Request samples

# Sign: timestamp + "GET" + "/v2/exchange/supported" + ""  → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/exchange/supported' \
  -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", "/exchange/supported");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/exchange/supported")
print(res["data"])

Response 200 — Supported exchanges.

data array
id string required

Exchange account identifier (e.g., binance-futures).

name string required

Human-readable exchange name.

type string required

Market type (spot, futures, swap).

meta object

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 string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

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.

GET /exchange/hedge-mode

Get hedge mode status

Returns whether hedge mode is enabled for the specified exchange account. Hedge mode allows simultaneous long and short positions on the same symbol.

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.

Request samples

# Sign: timestamp + "GET" + "/v2/exchange/hedge-mode?exchange=binance-spot" + ""  → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/exchange/hedge-mode?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("GET", "/exchange/hedge-mode", {
  query: {"exchange":"binance-spot"}
});
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/exchange/hedge-mode", query={"exchange": "binance-spot"})
print(res["data"])

Response 200 — Current hedge mode. `dualSidePosition` true = hedge mode, false = one-way mode.

data object
dualSidePosition boolean
meta object

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 string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 429, 500)
400 Invalid request parameters
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.

POST /exchange/hedge-mode

Set hedge mode

Toggle hedge mode on/off for a FUTURES exchange (spot exchanges return 400). The exchange is passed as a query parameter; the boolean flag is dualSidePosition.

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 body required

dualSidePosition boolean required

true = hedge mode (dual position side), false = one-way mode

Request samples

# Sign: timestamp + "POST" + "/v2/exchange/hedge-mode?exchange=binance-spot" + ""  → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/exchange/hedge-mode?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("POST", "/exchange/hedge-mode", {
  query: {"exchange":"binance-spot"}
});
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/exchange/hedge-mode", query={"exchange": "binance-spot"})
print(res["data"])

Response 200 — Hedge mode updated

data object
dualSidePosition boolean
meta object

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 string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

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.

Cookie Preferences

Manage your cookie preferences below. Necessary cookies are always active as they are essential for the website to function properly.

Strictly Necessary

Essential for the website to function. These cookies cannot be disabled.

Analytics

Help us understand how visitors interact with our website by collecting and reporting information anonymously.

Marketing

Used to track visitors across websites to display relevant advertisements.

Preferences

Allow the website to remember choices you make, such as language or region.