---
title: "Edit Complex Order"
method: PATCH
path: "/v1/complex-orders/{complex_order_id}"
tags: ["complex-orders"]
---

# Edit Complex Order

`PATCH /v1/complex-orders/{complex_order_id}`

## Request

- Base URL: `https://api.rivermarkets.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.rivermarkets.com/v1/complex-orders/{complex_order_id}`
- Auth: none declared

Edit the total quantity of an ACTIVE peg order.

`total_qty` is the new total, not the remaining. The new total is recorded
immediately and the peg consumer resizes the resting child in place (queue
position is kept on venues that support in-place decreases). A total at or
below the quantity already filled closes the peg as EXECUTED. Returns 202;
the outcome is recorded on the returned amendment.

## Path parameters

- `complex_order_id` string, uuid, required

## Request body

- ComplexOrderEditRequest: Edit an active peg order. `total_qty` is the new TOTAL quantity, not the remaining. A total at or below the quantity already filled closes the peg as filled.
  - `total_qty` number, required: New total quantity (not remaining)

## Response `202`

Successful Response

- ComplexOrderEditResponse
  - `complex_order_id` string, uuid, required: Unique complex order identifier
  - `total_qty` number, required: Total quantity now recorded on the order
  - `amendment_id` string, uuid, required: Audit row tracking the edit outcome

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-14** `1318dc57d3b2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rivermarkets/apis/river-finance-api/changes/v1/complex-orders/:complex_order_id/patch.md)

---

[API](https://skmtc.dev/rivermarkets/apis/river-finance-api.md) - [All operations](https://skmtc.dev/rivermarkets/apis/river-finance-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rivermarkets/apis/river-finance-api/revisions/3732aea08430?raw)
