This commit is contained in:
seb
2026-09-27 21:01:20 +02:00
parent bab15b0978
commit 68b793c9ba
17 changed files with 1695 additions and 23 deletions

View File

@@ -0,0 +1,49 @@
# `PUT /article/{sku}/track_stock`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Set article track_stock flag by SKU
Enables or disables inventory stock tracking for this article.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `sku` | yes | string | Article SKU |
## Body (JSON)
```json
{
"track_stock": true
}
```
## Signals
On success, emits SSE signal: `article-<sku>` (see [`GET /events`](../events.md)).
## Response `200`
Updated article detail
```json
{
"article": {}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid track_stock — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Article not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -29,7 +29,8 @@ Created
"id": 1,
"parentId": 1,
"name": "…",
"sku": "…"
"sku": "…",
"track_stock": true
}
}
```