> For the complete documentation index, see [llms.txt](https://docs.pangolin.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pangolin.exchange/pangoperps/trading-api/order-management/edit-algo-order.md).

# Edit Algo Order

Update a pending algorithmic order and its child orders.

### Endpoint

**PUT /v1/algo/order**

Mainnet: `PUT https://api.orderly.org/v1/algo/order`

Testnet: `PUT https://testnet-api.orderly.org/v1/algo/order`

Rate limit: 5 requests per second. Use this signed endpoint to amend a pending algorithmic order by its order ID. Only the price or quantity can be changed. The API key must have the trading scope.

### Authentication headers

* orderly-timestamp — signed-request timestamp in milliseconds.
* orderly-account-id — PangoPerps account ID.
* orderly-key — public API key.
* orderly-signature — request signature.
* Content-Type: application/json — JSON request body.

### Request body

Send a JSON object. The root order ID is required; the other fields are available for updating the order or its trigger/child-order configuration.

| Field                | Type      | Required | Description                                                          |
| -------------------- | --------- | -------- | -------------------------------------------------------------------- |
| order\_id            | string    | Yes      | ID of the pending algorithmic order.                                 |
| price                | number    | No       | Updated order price.                                                 |
| quantity             | number    | No       | Updated order quantity.                                              |
| trigger\_price       | number    | No       | Updated trigger price.                                               |
| trigger\_price\_type | string    | No       | Price source used for the trigger.                                   |
| child\_orders        | object\[] | No       | Child order updates, represented as an array of child-order objects. |

A child order can include order\_id, trigger\_price, price, quantity, is\_activated, trigger\_price\_type, and nested child\_orders. The endpoint description limits amendments to the order's price or quantity; trigger and child fields are part of the documented request schema for algorithmic orders.

### Example request

```bash
curl --request PUT \
  --url 'https://api.orderly.org/v1/algo/order' \
  --header 'Content-Type: application/json' \
  --header 'orderly-account-id: <account-id>' \
  --header 'orderly-key: <public-api-key>' \
  --header 'orderly-signature: <signature>' \
  --header 'orderly-timestamp: <timestamp-in-ms>' \
  --data '{
    "order_id": "123456789",
    "price": 3450.5,
    "quantity": 0.25,
    "trigger_price": 3400,
    "trigger_price_type": "MARK_PRICE",
    "child_orders": [
      {
        "order_id": "987654321",
        "trigger_price": 3600,
        "price": 3600,
        "quantity": 0.25,
        "is_activated": "false",
        "trigger_price_type": "MARK_PRICE",
        "child_orders": []
      }
    ]
  }'
```

### Successful response

HTTP 200 returns an EDIT\_SENT status when the edit request is sent for processing.

```json
{
  "success": true,
  "data": {
    "status": "EDIT_SENT"
  },
  "timestamp": 1702989203989
}
```
