---
title: "Batch Adjust Inventory for Cart Products"
method: PUT
path: "/cart/products/batch-adjust-inventory"
tags: ["cart", "Products"]
---

# Batch Adjust Inventory for Cart Products

`PUT /cart/products/batch-adjust-inventory`

Set the exact on-hand inventory for multiple cart products in a single call.
Each line specifies a product and the exact quantity to set; increase and
decrease adjustments are not supported here.

## Headers

- `x-trackstar-api-key` string, required
- `x-trackstar-access-token` string, required

## Request body

- union
  - object
    - `line_items` BatchAdjustCartInventoryLine[], required — Inventory adjustments. Each entry sets the exact on-hand quantity for one product.
      - `product_id` string, required — The ID of the product to adjust.
      - `quantity` integer, required — The quantity to adjust the inventory by if increasing or decreasing. If using exact, the quantity to set the inventory to.
      - `warehouse_id` string — ID of the warehouse to adjust inventory in.
  - object
    - `line_items` BatchAdjustCartInventoryLine[], required — Inventory adjustments. Each entry sets the exact on-hand quantity for one product.
      - `product_id` string, required — The ID of the product to adjust.
      - `quantity` integer, required — The quantity to adjust the inventory by if increasing or decreasing. If using exact, the quantity to set the inventory to.
      - `warehouse_id` string — ID of the warehouse to adjust inventory in.

## Response `200`

Successful response

- CartBatchAdjustInventoryProductResponse
  - `data` CartProductApiItemSchema[], required
    - `id` string, required — The unique ID of the product.
    - `created_date` string, date-time, required — The date the cart product was created.
    - `updated_date` string, date-time, required — The date the cart product was last updated.
    - `name` string, required — The name of the product.
    - `sku` string, nullable, required — The SKU of the product.
    - `gtin` string, nullable, required — The GTIN of the product.
    - `parent_product_id` string, required — If this is a variant, the ID of the parent product. If this is a parent product, this field should be the same as ID.
    - `is_kit` boolean, required
    - `active` boolean, required — Whether the product is active.
    - `image_url` string, nullable, required — The URL of the product's image.
    - `price` number, nullable, required — The price of the product if it is a variant. Not the source of truth for parent products.
    - `unit_cost` number, nullable, required — The unit cost of the product if it is a variant. Not the source of truth for parent products.
    - `inventory` integer, nullable, required — The inventory of the product if it is a variant. Not the source of truth for parent products.
    - `inventory_by_warehouse_id` object, required — Inventory broken down by warehouse.
    - `measurements` ProductMeasurements, required
      - `length` number, nullable, required
      - `width` number, nullable, required
      - `height` number, nullable, required
      - `unit` 'cm' | 'in', nullable, required — The unit of measurement for the size of the product.
      - `weight` number, nullable, required
      - `weight_unit` 'kg' | 'oz' | 'lb', nullable, required — The unit of measurement for the weight of the product.
    - `tags` string[], required — A list of tags associated with the product. Tags that are represented as key-value pairs in the underlying system will be represented as a single string formatted as `key:value`.
    - `categories` string[], required — A list of category names the product belongs to. For platforms with a hierarchical category tree, each level is a separate element with the leaf last (e.g. ["Apparel", "Shoes", "Running"]). For platforms with a single scalar product type, a single-element list.
    - `external_system_url` string, nullable, required — URL link to the cart product in the external system (WMS/Freight etc).
    - `trackstar_tags` unknown[], nullable, required — A list of custom tags associated with the resource. A tag can be either a string or a dictionary with one key-value pair.
      - unknown
    - `additional_fields` object, required — Integration-specific fields
    - `trackstar_created_date` string, date-time, required
    - `trackstar_updated_date` string, date-time, required
  - `unused_fields` string[], required — Unused fields

## Other responses

- `422` — Validation error

---

[API](https://skmtc.dev/trackstarhq/apis/trackstar-api.md) · [All operations](https://skmtc.dev/trackstarhq/apis/trackstar-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trackstarhq/trackstar-api/revisions/4bc5c6e1a8bf/schema)
