Skip to main content
The modify action updates a resting (OPEN status) order without requiring you to cancel and replace it. You can change the price, total size, time-in-force (Gtc or Alo only), and client order ID. Direction (b), contract (a), and reduceOnly (r) cannot be changed — cancel the order and place a new one if you need to alter those fields.

Endpoint

Priority Rules

How you locate and modify the order determines whether it retains its queue position:
  • Same price, reduce size only — the modification is applied in-place. The order keeps its existing FIFO queue priority and its order ID.
  • Change price, increase size, or change TIF/cloid — the order is removed and re-queued at the back of the new price level, losing its queue priority. The order ID is still preserved.
An increase in size passes an initial-margin pre-check before it is re-queued. If margin is insufficient, the order is rolled back to its original parameters and the rejection is reported in statuses[0].error (insufficient margin for modified order).
If the new price would immediately cross the book and match against a resting opposite-side order, the modification request is rejected. Cancel the order and place a new one to execute at a marketable price.

Request

Use oid to identify the order by the exchange-assigned ID returned in resting.oid.

Action Fields

string
required
type (required) — Fixed value: "modify".
int32
required
a (asset) (required) — The integer contract ID of the order to modify.
int64
oid (orderId) — Exchange-assigned order ID from resting.oid. Takes priority over cloid when both are provided. At least one of oid or cloid must be present.
string
cloid — clientOrderId (locate) — Client order ID used to find the order when oid is not provided. Must match the c field set at placement. Only decimal digits (0–9) are accepted, at most 20 bytes, within the int64 range; otherwise the request returns 400 INVALID_PARAM with errors[].reason INVALID_FORMAT (OUT_OF_RANGE outside int64).
string
p (price) — New limit price as a raw integer string. Omit to keep the existing price unchanged.
string
s (size) — New total target size as a raw integer string. This is the total quantity including any already-filled amount, not just the remaining leaves size: the new remaining quantity is s minus the filled amount, so s must exceed what has already filled. Omit to keep the existing size unchanged.
string
tif (timeInForce) — New time-in-force for the order. Only "Gtc" (good-til-cancel) or "Alo" (add-liquidity-only / post-only) are accepted. Omit to keep the existing TIF unchanged.
string
c — clientOrderId (update) — New client order ID to assign to the order after modification. Same format rules as cloid. Omit to keep the existing client order ID unchanged.
boolean
sync — Envelope-level, beside action, and not signed. true returns HTTP 200 with a one-entry statuses[]; false returns HTTP 202 and the results arrive on orderUpdates. When omitted, the server default applies. Must be a JSON boolean. See Synchronous and asynchronous responses.
You must provide at least one of oid or cloid to identify the order. All other fields (p, s, tif, c) are optional — include only the fields you want to change.

Response

The synchronous result has a single shape: response.data.statuses[] with exactly one entry for the modified order, using the same entry grammar as order — resting, filled, or error. No other result shape is returned; read statuses[0].
Two status codes are possible. With sync: true the server answers HTTP 200 with the result shown below; with sync: false it answers HTTP 202, acknowledging the request for asynchronous processing:
count is always 1. On a 202 the outcome arrives on the orderUpdates channel instead. Without sync the server default decides — handle both.
The order was modified and is resting in the book under its original order ID.

Response fields

array
Exactly one entry, for the modified order. The entry is one of:
  • resting — { "oid": <int64> }, the modified order is in the book. The order ID does not change.
  • filled — { "oid": <int64>, "totalSz": "<string>", "avgPx": "<string>" }.
  • error — a string explaining the rejection. The original order is unchanged.
The response does not carry the modified order’s full state. Read the new price, total size, remaining size, and client order ID from userOrders, or from the orderUpdates channel.

Errors

Modify rejections

These appear as statuses[0].error. The original order is unchanged in every case.

HTTP errors