All endpoints require an Authorization: Bearer <token> header.
Endpoint
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).
Unique identifier for the stock movement (UUID).
UUID of the product this movement applies to.
Direction of the movement. Either "IN" (stock received) or "OUT" (stock dispatched).
Human-readable explanation for the movement. null if not provided.
UUID of the tenant this movement belongs to.
ISO 8601 timestamp of when the movement was recorded.
ISO 8601 timestamp of when the movement was last updated.
The product linked to this movement.
Unique identifier for the product (UUID).
Display name of the product.
Stock keeping unit identifier.
Unit price of the product.
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
}
}
]