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

# Mutations

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

## CreateProduct

Create a product

Note: This mutation can be used only for companies that can create products.

### Parameters

| input <span style={{ fontWeight: "normal" }}>- [ProductInput](/reference/product-mutations#productinput-data-type)  </span> |
| :-------------------------------------------------------------------------------------------------------------------------- |
| Data of the product                                                                                                         |

### Example

```graphql
mutation CreateProduct($input: ProductInput!) {
  CreateProduct(input: $input) {
    id
    label
    description
    active
    suppliers {
      paginatorInfo {
        total
      }
      data {
        id
        label
      }
    }
    variants {
      paginatorInfo {
        total
        count
        currentPage
        perPage
      }
      data {
        id
        sku
        type
        label
        barcode
        initial_cost
        purchase_price_amount
        purchase_price_currency
        weight_amount
        weight_unit
        track_inventory
        on_hand
        available
        incoming
        reserved
        active
        product {
          id
          suppliers {
            data {
              id
              label
            }
          }
        }
        attribute1 {
          id
          label
        }
        attribute2 {
          id
          label
        }
        attribute3 {
          id
          label
        }
        suppliers {
          id
          supplier_sku
          supplier {
            id
            label
          }
        }
        components {
          component {
            label
            product {
              id
            }
          }
        }
      }
    }
    option1 {
      id
      label
    }
    option2 {
      id
      label
    }
    option3 {
      id
      label
    }
  }
}
```

```json Variables (JSON)
{
  "input": {
    "label": "Bicycle for kids",
    "active": true,
    "description": "<p>Bicycle for kids</p>",
    "suppliers": {
      "data": [
        {
          "id": 100005
        },
        {
          "id": 100003
        }
      ]
    },
    "variants": {
      "data": [
        {
          "sku": "B127621-1",
          "type": "normal",
          "barcode": "122657816782",
          "weight_amount": null,
          "weight_unit": "kg",
          "track_inventory": true,
          "initial_cost": null,
          "purchase_price_amount": null,
          "purchase_price_currency": "EUR",
          "components": [],
          "initial_location": {
            "id": 100000
          },
          "label": "Red - S",
          "attribute1": {
            "id": 100000
          },
          "attribute2": {
            "id": 100003
          },
          "suppliers": [
            {
              "id": 100003
            },
            {
              "id": 100005
            }
          ]
        },
        {
          "sku": "B127621-2",
          "type": "normal",
          "barcode": "122657816782",
          "weight_amount": null,
          "weight_unit": "kg",
          "track_inventory": true,
          "initial_cost": null,
          "purchase_price_amount": null,
          "purchase_price_currency": "EUR",
          "components": [],
          "initial_location": {
            "id": 100000
          },
          "label": "Blue - S",
          "attribute1": {
            "id": 100002
          },
          "attribute2": {
            "id": 100003
          },
          "suppliers": [
            {
              "id": 100003
            },
            {
              "id": 100005
            }
          ]
        },
        {
          "sku": "B127621-3",
          "type": "normal",
          "barcode": "122657816782",
          "weight_amount": null,
          "weight_unit": "kg",
          "track_inventory": true,
          "initial_cost": null,
          "purchase_price_amount": null,
          "purchase_price_currency": "EUR",
          "components": [],
          "initial_location": {
            "id": 100000
          },
          "label": "Red - M",
          "attribute1": {
            "id": 100000
          },
          "attribute2": {
            "id": 100005
          },
          "suppliers": [
            {
              "id": 100003
            },
            {
              "id": 100005
            }
          ]
        },
        {
          "sku": "B127621-4",
          "type": "normal",
          "barcode": "122657816782",
          "weight_amount": null,
          "weight_unit": "kg",
          "track_inventory": true,
          "initial_cost": null,
          "purchase_price_amount": null,
          "purchase_price_currency": "EUR",
          "components": [],
          "initial_location": {
            "id": 100000
          },
          "label": "Blue - M",
          "attribute1": {
            "id": 100002
          },
          "attribute2": {
            "id": 100005
          },
          "suppliers": [
            {
              "id": 100003
            },
            {
              "id": 100005
            }
          ]
        }
      ]
    },
    "option1": {
      "id": 100000,
      "label": "Color"
    },
    "option2": {
      "id": 100001,
      "label": "Size"
    }
  }
}
```

### Returned data

```json
{
  "data": {
    "CreateProduct": {
      "id": 100315,
      "label": "Bicycle for kids",
      "description": "<p>Bicycle for kids</p>",
      "active": true,
      "suppliers": {
        "paginatorInfo": {
          "total": 2
        },
        "data": [
          {
            "id": 100005,
            "label": "deleniti"
          },
          {
            "id": 100003,
            "label": "dolor"
          }
        ]
      },
      "variants": {
        "paginatorInfo": {
          "total": 4,
          "count": 4,
          "currentPage": 1,
          "perPage": 50
        },
        "data": [
          {
            "id": 100363,
            "sku": "B127621-1",
            "type": "normal",
            "label": "Bicycle for kids - Red - S",
            "barcode": "122657816782",
            "initial_cost": null,
            "purchase_price_amount": null,
            "purchase_price_currency": null,
            "weight_amount": null,
            "weight_unit": "kg",
            "track_inventory": true,
            "on_hand": null,
            "available": null,
            "incoming": null,
            "reserved": null,
            "active": true,
            "product": {
              "id": 100315,
              "suppliers": {
                "data": [
                  {
                    "id": 100005,
                    "label": "deleniti"
                  },
                  {
                    "id": 100003,
                    "label": "dolor"
                  }
                ]
              }
            },
            "attribute1": {
              "id": 100000,
              "label": "Red"
            },
            "attribute2": {
              "id": 100003,
              "label": "S"
            },
            "attribute3": null,
            "suppliers": [
              {
                "id": 100003,
                "supplier_sku": "DO8877",
                "supplier": null
              },
              {
                "id": 100005,
                "supplier_sku": "DE1288912",
                "supplier": null
              }
            ],
            "components": []
          },
          {
            "id": 100364,
            "sku": "B127621-2",
            "type": "normal",
            "label": "Bicycle for kids - Blue - S",
            "barcode": "122657816782",
            "initial_cost": null,
            "purchase_price_amount": null,
            "purchase_price_currency": null,
            "weight_amount": null,
            "weight_unit": "kg",
            "track_inventory": true,
            "on_hand": null,
            "available": null,
            "incoming": null,
            "reserved": null,
            "active": true,
            "product": {
              "id": 100315,
              "suppliers": {
                "data": [
                  {
                    "id": 100005,
                    "label": "deleniti"
                  },
                  {
                    "id": 100003,
                    "label": "dolor"
                  }
                ]
              }
            },
            "attribute1": {
              "id": 100002,
              "label": "Blue"
            },
            "attribute2": {
              "id": 100003,
              "label": "S"
            },
            "attribute3": null,
            "suppliers": [
              {
                "id": 100003,
                "supplier_sku": "DO8877",
                "supplier": null
              },
              {
                "id": 100005,
                "supplier_sku": "DE1288912",
                "supplier": null
              }
            ],
            "components": []
          },
          {
            "id": 100365,
            "sku": "B127621-3",
            "type": "normal",
            "label": "Bicycle for kids - Red - M",
            "barcode": "122657816782",
            "initial_cost": null,
            "purchase_price_amount": null,
            "purchase_price_currency": null,
            "weight_amount": null,
            "weight_unit": "kg",
            "track_inventory": true,
            "on_hand": null,
            "available": null,
            "incoming": null,
            "reserved": null,
            "active": true,
            "product": {
              "id": 100315,
              "suppliers": {
                "data": [
                  {
                    "id": 100005,
                    "label": "deleniti"
                  },
                  {
                    "id": 100003,
                    "label": "dolor"
                  }
                ]
              }
            },
            "attribute1": {
              "id": 100000,
              "label": "Red"
            },
            "attribute2": {
              "id": 100005,
              "label": "M"
            },
            "attribute3": null,
            "suppliers": [
              {
                "id": 100003,
                "supplier_sku": "DO8877",
                "supplier": null
              },
              {
                "id": 100005,
                "supplier_sku": "DE1288912",
                "supplier": null
              }
            ],
            "components": []
          },
          {
            "id": 100366,
            "sku": "B127621-4",
            "type": "normal",
            "label": "Bicycle for kids - Blue - M",
            "barcode": "122657816782",
            "initial_cost": null,
            "purchase_price_amount": null,
            "purchase_price_currency": null,
            "weight_amount": null,
            "weight_unit": "kg",
            "track_inventory": true,
            "on_hand": null,
            "available": null,
            "incoming": null,
            "reserved": null,
            "active": true,
            "product": {
              "id": 100315,
              "suppliers": {
                "data": [
                  {
                    "id": 100005,
                    "label": "deleniti"
                  },
                  {
                    "id": 100003,
                    "label": "dolor"
                  }
                ]
              }
            },
            "attribute1": {
              "id": 100002,
              "label": "Blue"
            },
            "attribute2": {
              "id": 100005,
              "label": "M"
            },
            "attribute3": null,
            "suppliers": [
              {
                "id": 100003,
                "supplier_sku": "DO8877",
                "supplier": null
              },
              {
                "id": 100005,
                "supplier_sku": "DE1288912",
                "supplier": null
              }
            ],
            "components": []
          }
        ]
      },
      "option1": {
        "id": 100000,
        "label": "Color"
      },
      "option2": {
        "id": 100001,
        "label": "Size"
      },
      "option3": null
    }
  }
}
```

## UpdateProduct

Update a product

### Parameters

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id)  </span> |
| :---------------------------------------------------------------------------------- |
| Id of the product                                                                   |

| input <span style={{ fontWeight: "normal" }}>- [ProductInput](/reference/product-mutations#productinput-data-type)  </span> |
| :-------------------------------------------------------------------------------------------------------------------------- |
| Data to update                                                                                                              |

### Example

```graphql
mutation UpdateProduct($id: ID!, $input: ProductInput!) {
  UpdateProduct(id: $id, input: $input) {
    id
    active
  }
}
```

```json Variables (JSON)
{
  "id": 1011232,
  "input": {
    "label": "My wonderful product",
    "description": "Description of my wonderful product"
  }
}
```

### Returned data

```json
{
  "data": {
    "UpdateProduct": {
      "id": 1011232,
      "active": true
    }
  }
}
```

## DeleteProduct

Delete a product

### Parameters

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id)  </span> |
| :---------------------------------------------------------------------------------- |
| Id of the product                                                                   |

### Example

```graphql
mutation DeleteProduct($id: ID!) {
  DeleteProduct(id: $id)
}
```

```json Variables (JSON)
{
  "id": 100009
}
```

### Returned data

```json
{
  "data": {
    "DeleteProduct": true
  }
}
```

## DisableProduct

Disable a product

### Parameters

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id)  </span> |
| :---------------------------------------------------------------------------------- |
| Id of the product                                                                   |

### Example

```graphql
mutation DisableProduct($id: ID!) {
  DisableProduct(id: $id) {
    id
    active
  }
}
```

```json
{
  "id": 100190
}
```

### Returned data

```json
{
  "data": {
    "DisableProduct": {
      "id": 100190,
      "active": false
    }
  }
}
```

## EnableProduct

Enable a disabled product

### Parameters

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id)  </span> |
| :---------------------------------------------------------------------------------- |
| Id of the product                                                                   |

### Example

```graphql
mutation EnableProduct($id: ID!) {
  EnableProduct(id: $id) {
    id
    active
  }
}
```

```json
{
  "id": 100190
}
```

### Returned data

```json
{
  "data": {
    "EnableProduct": {
      "id": 100190,
      "active": true
    }
  }
}
```

## ProductInput data type

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id) </span> |
| :--------------------------------------------------------------------------------- |
| Unique identifier of the product                                                   |

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

| options <span style={{ fontWeight: "normal" }}>- [OptionProductInput](/reference/product-mutations#optionproductinput-data-type) </span> |
| :--------------------------------------------------------------------------------------------------------------------------------------- |
| Options of the product (ex: color, size)                                                                                                 |

| description <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------------- |
| Description of the product                                                                          |

| active <span style={{ fontWeight: "normal" }}>- [Boolean](/reference/data-types#boolean) </span> |
| :----------------------------------------------------------------------------------------------- |
| If true, the product is active and can be used in documents                                      |

| option1 <span style={{ fontWeight: "normal" }}>- [OptionInput](/reference/option-mutations#optioninput-data-type) </span> |
| :------------------------------------------------------------------------------------------------------------------------ |
| First option of the product (ex: color)                                                                                   |

| option2 <span style={{ fontWeight: "normal" }}>- [OptionInput](/reference/option-mutations#optioninput-data-type) </span> |
| :------------------------------------------------------------------------------------------------------------------------ |
| Second option of the product (ex: size)                                                                                   |

| option3 <span style={{ fontWeight: "normal" }}>- [OptionInput](/reference/option-mutations#optioninput-data-type) </span> |
| :------------------------------------------------------------------------------------------------------------------------ |
| Third option of the product (ex: material)                                                                                |

| variants <span style={{ fontWeight: "normal" }}>- [VariantInput](/reference/variant-mutations#variantinput-data-type) </span> |
| :---------------------------------------------------------------------------------------------------------------------------- |
| List of the variants of the product based on options                                                                          |

| suppliers <span style={{ fontWeight: "normal" }}>- [SupplierInput](/reference/supplier-mutations#supplierinput-data-type) </span> |
| :-------------------------------------------------------------------------------------------------------------------------------- |
| Suppliers for this product                                                                                                        |

## ProductIDInput data type

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id) </span> |
| :--------------------------------------------------------------------------------- |
| Unique identifier of the product                                                   |

## ProductVariantInput data type

| data <span style={{ fontWeight: "normal" }}>- [Array of VariantInput](/reference/variant-mutations#variantinput-data-type)</span> |
| :-------------------------------------------------------------------------------------------------------------------------------- |
| List of the variants of the product based on options                                                                              |

## ProductSupplierInput data type

| data <span style={{ fontWeight: "normal" }}>- [Array of SupplierInput](/reference/supplier-mutations#supplierinput-data-type)</span> |
| :----------------------------------------------------------------------------------------------------------------------------------- |
| List of the suppliers of the product                                                                                                 |

## OptionProductInput data type

| id <span style={{ fontWeight: "normal" }}>- [ID](/reference/data-types#id) </span> |
| :--------------------------------------------------------------------------------- |
| Unique identifier of the option                                                    |

| option <span style={{ fontWeight: "normal" }}>- [OptionInput](/reference/option-mutations#optioninput-data-type)</span> |
| :---------------------------------------------------------------------------------------------------------------------- |
| Option linked to the product                                                                                            |

| weight <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int)</span> |
| :-------------------------------------------------------------------------------------- |
| Weight used to sort the options of the product                                          |