For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /orders/batch

Submit multiple orders

Submit multiple orders.

operationId: createOrdersBatch · CCXT method: createOrders · Rate-limit class: trading

Authentication: hmacAuth.

Submit multiple orders in one request. Orders are processed sequentially and non-atomically: an early order consuming margin can cause a later order in the same batch to fail, and per-order failures do not abort the batch. The response array preserves request order with a per-order success or error result.

Weighted by batch size. This call costs 1 + floor(order_count / 40) units of the trading-action budget, so up to 40 orders cost the same as a single order and every further 40 adds a unit. Batching is therefore cheaper than the equivalent individual submits, and the cost of one call is capped at one second of tokens so a large batch can never be permanently unsatisfiable. See “Rate limits” in the API description.

Request body

Required. application/json. The contract declares no schema for this body — only the example below, so a generated client gets an untyped body here.

Responses

Status
Body
Meaning

201

array of OrderResult

Per-order results, in request order. Returned with status 201 for the batch as a whole even when individual entries failed; inspect each entry's error.

401

(no schema declared)

403

(no schema declared)

429

(no schema declared)

Example

curl -X POST 'https://exchange.nexus.xyz/api/exchange/orders/batch' \
  -H 'X-API-Key: nx_7f3a1b...' \
  -H 'X-Timestamp: 1776033911836' \
  -H 'X-Signature: <hmac-sha256>' \
  -H 'Content-Type: application/json'
import requests

headers = {
    "X-API-Key": "nx_7f3a1b...",
    "X-Timestamp": "1776033911836",
    "X-Signature": "<hmac-sha256>",
    "Content-Type": "application/json"
}

response = requests.post("https://exchange.nexus.xyz/api/exchange/orders/batch", headers=headers)
response.raise_for_status()
print(response.json())
const response = await fetch("https://exchange.nexus.xyz/api/exchange/orders/batch", {
  method: "POST",
  headers: {
    "X-API-Key": "nx_7f3a1b...",
    "X-Timestamp": "1776033911836",
    "X-Signature": "<hmac-sha256>",
    "Content-Type": "application/json"
  },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());

X-Signature is a placeholder: it is derived from this specific request. See Authentication for the canonical string and the HMAC rule.


Generated from eng/apps/exchange/api/openapi.json (spec 0.9.36). Do not edit by hand — regenerate with python3 product/docs/tools/api-reference/generate.py. Hand-authored context lives in the Guides pages.

Last updated