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

Endpoint

GET /api/stock-movements

Request

No request parameters.

Response

Returns an array of stock movement objects including the linked product.
Movements are always returned newest-first (orderBy: createdAt desc).
id
string
required
Unique identifier for the stock movement (UUID).
productId
string
required
UUID of the product this movement applies to.
type
string
required
Direction of the movement. Either "IN" (stock received) or "OUT" (stock dispatched).
quantity
number
required
Number of units moved.
reason
string
Human-readable explanation for the movement. null if not provided.
tenantId
string
required
UUID of the tenant this movement belongs to.
createdAt
string
required
ISO 8601 timestamp of when the movement was recorded.
updatedAt
string
required
ISO 8601 timestamp of when the movement was last updated.
product
object
required
The product linked to this movement.

Examples

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

Example response

[
  {
    "id": "e5f6a7b8-c9d0-1234-efab-567890123456",
    "productId": "d4e5f6a7-b8c9-0123-defa-456789012345",
    "type": "IN",
    "quantity": 50,
    "reason": "received from supplier",
    "tenantId": "f0e1d2c3-b4a5-6789-cdef-012345678901",
    "createdAt": "2024-03-18T14:00:00.000Z",
    "updatedAt": "2024-03-18T14:00:00.000Z",
    "product": {
      "id": "d4e5f6a7-b8c9-0123-defa-456789012345",
      "name": "Widget Pro 3000",
      "sku": "WGT-3000",
      "price": 49.99
    }
  },
  {
    "id": "f6a7b8c9-d0e1-2345-fabc-678901234567",
    "productId": "d4e5f6a7-b8c9-0123-defa-456789012345",
    "type": "OUT",
    "quantity": 5,
    "reason": "sold to customer",
    "tenantId": "f0e1d2c3-b4a5-6789-cdef-012345678901",
    "createdAt": "2024-03-15T10:00:00.000Z",
    "updatedAt": "2024-03-15T10:00: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