u
This commit is contained in:
@@ -13,7 +13,7 @@ Overview of all 136 API endpoints across all modules.
|
||||
| Method | Route | Params | Return Type | Summary |
|
||||
|:---|:---|:---|:---|:---|
|
||||
| `POST` | `/article` | `body: { categoryId, name, track_stock? }` | `201 { article: { id, categoryId, name, sku, track_stock } }` | Create article in category |
|
||||
| `DELETE` | `/article/{sku}` | `sku:string` | `204 void` | Delete article by SKU |
|
||||
| `DELETE` | `/article/{sku}` | `sku:string, query: cascade?:boolean` | `204 void` | Delete article by SKU |
|
||||
| `GET` | `/article/{sku}` | `sku:string` | `200 { article: { id, sku, name, slug, track_stock, unitamount, weight, unit, brand, categoryIds: integer[], photos: object[], eans: string[], prices: object[], suppliers: object[] } }` | Get article by SKU |
|
||||
| `PATCH` | `/article/{sku}` | `sku:string, body: { name?, unitamount?, unitSi?, track_stock? }` | `200 { article: { id, sku, name, slug, track_stock, unitamount, weight, unit, brand, categoryIds: integer[], photos: object[], eans: string[], prices: object[], suppliers: object[] } }` | Update article by SKU |
|
||||
| `GET` | `/article/{sku}/articlelist` | `sku:string` | `200 { items: { id, articleId, sku, name, count, sort }[] }` | Get Stückliste (bundle items) for an article |
|
||||
|
||||
@@ -17,7 +17,7 @@ Unlinks the child from the father (or deletes if deleteArticle query/body is tru
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `deleteArticle` | no | boolean | If true, permanently deletes the child article instead of just unlinking |
|
||||
| `deleteArticle` | no | boolean | If true, permanently deletes the child article (and cascades its entire descendant subtree if it is a father) instead of just unlinking |
|
||||
|
||||
## Response `200`
|
||||
|
||||
|
||||
@@ -15,6 +15,12 @@ Auth like GET by SKU.
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | Article SKU |
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `cascade` | no | boolean | If true, recursively deletes all descendant child articles in the subtree |
|
||||
|
||||
## Signals
|
||||
|
||||
On success, emits SSE signal: `articles` (see [`GET /events`](../events.md)).
|
||||
|
||||
@@ -75,6 +75,7 @@ Updated article detail
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Article not found — `{"error":"…"}` |
|
||||
| 409 | EAN already in use — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ Updated article detail
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid prices or POS customer group required — `{"error":"…"}` |
|
||||
| 400 | Invalid prices, POS customer group required, or father article cannot have prices — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Article not found — `{"error":"…"}` |
|
||||
|
||||
@@ -77,7 +77,7 @@ Stock adjusted successfully
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Missing fields, invalid amount, or no company selected — `{"error":"…"}` |
|
||||
| 400 | Missing fields, invalid amount, father article cannot have stock, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Article or warehouse not found — `{"error":"…"}` |
|
||||
|
||||
Reference in New Issue
Block a user