Skip to main content
POST
Cancel multiple orders by either internal orderIds or clientOrderIds supplied when creating the orders. Provide exactly one non-empty identifier array. Each request accepts 1–50 internal UUIDv4 IDs or 1–50 client order IDs of at most 128 characters. Requests with both arrays or neither array return 400 Bad Request.
POST /orders/cancel-batch remains supported for existing integrations and accepts orderIds only.

Authentication and delegation

Use a scoped API token with HMAC signing and the trading scope. To cancel for a partner sub-account, add ?onBehalfOf=<subProfileId>; the target must belong to the authenticated partner and the token must also have delegated_signing. Include the query string in the HMAC-signed path.

Results

  • 200 OK means every resolved order was canceled.
  • 207 Multi-Status means at least one order was canceled and at least one failed.
  • 400 Bad Request with a failed array means no order could be canceled.
  • Internal-ID results use order-ID strings in canceled and { orderId, reason, message } records in failed.
  • Client-ID results use { clientOrderId, orderId } records in canceled. Failures are keyed by clientOrderId; orderId is included only if the client ID resolved before cancellation failed.
For an internal-ID request, unknown IDs are omitted when at least one supplied ID resolves. If none resolve, the endpoint returns 404 Orders not found. Client-ID requests report every unresolved client ID as ORDER_NOT_FOUND. Cancellation failures use ORDER_NOT_FOUND with Order not found or already canceled, or UNKNOWN_ERROR with Failed to cancel order. Cancellation remains available in normal, post_only, and cancel_only. Trading mode disabled returns 425 Too Early.

Authorizations

lmts-api-key
string
header
required

Scoped API token with HMAC-SHA256 signing. Requires three headers: lmts-api-key (token ID), lmts-timestamp (ISO-8601), lmts-signature (Base64-encoded HMAC). See Authentication docs for details.

Query Parameters

onBehalfOf
integer

Partner sub-account profile ID. Requires delegated_signing in addition to trading.

Required range: x >= 1
Example:

326

Body

application/json
orderIds
string<uuid>[]
required

Internal order IDs. Provide exactly one of orderIds or clientOrderIds.

Required array length: 1 - 50 elements
Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
Example:
clientOrderIds
string[]

Client-provided order IDs from order creation. Provide exactly one of orderIds or clientOrderIds.

Required array length: 1 - 50 elements
Maximum string length: 128
Example:

Response

All orders successfully cancelled

message
string
required

Confirmation message for the cancelled orders

Example:

"Orders canceled successfully"

canceled
string<uuid>[]

Array of successfully cancelled order IDs

Example:
failed
object[]

Array of orders that failed to cancel with reasons