# Withdrawing to Steam

Items you buy land in your on-site backpack. Withdrawing sends them to Steam as
a trade offer from one of our bots.

## Before your first withdrawal [#before-your-first-withdrawal]

Your account needs a **Steam trade URL** set, on the account the items are going
to. The API rejects a trade URL belonging to a different Steam account, so this
is a one-time setup step on the website.

Without it you get `TRADE_URL_NOT_SET` or `STEAM_ID_NOT_SET`.

## 1. List your backpack [#1-list-your-backpack]

[`GET /public/v1/backpack`](/docs/reference/trading/backpack) returns what you own, paginated:

```bash
curl "https://api.cs.deals/public/v1/backpack?page=1&limit=50" \
  -H "Authorization: Bearer csd_..."
```

Each row has an `id`, the **backpack item id**, which is what you withdraw
with. It is not the listing id and not the Steam asset id.

## 2. Request the withdrawal [#2-request-the-withdrawal]

[`POST /public/v1/withdraw`](/docs/reference/trading/withdraw):

```bash
curl -X POST https://api.cs.deals/public/v1/withdraw \
  -H "Authorization: Bearer csd_..." \
  -H "Content-Type: application/json" \
  -d '{ "items": [{ "id": 77, "amount": 1 }] }'
```

Items are held by different bots, so one request can become several trade
offers, one per bot. That's normal and invisible apart from receiving more
than one offer. The response's `withdraw_ids` carries one id per offer
created.

## 3. Accept the offer on Steam [#3-accept-the-offer-on-steam]

[`GET /public/v1/trades`](/docs/reference/trading/trades) tracks them. Each trade carries a
`steam_offer_id`, a `status` and its items. The offer arrives from a CS Deals bot; accept it in
Steam as you would any trade.

If you decline or let an offer expire, the items go back to your backpack
automatically.

## Limits [#limits]

| Limit                      | Value                           |
| -------------------------- | ------------------------------- |
| Items per withdrawal       | 50                              |
| Concurrent active trades   | 15                              |
| Value per withdrawal       | your tier's per-transaction cap |
| Value per rolling 24 hours | your tier's daily cap           |

Withdrawal value caps are set per account by tier. Crypto, bank and skin
withdrawals all draw from the same 24-hour bucket. Exceeding them returns
`WITHDRAW_LIMIT_EXCEEDED` or `WITHDRAW_DAILY_LIMIT_EXCEEDED`, both with the
limit in `data`; the daily one also includes your current usage as `used`. `WITHDRAW_DISABLED` means withdrawals
are not enabled on the account at all. Contact support.

## Errors worth handling [#errors-worth-handling]

| Code                        | Meaning                                                                |
| --------------------------- | ---------------------------------------------------------------------- |
| `ITEM_NOT_OWNED`            | A backpack item id isn't yours, or is already withdrawing.             |
| `INSUFFICIENT_ITEM_AMOUNT`  | You asked for more copies than you hold.                               |
| `ITEM_TRADE_LOCKED`         | Still inside Steam's trade hold.                                       |
| `ACTIVE_TRADE_LIMIT`        | 15 trades already in flight. Wait for one to settle.                   |
| `WITHDRAW_ITEM_LIMIT`       | More than 50 items in the request. Split it into smaller withdrawals.  |
| `BOT_UNAVAILABLE`           | The holding bot is temporarily unavailable. `data.itemIds` says which. |
| `TRADING_WITHDRAW_DISABLED` | Withdrawals are paused site-wide. Retry later.                         |
