# stockQuants query


`stockQuants` is a GraphQL query of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Returns what lies in which bin of the named warehouses: one row per variant, bin and lot with
stock, in base units, by bin, variant, then row. Use it to see where goods are before you plan
a move.

- Requires the `stockCard.read` and `position.read` permissions.
- `lot` and `lotStatus` also require the `lot.read` permission. Without it, they are null with
  `FORBIDDEN_ROLE` at their path, and the rest of the row is returned.
- Lots are returned whatever their status. Read `lotStatus` and `lot.expiresAt`.
- The scope is as in [`stockCards`](/chameleoon-max/query/stock-cards).
- The connection has no total count.

Pass exactly one of `first` or `last`, from 1 to 250. `first` (with `after`) pages forward;
`last` (with `before`) pages backward. `last` alone returns the last page. Every edge carries
its own cursor.

A page costs 2 + first (or last) × the cost of one node.

## Arguments

- `filter`: [`StockQuantFilter!`](/chameleoon-max/type/stock-quant-filter) · required
- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

## Returns

[`StockQuantConnection!`](/chameleoon-max/type/stock-quant-connection): a page of [`StockQuant`](/chameleoon-max/type/stock-quant).

## Example

**Query**

```graphql
query stockQuants($filter: StockQuantFilter!, $first: Int) {
  stockQuants(filter: $filter, first: $first) {
    edges {
      cursor
    }
    nodes {
      variantId
      warehouseId
      locationId
      locationCode
      pickable
      lotId
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

**Variables**

```json
{
  "filter": {
    "warehouseIds": [
      "00000000-0000-4000-8000-000000000001"
    ]
  },
  "first": 10
}
```

**Response**

```json
{
  "data": {
    "stockQuants": {
      "edges": [
        {
          "cursor": "example"
        }
      ],
      "nodes": [
        {
          "variantId": "00000000-0000-4000-8000-000000000001",
          "warehouseId": "00000000-0000-4000-8000-000000000001",
          "locationId": "00000000-0000-4000-8000-000000000001",
          "locationCode": "example",
          "pickable": true,
          "lotId": "00000000-0000-4000-8000-000000000001"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "example",
        "endCursor": "example"
      }
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
