# Remove all your buy orders, or one game's (v2)

`POST /v2/remove-all-orders`

Remove all your open orders, or only those of game. Send {} for all games.


Every removed order is recorded in [GET /v2/buy-order-history](/api/buy-order/buy-order-history-v2) with kind = cancelled and reason = user.


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, 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 |
| --- | --- | --- | --- |
| `game` | enum | optional | csgo, dota2, rust or tf2; absent = all games |

```json
{
  "game": "rust"
}
```

## Example (curl)

```bash
curl -X POST 'https://api.waxpeer.com/v2/remove-all-orders?api=%7B%7BAPI_KEY%7D%7D' \
  -H 'Content-Type: application/json' \
  -d '{
  "game": "rust"
}'
```

## Example response

```json
{
  "success": true,
  "removed": 2
}
```

## Responses

- `200` Successful operation or refusal

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional | Whether the operation succeeded |
| `removed` | integer | optional | How many orders were removed |
| `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).
