---
title: "Real-time inventory check (cart pre-checkout)"
method: POST
path: "/api/v1/storefront/inventory/check"
tags: ["storefront"]
---

# Real-time inventory check (cart pre-checkout)

`POST /api/v1/storefront/inventory/check`

## Request

- Base URL: `https://api.foundryims.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.foundryims.com/api/v1/storefront/inventory/check`
- Auth: HTTP bearer

Real-time inventory check used by storefront carts before checkout.

"available" means `onHand (net-of-reservations) >= qty`. The on-hand
number is `max(0, available + buildable - reserved)` — an assembly a
storefront can still have built counts as sellable
— the same effective-available number the admin UI shows and the
outbound sync layer pushes to other channels. Untracked variants
(`trackInventory = false`) are always available, with `onHand` set to
`Number.MAX_SAFE_INTEGER` so storefronts can render an "in stock"
badge without special-casing the sentinel.

No caching: cart-time inventory must reflect any race-window
reservations from concurrent orders.

## Request body

- CheckInventoryDto
  - `items` CheckInventoryItemDto[], required
    - `variantId` string, required: Foundry variant UUID
    - `qty` number, required: Requested quantity

## Response `200`

- InventoryCheckResponseDto
  - `items` InventoryCheckItemDto[], required
    - `variantId` string, required
    - `available` boolean, required
    - `onHand` number, required

---

[API](https://skmtc.dev/foundryims/apis/foundry-storefront-api.md) · [All operations](https://skmtc.dev/foundryims/apis/foundry-storefront-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foundryims/apis/foundry-storefront-api/revisions/c6b0410da596?raw)
