API Documentation: Stock Adjustment
3. Stock Adjustment (list) — `/api/stock-adjustment`
This base path exposes a single read-only endpoint for listing stock adjustment information (not for creating adjustments; creation is under /api/stock/adjustment POST).
3.1 GET `/api/stock-adjustment`
Purpose: List stock adjustments for a given store and date range. Returns adjustments grouped by adjustment record, with product details (sku, quantity, type, unit_price). Used for reporting and auditing stock changes.
Query parameters:
What to expect:
- Success: { success: true, status: 200, data } — data is an array of grouped adjustments, each with date, id, message, store (name), and product array (sku, quantity, type, unit_price).
- 404: { success: true, status: 404, message: "No data found", data: [] }.
- 400: Validation failed (error object).
- 401: Missing or invalid token.
- 403: Store not allowed.
- 429: Rate limit exceeded.
- 500: Internal server error.
Summary table
Error responses (all three APIs)
- 401: Missing or invalid token — send Authorization: Bearer <token>.
- 403: Brand ID or store ID not allowed for the authenticated user.
- 404: User not found (apiAuth) or no data (e.g. stock-adjustment list).
- 429: Rate limit exceeded (invoice list, stock-adjustment list).
- 500: Internal server error.