Broker API
Connect your server to the trading infrastructure.
On this page
Base URL and conventions
The Broker Integration API uses REST and JSON. The current version is /api/broker/v1. Breaking changes use a new version path.
https://api.lumireone.com/api/broker/v1Use HTTPS with TLS 1.2 or later. Plain HTTP is rejected. Encode requests as UTF-8 and set Content-Type: application/json for every request with a body.
The paths below are relative to the base URL. :login is the account login number; :ticket identifies an order or position.
Authentication and network access
Send your secret key in the X-Api-Key header on every endpoint. LumireOne issues keys tied to your broker account. A key can read and write only your broker’s accounts.
X-Api-Key: YOUR_BROKER_API_KEYOnly a SHA-256 hash is stored server-side. The plaintext key is not persisted and cannot be recovered. Keep it securely on your server; never embed it in browser or mobile code or public repositories.
Register the static egress IPv4/IPv6 addresses of your integration servers with LumireOne. Unregistered addresses are rejected at the network edge before authentication.
Quick start
These examples use a placeholder API key and illustrative account data. Account creation writes to the production API. Generated login credentials are returned once in the response.
export LUMIRE_API_KEY='YOUR_BROKER_API_KEY'
curl -X POST https://api.lumireone.com/api/broker/v1/accounts \
-H "X-Api-Key: $LUMIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Example Trader","currency":"USD",
"balance":5000,"leverage":500}' // Run on your server. Set LUMIRE_API_KEY securely in its environment.
const BASE = "https://api.lumireone.com/api/broker/v1";
const response = await fetch(`${BASE}/accounts`, {
method: "POST",
headers: {
"X-Api-Key": process.env.LUMIRE_API_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Example Trader", currency: "USD",
balance: 5000, leverage: 500
})
});
const result = await response.json();
if (!result.success) {
throw new Error(`${result.error.code}: ${result.error.message}`);
}
// Handle result.data.login and result.data.password securely.
// Do not log credentials.Accounts and balances
- POST
/accounts - Create a trading account. Omitted login and password are generated and returned once.
- GET
/accounts/:login - Read balance, equity, margin, free margin, margin level, leverage and status.
- PATCH
/accounts/:login - Update name, leverage, group_name or password.
- PATCH
/accounts/:login/balance - Apply a deposit or withdrawal to the account ledger.
| Create-account field | Value |
|---|---|
name | Account holder name (string). |
currency | Currency string, for example USD. |
balance | Opening balance, zero or greater. |
leverage | Integer from 1 to 2000. |
login | Optional string; generated if omitted. |
password | Optional string, minimum 6 characters; generated if omitted. |
group_name | Optional trading group string. |
Account updates use the same leverage range and password minimum. For balance operations, type is deposit or withdrawal, and amount must be positive. An optional reference_id is your idempotency/reconciliation reference; an optional comment can contain up to 500 characters.
# Replace ACCOUNT_LOGIN with the intended account login.
ACCOUNT_LOGIN='YOUR_ACCOUNT_LOGIN'
curl -X PATCH \
"https://api.lumireone.com/api/broker/v1/accounts/$ACCOUNT_LOGIN/balance" \
-H "X-Api-Key: $LUMIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"deposit","amount":250,"reference_id":"dep-example-001"}' Positions and orders
- GET
/accounts/:login/positions - Read open positions.
- GET
/accounts/:login/orders/open - Read open orders.
- GET
/accounts/:login/orders/pending - Read pending orders.
- POST
/accounts/:login/orders - Place a market or pending order.
- PATCH
/accounts/:login/orders/:ticket - Modify sl, tp, price or volume. Use null for sl or tp to clear them.
- DELETE
/accounts/:login/orders/:ticket - Close a position in full, or send a volume for a partial close.
- POST
/accounts/:login/orders/:ticket/cancel - Cancel a pending order.
| Order field | Value |
|---|---|
symbol | String, for example EURUSD or XAUUSD. |
type | market, limit, stop or stop_limit. |
direction | buy or sell. |
volume | Positive number of lots. |
price | Required for limit and stop_limit. |
stop_price | Required for stop and stop_limit. |
sl / tp | Optional numeric stop-loss / take-profit. |
comment | Optional string, up to 255 characters. |
{
"symbol": "XAUUSD",
"type": "market",
"direction": "buy",
"volume": 0.10,
"sl": 4280.0,
"tp": 4360.0
}For a partial close, send a body such as {"volume": 0.05} to the DELETE endpoint. Omit the body to close in full.
Reporting
- GET
/accounts/:login/history - Read closed-trade history.
- GET
/accounts/:login/stats - Read account statistics.
- GET
/accounts/:login/transactions - Read balance transactions.
History and transactions accept ?limit=N, with a default of 50 and a maximum of 500.
Single sign-on
- POST
/accounts/:login/auto-login - Generate a short-lived, single-use token for the web terminal.
- GET
/auto-login - Redeem the token for a JWT session pair. Pass it through ?token= or a header.
- POST
/auto-login/verify-2fa - Complete the 2FA challenge and receive the JWT session pair.
Generate the token from your server and redirect the user to the terminal with it. If the account has 2FA enabled, redemption returns a challenge_token instead of a session.
{
"challenge_token": "YOUR_CHALLENGE_TOKEN",
"totp_code": "123456"
}The TOTP code above is illustrative; use the user’s current code. Keep the API key on your server throughout this flow.
Responses, limits and errors
Check the boolean success field first. Successful responses include data; errors include error.code for programmatic handling and error.message for display.
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "amount must be positive"
}
}The limit is 300 requests per minute per API key, enforced across the cluster. Read the RateLimit-* headers to back off proactively. Exceeding the limit returns HTTP 429.
| Error code | HTTP | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid API key. |
VALIDATION_ERROR | 422 | Body or query validation failed. |
NOT_FOUND | 404 | Account, order or ticket does not exist. |
INVALID_TICKET | 400 | Ticket ID is not a valid number. |
NO_PRICE_DATA | 503 | No live price for the symbol. |
MAX_VOLUME | 400 | Order volume exceeds the allowed maximum. |
RATE_LIMIT_EXCEEDED | 429 | The key exceeded 300 requests per minute. |
Successful requests return HTTP 200 or 201. Other documented statuses include 400 for bad requests and 500 or 503 for server errors or temporary price-feed unavailability.
Integration support
Request credentials and register server IP addresses through [email protected]. Send technical issues to [email protected]. The portal is app.lumireone.com.
For a failed request, include the UTC timestamp, endpoint, HTTP method and error.code. Never include your full API key.
This summary follows the Broker Integration API guide, version 1.0, June 2026. Endpoints, fields and limits may change under future API versions.