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
| Name | Type | Required | Notes |
|---|---|---|---|
symbol | string | yes | |
orderId | string | one of | |
origClientOrderId | string | one of | |
side | string | no | If sent, must match the resting order (-1102 otherwise). Direction cannot change. |
quantity | string | yes | New total quantity; must be ≥ already-filled quantity. |
price | string | yes | New price. |
Response — 200 — same shape as New Order; status reflects the state after resubmission.
Semantics (cancel-and-resubmit with margin accounting)
- Validate new
quantity/price(> 0,quantity ≥ filled). - Compute the margin delta
new_freeze − old_freeze; if more margin is needed, checkavailablebefore cancelling so the operation is never left half-done. - Cancel in the engine — if the engine no longer has the order (race), return
-2011and change nothing. - Adjust the frozen balance by the delta, update the stored order, and resubmit the unfilled slice with the same
orderId.
Sparky differences
orderIdis preserved (Binance may issue a new id on amend).- Only
LIMITorders can be modified;MARKET/ trigger types →-2013. - Frozen margin is recomputed as
remaining × price / leverage × 1.005on every modify, consistent with the cancel path.
Errors
| HTTP | code | msg |
|---|---|---|
400 | -1100 | Invalid quantity / price. |
400 | -1102 | Missing id, or side mismatch. |
400 | -2011 | Engine no longer holds the order. |
404 | -2013 | Order does not exist or cannot be modified. |
400 | -2019 | Not 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.