> ## Documentation Index
> Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Adjust Inventory

> Adjust inventory levels by a relative amount

# Adjust Inventory

Adjusts the inventory level for an inventory item by a relative amount. Use a
positive number to increase inventory and a negative number to decrease it.
The resulting available quantity is clamped at `0` (it never goes negative).

The inventory item is matched as a variant first, then as a product (for
variant-less products), so `inventory_item_id` is a variant ID or a product
ID.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/adjust.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "inventory_item_id": "var_xyz789",
      "available_adjustment": -5
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/inventory_levels/adjust.json', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      inventory_item_id: 'var_xyz789',
      available_adjustment: -5
    })
  });
  ```
</CodeGroup>

## Body Parameters

<ParamField body="inventory_item_id" type="string" required>
  The inventory item ID to adjust (variant ID, or product ID for variant-less
  products)
</ParamField>

<ParamField body="available_adjustment" type="number" required>
  The amount to adjust by (positive to increase, negative to decrease)
</ParamField>

## Response

Returns the standard response envelope. The `data` object contains an
`inventory_level` object with the new available quantity.

<ResponseField name="data.inventory_level" type="object">
  The updated inventory level

  <Expandable title="Inventory Level Object">
    <ResponseField name="inventory_item_id" type="string">
      Inventory item ID
    </ResponseField>

    <ResponseField name="available" type="integer">
      New available quantity after adjustment (never below `0`)
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Response

```json theme={null}
{
  "status": 200,
  "state": "success",
  "message": null,
  "data": {
    "inventory_level": {
      "inventory_item_id": "var_xyz789",
      "available": 40
    }
  },
  "count": null,
  "pagination": null
}
```

## Error Response

When the inventory item cannot be found:

```json theme={null}
{
  "status": 404,
  "state": "error",
  "message": "Inventory item not found",
  "data": null
}
```

When required fields are missing:

```json theme={null}
{
  "status": 400,
  "state": "error",
  "message": "inventory_item_id and available_adjustment are required",
  "data": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.