Skip to content

Modify order

PUT
/v2/orders/modify

Modify Open and Partially Filled Limit Orders.

The following values of an open or partially filled limit order can be modified:

  • Price
  • Total Quantity
  • Remaining Quantity

Queue position behaviour:

  • Reducing the Total quantity or Remaining quantity will maintain the modified order's position in the order queue.
  • Increasing the Total quantity or Remaining quantity will move the modified order to the back of the order queue.
  • Modifying the price up or down will move the modified order to the back of the order queue.

Modified orders retain their original orderId and the audit trail can be viewed in the Detailed Order History API call.

When the response is 201 Created, this means that the Modify Order request has been submitted and processed successfully.

Parameter Description
orderId (required) Placed order Id provided by VALR
pair (required) Currency pair for the orderId
modifyMatchStrategy (required) RETAIN_ORIGINAL keeps the original order, CANCEL_ORIGINAL cancels it, or REPRICE adjusts the order price to avoid immediate match
newRemainingQuantity (optional) New base quantity to be executed, irrespective of any existing quantity on the order book at the time of processing the request
newTotalQuantity (optional) New total base quantity for the order. If newTotalQuantity is less than the filled quantity, the order is cancelled. Otherwise, newTotalQuantity minus filled quantity becomes the new remaining quantity.
newPrice (optional) Requested new price in quote currency
customerOrderId (optional) Placed order ID provided by customer. Alphanumeric with no special characters, limit of 50 characters.

Either newRemainingQuantity or newTotalQuantity can be specified in the same request, but not both.

Important Notes

  • Only the original order account's API key can modify the order.

  • A 201 Created response means the modify order request has been submitted and processed; use the Order Status REST API or WebSocket API to receive the final status.

  • The modify order request will fail if the new values are the same as the current values.

  • modifyMatchStrategy:
    Controls what happens when the modified order would immediately match:

    • RETAIN_ORIGINAL: Keeps the original order unchanged if the modification would cause an immediate match.
    • CANCEL_ORIGINAL: Cancels the original order if the modification would cause an immediate match.
    • REPRICE: Adjusts the order price to avoid immediate match whilst keeping the order active.

Authorizations

apiKey

Your API key

Type
API Key (header: X-VALR-API-KEY)
+
apiSignature

HMAC SHA512 signature of the request (see Authentication section)

Type
API Key (header: X-VALR-SIGNATURE)
+
apiTimestamp

Request timestamp in milliseconds

Type
API Key (header: X-VALR-TIMESTAMP)

Request Body

application/json
JSON
{
"orderId": "0198510c-09fa-7f86-8ddb-b6b222b4e509",
"pair": "BTCUSDT",
"quantity": "0.020000",
"price": "62830"
}

Responses

Order modified successfully

application/json
JSON
{
"id": "4b6458b6-92b4-11ee-894e-894ac6bb1906"
}

Playground

Authorization
Body

Samples