---
title: "POST /api/public/v1/inventory/addStock"
method: POST
path: "/api/public/v1/inventory/addStock"
---

# POST /api/public/v1/inventory/addStock

`POST /api/public/v1/inventory/addStock`

## Request

- Base URL: `https://app.fortuneos.ai`
- URL: `https://app.fortuneos.ai/api/public/v1/inventory/addStock`
- Auth: none declared

Adds stock in a storage of the location, `storageId` or the location's default when left out (NOT_FOUND for one the location does not hold or has archived). A bought line is one new batch with an optional supplier (linked to the product), expiry and line value in minor units excluding VAT. A prep line, one with `ingredients`, makes a prepared product: it removes what each ingredient actually gave, earliest expiry first and below zero when short, and adds its actual output as one batch with an optional expiry, at the value those removes took or at unknown cost when any part of an ingredient's cost is unknown; both sides are movements with the reason `prep`. Below-zero stock is filled first. All lines post together; a movement id repeated for the same line is a no-op. A priced line needs inventoryCost update (FORBIDDEN otherwise); NOT_FOUND as `stockNotFound` or `supplierNotFound` for a product or supplier the organization does not hold; CONFLICT as `movementReused` for a movement id reused for another line, `notPrepared` for a prep line of a product with no recipe and `productArchived` for a line making or taking an archived product. Refused with FORBIDDEN as `inventoryDisabled` while the inventory flag is off. Refused with FORBIDDEN as `paywallLocked` when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

## Request body

- object
  - `locationId` string, required
  - `storageId` string
  - `lines` union[], required
    - union
      - object
        - `movementId` string, required
        - `stockItemId` string, required
        - `quantity` string, required
        - `expiresOn` string, date, nullable, required
        - `ingredients` object[], required
          - `stockItemId` string, required
          - `quantity` string, required
      - object
        - `movementId` string, required
        - `stockItemId` string, required
        - `quantity` string, required
        - `expiresOn` string, date, nullable, required
        - `value` string, nullable, required
        - `supplierId` string, nullable, required

## Changes

- **2026-11-11** `8a57f722ed5a`: 1 info
  - added the new optional request property `storageId`
- **2026-11-05** `ac1f9439b4a7`: 1 breaking, 6 warning, 1 info
  - the `lines/items/` request property type changed from `object` to no type
  - removed the request property `lines/items/expiresOn`
  - removed the request property `lines/items/movementId`
  - removed the request property `lines/items/quantity`
  - …4 more
- **2026-11-03** `b07e1072d52d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fortis/apis/fortune-os-api/changes/api/public/v1/inventory/addStock/post.md)

---

[API](https://skmtc.dev/fortis/apis/fortune-os-api.md) - [All operations](https://skmtc.dev/fortis/apis/fortune-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fortis/apis/fortune-os-api/revisions/522f3cea550d?raw)
