# stockCards query


`stockCards` 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 a page of stock cards with their current figures, by variant, then warehouse. Use it
for a full export of stock, paging to the end, or after a page of
[`stockCardChanges`](/chameleoon-max/query/stock-card-changes) to read a variant's cards in the other warehouses of a sum (filter
by `variantIds`, and by `warehouseIds` when you need).

- Requires the `stockCard.read` permission.
- Cards of warehouses outside your API key's warehouse, legal-entity or country scope are left
  out. Archived warehouses are included, exactly as [`warehouses`](/chameleoon-max/query/warehouses) lists them.
- A variant that is only on order, or advised into a warehouse where it never had stock, has no
  card there yet.
- 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`: [`StockCardFilter`](/chameleoon-max/type/stock-card-filter)
- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

## Returns

[`StockCardConnection!`](/chameleoon-max/type/stock-card-connection): a page of [`StockCard`](/chameleoon-max/type/stock-card).

## Example

**Query**

```graphql
query stockCards($first: Int) {
  stockCards(first: $first) {
    edges {
      cursor
    }
    nodes {
      warehouseId
      variantId
      version
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

**Variables**

```json
{
  "first": 10
}
```

**Response**

```json
{
  "data": {
    "stockCards": {
      "edges": [
        {
          "cursor": "example"
        }
      ],
      "nodes": [
        {
          "warehouseId": "00000000-0000-4000-8000-000000000001",
          "variantId": "00000000-0000-4000-8000-000000000001",
          "version": 1
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "example",
        "endCursor": "example"
      }
    }
  }
}
```

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