# Edit buy order

`POST /v1/edit-buy-order`

Rate limit of create/edit actions for orders is 60 requests per 60 seconds

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

## Parameters

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

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | number | optional | Buy order id |
| `price` | number | optional | New price (1000 = 1$) |
| `amount` | number | optional | New or old amount of items |

```json
{
  "id": 2007,
  "price": 2007,
  "amount": 5
}
```

## Example (curl)

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

## Example response

```json
{
  "success": false,
  "msg": "string",
  "id": 2007,
  "amount": 6,
  "price": 2008
}
```

## Responses

- `200` successful operation

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional |  |
| `msg` | string | optional | If missing required parameter(s) then will respond with reason |
| `id` | number | optional | Buy order id |
| `amount` | number | optional | New amount |
| `price` | number | optional | New price (1000 = 1$) |

- `429` Too many requests

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional |  |
| `msg` | string | optional | Reason why request failed |
| `msBeforeNext` | number | optional | Milliseconds before next request |


## Notes for agents

- Auth is the query parameter `api`, not an Authorization header.
- See [/statuses.md](/statuses.md) for numeric trade status plus `escrow_status` / `release_date`.
- 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.
- 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). include_hold appends unlock_at,send_until. compact and whitemarket are JSON-only.
- Do not use GET /v1/ready-to-transfer-p2p; use the [trade websocket](/websocket.md).
