POST /api/public/v1/inventory/stockPage

Changed on

One page of the Stock table: the location's products as stock reads them, narrowed by name (query), kind, unit, linked supplier, stock state and days without a movement (idleDays, never moved included), ordered by one column with a missing key last, and the cursor the next page starts from (null on the last), with, on the first page only, how many products the location lists and how many the filters leave, and, when it lists none and leaves archived ones out, whether the organization has archived products (hasArchived). On hand sorts only within one unit; value sorts only with inventoryCost:read, FORBIDDEN otherwise. BAD_REQUEST for a cursor no page under this sort returned. 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 URL
    https://app.fortuneos.ai
  • Auth
    none declared

Request body

object required
locationId, string required
includeArchived, boolean
storageId, string
query, string
kind, 'purchased' | 'prepared'
unit, 'g' | 'ml' | 'pcs'
supplierId, string
categoryId, string nullable
state, 'belowZero' | 'zero' | 'unknownCost' | 'low' | 'undated' | 'needsDate'
idleDays, integer
sort, 'name' | 'onHand' | 'value' | 'suppliers' | 'lastChange'
direction, 'asc' | 'desc'
cursor, string

Response

OK

object required
rows, object[] required
nextCursor, string nullable required
listed, number nullable required
total, number nullable required
low, number nullable required
hasArchived, boolean nullable required

Changes