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

# Mutations

See the [Queries](/reference/stock-count-queries) page for a presentation of this resource.

# Available mutations

### `CreateStockCount`

Creates a new stock count.

**Parameters:**

| Parameter | Type                                                      | Description          |
| :-------- | :-------------------------------------------------------- | :------------------- |
| `input`   | [StockCountCreateInput](#stockcountcreateinput-data-type) | Initialization data. |

**Example:**

```graphql
mutation {
  CreateStockCount(input: {
    label: "SC-2026-001",
    location: { id: 100001 }
  }) {
    id
    label
    status
  }
}
```

### `UpdateStockCount`

Updates an existing stock count.

**Parameters:**

| Parameter | Type                                                      | Description            |
| :-------- | :-------------------------------------------------------- | :--------------------- |
| `id`      | [ID!](/reference/data-types#id)                           | ID of the stock count. |
| `input`   | [StockCountUpdateInput](#stockcountupdateinput-data-type) | Updated data.          |

### `StockCountScanBarcode`

Adds a line item or increments its quantity by scanning a barcode.

**Parameters:**

| Parameter | Type                                    | Description            |
| :-------- | :-------------------------------------- | :--------------------- |
| `id`      | [ID!](/reference/data-types#id)         | ID of the stock count. |
| `barcode` | [String!](/reference/data-types#string) | The scanned barcode.   |

### `StockCountSetQuantity`

Sets the counted quantity of a line item within a stock count.

**Parameters:**

| Parameter  | Type                                 | Description                      |
| :--------- | :----------------------------------- | :------------------------------- |
| `id`       | [ID!](/reference/data-types#id)      | ID of the stock count line item. |
| `quantity` | [Float](/reference/data-types#float) | The new quantity.                |

### `GenerateStockCountNumber`

Generates the next available stock count label.

```graphql
mutation {
  GenerateStockCountNumber
}
```

<br/>

***

# Input data types

## StockCountCreateInput data type

| label <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------- |
| Label of the stock count                                                                      |

| dated\_at <span style={{ fontWeight: "normal" }}>- [Date](/reference/data-types#date) </span> |
| :-------------------------------------------------------------------------------------------- |
| Date of the stock count                                                                       |

| location <span style={{ fontWeight: "normal" }}>- [LocationInput](/reference/location-mutations#locationinput-data-type) </span> |
| :------------------------------------------------------------------------------------------------------------------------------- |
| Location to count (required)                                                                                                     |

| notes <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------- |
| Notes attached to the stock count                                                             |

| bin\_location\_filter <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :------------------------------------------------------------------------------------------------------------ |
| Optional filter on bin locations during count                                                                 |

## StockCountUpdateInput data type

| label <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------- |
| Label of the stock count                                                                      |

| dated\_at <span style={{ fontWeight: "normal" }}>- [Date](/reference/data-types#date) </span> |
| :-------------------------------------------------------------------------------------------- |
| Date of the stock count                                                                       |

| notes <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------- |
| Notes attached to the stock count                                                             |

| status <span style={{ fontWeight: "normal" }}>- [StockCountStatus](#stockcountstatus-enum) </span> |
| :------------------------------------------------------------------------------------------------- |
| Status of the stock count                                                                          |

<br/>

***

# Enums

## StockCountStatus enum

| Value                      | Description                        |
| :------------------------- | :--------------------------------- |
| `in_progress`              | Count is in progress.              |
| `stock_update_in_progress` | Stock is being updated.            |
| `completed`                | Count completed and stock updated. |
| `cancelled`                | Document voided.                   |