# Edit the price and amount of a buy order (v2)

`POST /v2/edit-buy-order`

Change the price and amount of one of your orders; send both. filled is kept, and the order keeps its place among orders at the same price.


amount is the total to buy, bought items included. An amount at or below filled closes the order: it is removed and the answer is {"success": true, "closed": true}. Otherwise the answer carries the updated order.


Filters and allow_trade_locked cannot be edited: remove the order and create a new one. A body that sends them is refused with filters_not_editable.


The limits of [POST /v2/create-buy-order](/api/buy-order/create-buy-order-v2) apply (amount 1 to 250, the 30% price floor, balance and 10 × balance exposure). An edit that raises neither the price nor the open amount at that price is always allowed, so you can lower an order even when you are over the limits.


Rate limit. Create, edit and both removals share one budget: 10 requests per 10 seconds per account, on the v1 and v2 paths together. Over it the answer is HTTP 429 with Retry-After and msBeforeNext.


Errors. Refusals are HTTP 200 with {"success": false, "msg": "…", "code": "…"}. Branch on code: it is stable, msg is human text. Codes this method answers: invalid_request, invalid_price, invalid_amount, filters_not_editable, price_too_low, kyc_required, order_not_found, price_above_balance, exposure_limit, busy, error. The full list is on [POST /v2/create-buy-order](/api/buy-order/create-buy-order-v2). A missing or wrong API key is HTTP 403; the write rate limit is HTTP 429.

Prices are integers. `1000` = `1 USD`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `api` | query | string | required | Your [WAXPEER API key](https://waxpeer.com/profile/user?tab=security) |

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | required | Order id |
| `price` | integer | required | New price per item, a positive whole number (1000 = $1) |
| `amount` | integer | required | New total amount, 1 to 250, bought items included. At or below filled closes the order |

```json
{
  "id": 123,
  "price": 13000,
  "amount": 5
}
```

## Example (curl)

```bash
curl -X POST 'https://api.waxpeer.com/v2/edit-buy-order?api=%7B%7BAPI_KEY%7D%7D' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 123,
  "price": 13000,
  "amount": 5
}'
```

## Example response

```json
{
  "success": true,
  "order": {
    "id": 123,
    "name": "AK-47 | Redline (Field-Tested)",
    "game": "csgo",
    "price": 13000,
    "amount": 5,
    "filled": 1,
    "allow_trade_locked": false,
    "filters": {
      "float_min": 0.15,
      "float_max": 0.18,
      "paint_seeds": [
        661,
        670
      ],
      "stickers": [
        {
          "id": 4777,
          "slot": 0
        },
        {
          "id": 55
        }
      ]
    },
    "created": "2026-10-19T10:00:00Z",
    "last_update": "2026-10-19T11:00:00Z"
  }
}
```

## Responses

- `200` Successful operation or refusal

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional | Whether the operation succeeded |
| `order` | object | optional | The updated order (absent when closed is true) |
| `order.id` | integer | optional | Order id |
| `order.name` | string | optional | Full item market hash name |
| `order.game` | string | optional | Game code for requested items (csgo, tf2, rust, dota2) |
| `order.price` | integer | optional | New price per item, a positive whole number (1000 = $1) |
| `order.amount` | integer | optional | New total amount, 1 to 250, bought items included. At or below filled closes the order |
| `order.filled` | integer | optional | Number of fulfilled offers |
| `order.allow_trade_locked` | boolean | optional | true: the order also buys trade-locked listings |
| `order.filters` | object | optional | CS2 only. Which copies the order buys; null on a plain order. Unset filters are omitted, and an unknown key is refused. |
| `order.filters.float_min` | number | optional | Lowest float, 0 to 1 |
| `order.filters.float_max` | number | optional | Highest float, 0 to 1, not below float_min |
| `order.filters.paint_seeds` | array<integer> | optional | 1 to 50 paint seeds (patterns), each 0 to 1000 |
| `order.filters.phase` | enum | optional | Doppler phase name (e.g. Phase 1, Ruby, Emerald) |
| `order.filters.stickers` | array<object> | optional | Applied stickers data |
| `order.filters.stickers.id` | integer | required | Order id |
| `order.filters.stickers.slot` | integer | optional | Sticker slot 0 to 4; absent = any slot |
| `order.filters.charm_id` | integer | optional | Charm id |
| `order.filters.charm_pattern_min` | integer | optional | Lowest charm pattern, 0 to 100000 |
| `order.filters.charm_pattern_max` | integer | optional | Highest charm pattern, 0 to 100000 |
| `order.by` | string | optional | Waxpeer user ID (found in /user) |
| `order.created` | string | optional | Creation timestamp |
| `order.last_update` | string | optional | When the order last changed. Not in the public list |
| `closed` | boolean | optional | true when amount was at or below filled and the order was closed |
| `msg` | string | optional | Why the request was refused (only when success is false) |
| `code` | enum | optional | Stable refusal code (only when success is false) |

- `400` Body is not a JSON object

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional | Whether the operation succeeded |
| `msg` | string | optional | Why the request was refused (only when success is false) |
| `code` | enum | optional | Stable refusal code (only when success is false) |

- `429` Too many requests. Rate limit exceeded

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional | Whether the operation succeeded |
| `msg` | string | optional | Why the request was refused (only when success is false) |
| `msBeforeNext` | number | optional | Milliseconds before next allowed request |


## Notes for agents

- Auth is the query parameter `api`, not an Authorization header.
- See [/statuses.md](/statuses.md) for numeric trade status plus `is_released` / `release_date`. `escrow_status` is site-only.
- Prefer GET /v2/search-items-by-name over v1.
- Prefer GET /v2/get-items-list over v1 (cursor keyset pagination without the 5000 row cap). Pass next_cursor only while has_more is true.
- Prefer POST /v2/my-history over v1 (faster on long histories, ordered by trade id). On buy rows, price is the amount you paid.
- POST /v2/my-history: status (number or array) and reason (string or array) filters need start and end at most 31 days apart. Every trade has reason, reversed_by (buyer / seller / null) and penalties (null when nothing was charged)
- POST /v1/check-availability: up to 1000 item_ids in a JSON body (send strings). Each listing for sale returns its CSV snapshot fields plus float, paint_index, phase, sticker_names, read live. include_hold / include_manual as on the CSV
- Socket.IO game item events carry inspect (Steam inspect link, null when none) and delivery (instant / regular / hold / manual)
- Buy orders: use the /v2 routes. POST /v2/create-buy-order takes a JSON body (name, game, price, amount 1 to 250, allow_trade_locked, and CS2 filters: float_min/float_max, paint_seeds, phase, stickers (id, slot), charm_id, charm_pattern_min/max); api stays in the query. Orders fill automatically from listings at or below the price.
- Buy-order refusals are HTTP 200 `success: false` + `msg` + `code`: branch on `code` (price_above_balance, exposure_limit when open orders would exceed 10 × balance, too_many_orders at 1000 open, invalid_amount, invalid_filters, …). Create, edit and both removals share 10 writes per 10 seconds (HTTP 429).
- The v1 buy-order paths are deprecated and answer with the v2 contract; successful v1 answers also keep v1 field names (`offers` next to `orders`, `id`, `count`, `item_name`). Public lists include filtered orders: compare `filters` with the item before reading an order price as an offer for it. In GET /v2/buy-order-history, kind=cancelled with reason=insufficient_funds means the balance could not pay.
- Trade-locked listings are omitted unless you pass include_hold=1. They then include unlock_at and send_until (RFC 3339 UTC).
- Buy a trade-locked listing only by exact item_id with allow_trade_locked (query 1 on GET /v1/buy-one-p2p, body true on POST /v1/buy). GET /v1/buy-one-p2p-name never sells hold items.
- CSV snapshot: GET /v1/prices/snapshot?format=csv (gzip). Shared header `item_id,name,price,auto,inspect,unlock_at,send_until,class_id,instance_id,steam_id,merchant,delivery`. include_hold=1 adds trade-locked rows (fills unlock_at/send_until; delivery=hold). include_manual=1 adds 12h manual P2P rows (delivery=manual; merchant empty on those rows). compact is JSON-only.
- Do not use GET /v1/ready-to-transfer-p2p; use the [trade websocket](/websocket.md).
