# Amend Order

> Amends an existing trading order for the authenticated user's account, including support for multi-level take profit and stop loss

Source: /trader/api/trading/amend-order

## `PATCH /accounts/{account_id}/orders/{order_id}`

**Amend Order**

Amends an existing trading order for the authenticated user's account, including support for multi-level take profit and stop loss

Tags: `Trading`

#### Path parameters

- `account_id` (string) (required) — The account ID where order to amend belongs
- `order_id` (string) (required) — Order ID to amend


### Request body

**Content-Type:** `application/json`

- `order_id` (string) — The order identifier to amend (required for WebSocket, extracted from URL for HTTP)
- `volume` (number) — Trading volume in lots
- `limit_price` (number) — The new limit price of a limit order
- `stop_price` (number) — The new stop price of a stop order
- `time_in_force` (string)
  - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD`
- `expire_time` (string) — Order expiration time
- `good_till_date` (string) — Expiry datetime for GTD (Good Till Date) orders (ISO 8601 / RFC 3339). Required when time_in_force is TIF_GTD; ignored for all other time_in_force values.

- `tp_levels` (array) — Multi-level take profit configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify
  - items:
    - `level_id` (string) — Optional: If provided, modifies existing TP/SL order; if empty, creates new
    - `price` (number) (required) — Trigger price for this protection level
    - `qty` (number) (required) — Quantity in lots for this level
- `sl_levels` (array) — Multi-level stop loss configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify
  - items:


### Responses

#### `200` — Order amended successfully

**Content-Type:** `application/json`

- `message` (string) (required) — The message that conveys the status of the request
- `operation_id` (string) (required) — The operation ID of the API request

#### `400` — Bad request (missing or invalid fields)

**Content-Type:** `application/json`

- `error` (object) (required)
  - `type` (string) (required) — Error type code
  - `message` (string) (required) — Human-readable error message
  - `field` (string) — Field name if error is field-specific

#### `401` — Unauthorized (invalid or missing JWT token)

**Content-Type:** `application/json`



#### `403` — Forbidden (account access denied)

**Content-Type:** `application/json`



#### `404` — Account or symbol not found

**Content-Type:** `application/json`



#### `422` — Unprocessable entity (business rule violation)

**Content-Type:** `application/json`



#### `500` — Internal server error

**Content-Type:** `application/json`



