Edit Order
POST/private/EditOrder
Sends a request to edit the order parameters of a live order. When an order has been successfully modified, the original order will be cancelled and a new order will be
created with the adjusted parameters a new txid
will be returned in the response.
The new AmendOrder endpoint resolves the caveats listed below and has additional performance gains.
There are a number of caveats for EditOrder
:
- triggered stop loss or profit take profit orders are not supported.
- orders with conditional close terms attached are not supported.
- orders where the executed volume is greater than the newly supplied volume will be rejected.
cl_ord_id
is not supported.- existing executions will are associated with the original order and not copied to the amended order.
- queue position will not be maintained.
API Key Permissions Required: Orders and trades - Create & modify orders
and Orders and trades - Cancel & close orders
Request
- application/json
Body
required
- string
- integer
- Limit price for
limit
andiceberg
orders - Trigger price for
stop-loss
,stop-loss-limit
,take-profit
,take-profit-limit
,trailing-stop
andtrailing-stop-limit
orders - Relative Prices: Either
price
orprice2
can be preceded by+
,-
, or#
to specify the order price as an offset relative to the last traded price.+
adds the amount to, and-
subtracts the amount from the last traded price.#
will either add or subtract the amount to the last traded price, depending on the direction and order type used. Prices can also be suffixed with a%
to signify the relative amount as a percentage, rather than an absolute price difference. - Trailing Stops: Must use a relative price for this field, namely the
+
prefix, from which the direction will be automatic based on if the original order is a buy or sell (no need to use-
or#
). The%
suffix also works for these order types to use a relative percentage price. - Limit price for
stop-loss-limit
,take-profit-limit
andtrailing-stop-limit
orders Note: - Trailing Stops: Must use a relative price for this field, namely one of the
+
or-
prefixes. This will provide the offset from the trigger price to the limit price, i.e. +0 would set the limit price equal to the trigger price. The%
suffix also works for this field to use a relative percentage limit price.
Nonce used in construction of API-Sign
header
User reference id
userref
is an optional user-specified integer id associated with edit request.
Note: userref from parent order will not be retained on the new order after edit.
txid object required
Original Order ID or User Reference Id (userref) which is user-specified integer id used with the original order. If userref is not unique and was used with multiple order, edit request is denied with an error.
string
integer
Order quantity in terms of the base asset.
For iceberg
orders only, it defines the quantity to show in the book while the rest of order quantity remains hidden. Minimum value is 1 / 15 of volume
.
Asset pair id
or altname
Price:
Notes:
Secondary Price:
Comma delimited list of order flags. Only these flags can be changed: - post post-only order (available when ordertype = limit). All the flags from the parent order are retained except post-only. post-only needs to be explicitly mentioned on edit request.
RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing. min now() + 2 seconds, max now() + 60 seconds.
Used to interpret if client wants to receive pending replace, before the order is completely replaced
Validate inputs only. Do not submit order.
Responses
- 200
Order edited.
- application/json
- Schema
- Example (from schema)
- Limit with conditional stop-loss
Schema
result object
descr object
Order description info
Order description
New Transaction ID
(if order was added successfully)
Original userref if passed with the request
Original userref if passed with the request
Number of orders cancelled (either 0 or 1)
Original transaction ID
Status of the order: Ok or Err
Updated volume
Updated price
Updated price2
Error message if unsuccessful
{
"error": [],
"result": {
"descr": {
"order": "buy 1.25000000 XBTUSD @ limit 27500.0"
},
"txid": "OU22CG-KLAF2-FWUDD7"
}
}
{
"error": [],
"result": {
"status": "ok",
"txid": "OFVXHJ-KPQ3B-VS7ELA",
"originaltxid": "OHYO67-6LP66-HMQ437",
"volume": "0.00030000",
"price": "19500.0",
"price2": "32500.0",
"orders_cancelled": 1,
"descr": {
"order": "buy 0.00030000 XXBTZGBP @ limit 19500.0"
}
}
}