Skip to main content

Modify Order

Type: TRADE

Weight: 1

PUT /fapi/v1/order

Change the price and/or quantity of a resting (or partially filled) LIMIT order.

Request

PUT /fapi/v1/order?timestamp=<ms>&signature=<hex>
Content-Type: application/json

Body params

NameTypeRequiredNotes
symbolstringyes
orderIdstringone of
origClientOrderIdstringone of
sidestringnoIf sent, must match the resting order (-1102 otherwise). Direction cannot change.
quantitystringyesNew total quantity; must be ≥ already-filled quantity.
pricestringyesNew price.

Response — 200 — same shape as New Order; status reflects the state after resubmission.

Semantics (cancel-and-resubmit with margin accounting)

  1. Validate new quantity / price (> 0, quantity ≥ filled).
  2. Compute the margin delta new_freeze − old_freeze; if more margin is needed, check available before cancelling so the operation is never left half-done.
  3. Cancel in the engine — if the engine no longer has the order (race), return -2011 and change nothing.
  4. Adjust the frozen balance by the delta, update the stored order, and resubmit the unfilled slice with the same orderId.

Sparky differences

  • orderId is preserved (Binance may issue a new id on amend).
  • Only LIMIT orders can be modified; MARKET / trigger types → -2013.
  • Frozen margin is recomputed as remaining × price / leverage × 1.005 on every modify, consistent with the cancel path.

Errors

HTTPcodemsg
400-1100Invalid quantity / price.
400-1102Missing id, or side mismatch.
400-2011Engine no longer holds the order.
404-2013Order does not exist or cannot be modified.
400-2019Not enough margin for the larger order.

Authentication failures (INVALID_API_KEY, API_KEY_DISABLED, IP_NOT_ALLOWED, SIGNATURE_INVALID) apply to every signed endpoint and use Sparky's {"success":false,"error":{...}} envelope; see Error Codes.