---
title: "Set per-variant inventory tracking flags and stock counts"
method: PATCH
path: "/products/{productId}/inventory"
tags: ["Products"]
---

# Set per-variant inventory tracking flags and stock counts

`PATCH /products/{productId}/inventory`

## Request

- Base URL: `https://api.replo.app/v1`
- URL: `https://api.replo.app/v1/products/{productId}/inventory`
- Auth: HTTP bearer

## Path parameters

- `productId` string, uuid, required

## Headers

- `Replo-Api-Version` '2026-10-29', required

## Request body

- object
  - `variants` object[], required
    - `trackInventory` boolean
    - `available` integer
    - `continueSellingWhenOutOfStock` boolean
    - `optionValues` object[], required
      - `optionName` string, required: Option name, e.g. "Color".
      - `value` string, required: Value within that option, e.g. "Navy".

## Response `200`

Set per-variant inventory tracking flags and stock counts

- ProductInventory
  - `object` 'product_inventory', required
  - `productId` string, uuid, required
  - `variants` object[], required
    - `optionValues` object[], required
      - `optionName` string, required: Option name, e.g. "Color".
      - `value` string, required: Value within that option, e.g. "Navy".
    - `trackInventory` boolean, required
    - `available` integer, nullable, required
    - `continueSellingWhenOutOfStock` boolean, required

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid Replo Public API token. Send an active key as `Authorization: Bearer replo_sk_...`; if it was revoked, create a new key in Replo Settings.
- `403`: You are not authorized to access this resource. Ask a workspace owner to perform this action or to grant the key's creator access.
- `404`: Not Found. The resource may not exist, this key may lack the required scope, or the key's creator may have lost access. Check the key's scopes in Replo Settings and the creator's project or workspace access; a workspace owner can grant access.
- `409`: The resource is in a conflicting state.
- `413`: File content exceeds the 10 MiB limit.
- `429`: Too many requests. Please retry after the time indicated by the Retry-After header.
- `500`: An internal error occurred.
- `503`: Service temporarily unavailable.

## Changes

- **2026-11-04** `53d194ba2067`: 9 info
  - added the optional property `error/issues` to the response with the `400` status
  - added the optional property `error/issues` to the response with the `401` status
  - added the optional property `error/issues` to the response with the `403` status
  - added the optional property `error/issues` to the response with the `404` status
  - …5 more
- **2026-10-29** `666c31ceb45c`: 1 breaking, 1 info
  - removed the enum value `2026-10-05` from the `header` request parameter `Replo-Api-Version`
  - added the new enum value `2026-10-29` to the `header` request parameter `Replo-Api-Version`
- **2026-10-08** `bed444e713a4`: 1 breaking, 1 info
  - removed the enum value `2026-09-08` from the `header` request parameter `Replo-Api-Version`
  - added the new enum value `2026-10-05` to the `header` request parameter `Replo-Api-Version`
- **2026-09-11** `95223e44e34e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/replo/apis/replo-public-api/changes/products/:productId/inventory/patch.md)

---

[API](https://skmtc.dev/replo/apis/replo-public-api.md) - [All operations](https://skmtc.dev/replo/apis/replo-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replo/apis/replo-public-api/revisions/53d194ba2067?raw)
