POST /api/public/v1/inventory/addStock
Changed onAdds 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
- Base URLhttps://app.fortuneos.ai
- Authnone declared
Request body
Changes
- info
added the new optional request property
storageId
- info
- breaking
the
lines/itemsrequest property type changed fromobjectto no type - warning
removed the request property
lines/items/expiresOn
6 more changes in this revision
- breaking