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

PATCH /orders/{order_id}

Amend an order

Amend an order.

operationId: editOrder · CCXT method: editOrder · Rate-limit class: trading

Authentication: hmacAuth.

Atomic cancel-replace amend of a resting order: changes the price and/or size in a single operation. At least one of price or size must be supplied. Liquidation orders are not amendable, and a pre-trade margin check is applied to the projected replacement before it is accepted. That check excludes the reservation still held by the order being replaced, so an amend is sized on the margin the replacement actually adds rather than on the original and the replacement together: repricing a resting order at the same size needs no additional margin, and shrinking one frees margin rather than requiring it.

An amend does not restart execution. The replacement carries the original's filled forward, so amount stays the total you asked for and an order can never execute more than that total, across any number of amends: a Buy 5 that has filled 2 has 3 left to execute both before and after a reprice, and the replacement comes back as PartiallyFilled rather than Open. size sets the new TOTAL quantity, fills included, and must be greater than filled — a size at or below it is rejected with InvalidAmend; cancel the order instead.

Parameters

Name
In
Type
Required
Default
Description

order_id

path

string

Yes

market_id

query

string

Yes

Market the order rests on (required for routing).

Request body

Required. AmendOrderRequestapplication/json.

{
  "price": "50100",
  "size": "0.2"
}

Responses

Status
Body
Meaning

200

Order

Amended order (the replacement, with a fresh id).

400

(no schema declared)

Invalid amend (empty body, invalid price/size, order not amendable, or margin breach)

401

(no schema declared)

403

(no schema declared)

404

(no schema declared)

Order not found

409

(no schema declared)

The market-lifecycle admission gate, evaluated on the replacement before the original is touched: MarketHalted when the market is halted, MarketReduceOnly when the market is in reduce-only and the replacement is neither reduceOnly nor a liquidation, and MarketSuspended when the market is settling or delisted. Rejected atomically — the original order is left resting, untouched.

429

(no schema declared)

Example

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