---
updatedAt: 2026-08-18T18:39:20.000Z
agentTools:
  projectIndex: https://stockpit.readme.io/llms.txt
---

# Queries

Stock adjustments are the documents recording corrections to inventory quantities and the reason of the change.

# Available queries

### `StockAdjustment` - Returns a single stock adjustment based on the `id` provided

```graphql
query {
  StockAdjustment (id: 100012) {
    id
    label
  }
}
```

### `StockAdjustments` - Returns a list of stock adjustments based on the filter define

```graphql
query {
  StockAdjustments {
    data {
    	id
    	label
    }
  }
}
```

<br />

***

# Available fields

| id – [Int](/reference/data-types#int)     |
| ----------------------------------------- |
| Unique identifier of the stock adjustment |

| label – [String](/reference/data-types#string) |
| ---------------------------------------------- |
| Title of the stock adjustment                  |

| notes – [String](/reference/data-types#string) |
| ---------------------------------------------- |
| Notes attached to the stock adjustment         |

| total\_units – [Float](/reference/data-types#float) |
| --------------------------------------------------- |
| Total units of the stock adjustment                 |

| status – [Enum](/reference/data-types#enum)                                        |
| ---------------------------------------------------------------------------------- |
| Status of the stock adjustment (`active`, `cancelled`, `completed`, `unpublished`) |

| dated\_at – [Date](/reference/data-types#date) |
| ---------------------------------------------- |
| Date of the stock adjustment                   |

| to\_location – [Location](/reference/location-queries) – Subquery       |
| ----------------------------------------------------------------------- |
| Destination location if products are moved from one location to another |

| line\_items – Array of [LineItem](/reference/line-item-queries) – Subquery |
| -------------------------------------------------------------------------- |
| List of the line items of the order                                        |

| has\_batch\_numbers – [Boolean](/reference/data-types#boolean) |
| -------------------------------------------------------------- |
| Defines if the stock adjustment has batch numbers              |

| tracking\_completed – [Boolean](/reference/data-types#boolean) |
| -------------------------------------------------------------- |
| Indicates if all batch numbers are allocated when applicable   |

<br />

***

# Filters

You can create filters based on following fields

| label                                                                   |
| :---------------------------------------------------------------------- |
| Example:\{ "column" : "LABEL", "operator" : "LIKE", "value" : "%011%" } |

| status                                                                         |
| :----------------------------------------------------------------------------- |
| Example: \{ column": "STATUS", "operator": "EQ", "value": \{"id": "completed"} |

| total\_units                                                         |
| :------------------------------------------------------------------- |
| Example:\{ "column": "TOTAL\_UNITS", "operator": "GT", "value": 50 } |

| dated\_at                                                                    |
| :--------------------------------------------------------------------------- |
| Example: \{ "column": "DATED\_AT", "operator": "EQ", "value": "2024-01-11" } |

| to\_location\_id                                                              |
| :---------------------------------------------------------------------------- |
| Example: \{ "column": "TO\_LOCATION\_ID", "operator": "EQ", "value": 100002 } |

| location\_id                                                              |
| :------------------------------------------------------------------------ |
| Example: \{ "column": "LOCATION\_ID", "operator": "EQ", "value": 100002 } |

| variant\_id                                                              |
| :----------------------------------------------------------------------- |
| Stock adjustment containing this variant                                 |
| Example: \{ "column": "VARIANT\_ID", "operator": "EQ", "value": 100076 } |

| variant\_label                                                                    |
| :-------------------------------------------------------------------------------- |
| Example: \{ "column": "VARIANT\_LABEL", "operator": "EQ", "value": "NICE SHOES" } |

| variant\_sku                                                                 |
| :--------------------------------------------------------------------------- |
| Example: \{ "column": "VARIANT\_SKU", "operator": "EQ", "value": "10ABC45" } |

| batch\_number\_id                                                                |
| :------------------------------------------------------------------------------- |
| Example: \{ "column": "BATCH\_NUMBER\_ID", "operator": "EQ", "value": "100024" } |

| tracking\_completed                                                                     |
| :-------------------------------------------------------------------------------------- |
| Example: \{ "column": "TRACKING\_COMPLETED", "operator": "EQ", "value": \{"id": true} } |

| has\_batch\_numbers                                                                    |
| :------------------------------------------------------------------------------------- |
| Example :\{ column": "HAS\_BATCH\_NUMBERS", "operator": "EQ", "value": \{"id": true} } |

***

# Sorting

You can sort data based on following fields : id, label, notes, total\_units, status, dated\_at, created\_at, to\_location\_id

## Example of a query

```graphql
query StockAdjustments(
  $orderBy: [QueryStockAdjustmentsOrderByOrderByClause!], 
  $where: QueryStockAdjustmentsWhereWhereConditions, 
  $first: Int = 50, 
  $page: Int
) {
  StockAdjustments(
    orderBy: $orderBy
    where: $where
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
      count
      currentPage
      perPage
    }
    data {
      id
      label
      to_location {
        id
        label
      }
      dated_at
      total_units
      status
      line_items {
        id
        cost
        location {
          id
          label
        }
      }
    }
  }
}
```

```json
{
  "orderBy": [
    {
      "column": "DATED_AT",
      "order": "DESC"
    },
    {
      "column": "CREATED_AT",
      "order": "DESC"
    }
  ],
  "first": 50,
  "page": 1,
}

# Enums

## StockAdjustmentStatus enum

| Value | Description |
| :--- | :--- |
| `active` | The stock adjustment is active |
| `cancelled` | The stock adjustment is cancelled |
| `completed` | The stock adjustment is completed |
| `unpublished` | The stock adjustment is not yet published |
```