Skip to main content
All endpoints require an Authorization: Bearer <token> header.

Endpoint

GET /api/inventory

Request

No request parameters.

Response

Returns an array of inventory objects. Each record includes the associated product via a JOIN (include: { product: true } in Prisma).
Inventory records include the associated product details fetched via a Prisma include: &#123; product: true &#125; JOIN. You do not need to make a separate request to look up product information.
id
string
required
Unique identifier for the inventory record (UUID).
productId
string
required
UUID of the product this inventory record tracks.
quantity
number
required
Current stock quantity on hand.
minStock
number
required
Minimum stock threshold. Default is 10.
maxStock
number
required
Maximum stock threshold. Default is 1000.
tenantId
string
required
UUID of the tenant this inventory record belongs to.
createdAt
string
required
ISO 8601 timestamp of when the record was created.
updatedAt
string
required
ISO 8601 timestamp of when the record was last updated.
product
object
required
The product linked to this inventory record.

Examples

curl --request GET \
  --url http://localhost:5000/api/inventory \
  --header 'Authorization: Bearer <token>'

Example response

[
  {
    "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "productId": "d4e5f6a7-b8c9-0123-defa-456789012345",
    "quantity": 142,
    "minStock": 20,
    "maxStock": 500,
    "tenantId": "f0e1d2c3-b4a5-6789-cdef-012345678901",
    "createdAt": "2024-01-10T09:00:00.000Z",
    "updatedAt": "2024-03-18T16:30:00.000Z",
    "product": {
      "id": "d4e5f6a7-b8c9-0123-defa-456789012345",
      "name": "Widget Pro 3000",
      "sku": "WGT-3000",
      "price": 49.99
    }
  }
]

Build docs developers (and LLMs) love