---
api: 'Revolut X Crypto Exchange REST API'
---

# Replace order

Replace an existing order.
The user is resolved by the provided API key.

:::note
Venue order id of the order will be updated as well.
:::

## Endpoint

PUT `/orders/{venue_order_id}`

## Parameters

### header parameters

- `X-Revx-Timestamp` (integer, required)
  Current timestamp in Unix epoch milliseconds. 
  Used to prevent replay attacks and construct the signature.
  Provided with other authentication headers.

- `X-Revx-Signature` (string, required)
  The Ed25519 signature of the request. 
  Provided with other authentication headers.
  
  :::tip
  See **Authentication headers: Signing a request** for details on how to generate this.
  :::

### path parameters

- `venue_order_id` (string, required)
  Unique identifier (UUID) of the venue order to replace.

## Request body

Order replacement details.

### Attributes

- `client_order_id` (string)
    Client-generated unique identifier for the replacement request, used to guarantee idempotency.
    Retries with the same value will not create duplicate replacements.
- `base_size` (string, optional)
    New amount of base currency for the replacement order.
    If only the price is provided, without the quantity or amount, this parameter will stay the same for SELL orders and be recalculated for BUY orders.
- `quote_size` (string, optional)
    New amount of quote currency for the replacement order.
    If only the price is provided, without the quantity or amount, this parameter will stay the same for BUY orders and be recalculated for SELL orders.
- `price` (string, optional)
    New limit price for the replacement order.
    If omitted, the original order's price is preserved.
- `execution_instructions` (array of enum, optional)
    Execution instructions applied to the replacement order, overriding those of the original.
    Pass an empty array `[]` to explicitly clear all instructions.
    If the field is omitted entirely, the original order's instructions are preserved.

## Returns

### 200

OK

The successfully replaced order details.

#### Response attributes

- `data` (object)
    Wrapper object containing the order details.
  - `data.venue_order_id` (string)
      ID of the order generated by the system.
  - `data.client_order_id` (string)
      Client order ID provided by the client.
  - `data.state` (enum)
      Order state after submitting it.
      Possible enum values:

      - `pending_new`
      - `new`
      - `partially_filled`
      - `filled`
      - `cancelled`
      - `rejected`
      - `replaced`

## Error responses

| HTTP status code | Description |
| --- | --- |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 429 | Rate Limit Exceeded |
| 5XX | Server Error |
