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

# Upsert Inventory

> This endpoint allows you to update inventory information for specific products in a store. You can modify quantity, status, price, and location for existing products using their external_id.

This endpoint updates inventory details for products that already exist in your store. Use this to adjust stock levels, prices, product status, and storage locations.

<Warning>
  This endpoint only updates existing products. To add new products, use the Upsert Products endpoints.
</Warning>

### Body

<ParamField body="inventory_updates" type="array" required>
  An array of inventory update objects

  <Expandable title="Inventory Update Object Structure">
    <ParamField name="external_id" type="string" required>
      The external ID of the product to update. Example: "22000017901"
    </ParamField>

    <ParamField name="quantity" type="number" required>
      Updated quantity for the product. Example: 50
    </ParamField>

    <ParamField name="status" type="string" required>
      Product status. Values: "active" or "inactive"
    </ParamField>

    <ParamField name="price" type="number" required>
      Updated price for the product. Example: 99.8
    </ParamField>

    <ParamField name="location" type="string" required>
      Updated location for the product. Example: "WAREHOUSE-CDT"
    </ParamField>
  </Expandable>
</ParamField>

### Request Example

```json theme={null}
[
  {
    "external_id": "22000017901",
    "quantity": 50,
    "status": "inactive",
    "price": 99.8,
    "location": "WAREHOUSE-CDT"
  },
  {
    "external_id": "28400324434",
    "quantity": 50,
    "status": "active",
    "price": 9,
    "location": "WAREHOUSE-CDT"
  },
  {
    "external_id": "22000017895",
    "quantity": 1,
    "status": "active",
    "price": 19.12,
    "location": "Jayy-B"
  }
]
```

### Response

<Note>
  This endpoint processes the inventory updates asynchronously. No immediate response body is provided.
</Note>

The system will process your inventory updates in the background. Changes will be reflected in your store's inventory once processing is complete.

<Tip>
  Setting quantity to 0 will mark the product as out of stock. Use "inactive" status to temporarily disable a product from being sold.
</Tip>
