> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# IncrementInventory

# Package: catalogV1

# Namespace: InventoryWriteApi

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/inventory/increment-inventory?apiView=SDK.md

## Permission Scopes:
Manage Products: SCOPE.DC-STORES.MANAGE-PRODUCTS

## Introduction

Adds a set number of items to inventory.

---

## REST API

### Schema

```
 Method: incrementInventory
 Description: Adds a set number of items to inventory.
 URL: https://www.wixapis.com/stores/v2/inventoryItems/increment
 Method: POST
 Method parameters:
   param name: incrementData | type: array<incrementData>    | validation: minItems 1, maxItems 300
              - ONE-OF: 
                 - name: inventoryId | type: string | description: Inventory item GUID.  | validation: maxLength 36
                 - name: productId | type: string | description: Product GUID.  | validation: maxLength 36
              - name: variantId | type: string | description: Variant GUID.  | validation: format GUID
              - name: incrementBy | type: integer | description: Number to increment inventory by.  | validation: minimum 1
 Return type: IncrementInventoryResponse
  EMPTY-OBJECT {}


```

### Examples

### IncrementInventory
```curl
~~~cURL
curl -X POST https://www.wixapis.com/stores/v2/inventoryItems/increment \
   -H 'Content-Type: application/json' \
   -H 'Authorization: <AUTH>' \
   --data-binary '
       {
         "incrementData": [
           {
             "productId": "f007074f-d7a8-a68b-e6c1-7d7c3de021ff",
             "variantId": "00000000-0000-0001-0005-9ccb19c4e6f0",
             "incrementBy": 2
           }
         ]
       }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.stores.inventory.incrementInventory(incrementData)
 Description: Adds a set number of items to inventory.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  incrementData
 Method parameters: 
   param name: incrementData | type: array<IncrementData>   | required: true | validation: minItems 1, maxItems 300
              - ONE-OF: 
                 - name: inventoryId | type: string | description: Inventory item GUID.  | validation: maxLength 36
                 - name: productId | type: string | description: Product GUID.  | validation: maxLength 36
              - name: variantId | type: string | description: Variant GUID.  | validation: format GUID
              - name: incrementBy | type: integer | description: Number to increment inventory by.  | validation: minimum 1
 Return type: PROMISE<IncrementInventoryResponse>
  EMPTY-OBJECT {}


```

### Examples

### Increment the inventory of a product's first variant
```javascript
/**************************************
 * Backend code - inventory.web.js/ts *
 **************************************/

import { Permissions, webMethod } from '@wix/web-methods';
import { inventory, products } from '@wix/stores';

export const incrementInventory = webMethod(Permissions.Anyone, (incrementData) => {
  return inventory.incrementInventory(incrementData);
});

export const getProductVariants = webMethod(Permissions.Anyone, (_id, options) => {
  return products.getProductVariants(_id, options);
});

/**************
 * Page code *
 **************/

import { incrementInventory, getProductVariants } from 'backend/inventory.web';

async function incrementHandler() {

  const productId = "3fb6a3c8-988b-8755-04bd-ks75ae0b18ea"
  let variants = await getProductVariants(productId);

  incrementInventory(
    [{
      variantId: variants[0]._id,
      productId: productId,
      incrementBy: 1
    }])
    .then(() => {
      console.log("Inventory incremented successfully")
    })
    .catch(error => {
      // Inventory increment failed
      console.error(error);
    })
}

```

### Increment inventory
Increase inventory quantity for a product variant

```javascript
import { inventory } from "@wix/stores";

const incrementData = [
  {
    productId: "c43d36c5-c35a-91ec-1c33-d28efc70d5a6",
    variantId: "00000000-0000-0000-0000-000000000000",
    incrementBy: 2
  }
];

async function incrementInventory() {
  const response = await inventory.incrementInventory(incrementData);
  return response;
}

const result = await inventory.incrementInventory(incrementData);



```

### incrementInventory (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { inventory } from '@wix/stores';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { inventory },
  // Include the auth strategy and host as relevant
});


async function incrementInventory(incrementData) {
  const response = await myWixClient.inventory.incrementInventory(incrementData);
};
```

---