# Update stock in bulk

> Sets the quantity of up to 100 of your listings in one call, for a dealer that keeps stock in its own system. Each line is checked on its own: a quantity below what is promised to accepted offers is refused for that line only. Raising a quantity tells saved searches the listing is back in stock.


`POST https://dev.siteswap.pro/api/v1/listings/stock`

Sets the quantity of up to 100 of your listings in one call, for a dealer that keeps stock in its own system. Each line is checked on its own: a quantity below what is promised to accepted offers is refused for that line only. Raising a quantity tells saved searches the listing is back in stock.

Needs the `listings:write` scope.

## Body

- `items` (object[], required): One line per listing
- `items[].id` (string, required): The listing's id
- `items[].quantity` (number, required): The new total quantity. 0 pauses the listing

```json
{
  "items": [
    {
      "id": "1042",
      "quantity": 35
    },
    {
      "id": "1043",
      "quantity": 0
    }
  ]
}
```

## Responses

- 200: OK
- 400: bad_request, key_in_url or invalid_json: the request could not be read
- 401: missing_key or invalid_key: no key, or a key that is not valid or was revoked
- 403: key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors
- 404: not_found: nothing here that you may see
- 413: too_large: the body is over 256 KB
- 429: rate_limited or daily_quota: wait for Retry-After seconds

## Response fields

- `id` (string)
- `ok` (boolean)
- `quantity` (number | null)
- `status` (string | null)
- `error` (string | null): Why this line was refused

```json
{
  "data": [
    {
      "id": "1042",
      "ok": true,
      "quantity": 35,
      "status": "active",
      "error": null
    },
    {
      "id": "1043",
      "ok": true,
      "quantity": 0,
      "status": "paused",
      "error": null
    }
  ],
  "meta": {
    "request_id": "3f9a1c0b7d2e",
    "api_version": "v1"
  }
}
```

## Example

```bash
curl -X POST "https://dev.siteswap.pro/api/v1/listings/stock" \
  -H "Authorization: Bearer ssk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"id":"1042","quantity":35},{"id":"1043","quantity":0}]}'
```