u
This commit is contained in:
67
docs/api/routes/article/supplier/update.md
Normal file
67
docs/api/routes/article/supplier/update.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# `PATCH /article/{sku}/supplier/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update article supplier assignment
|
||||
|
||||
Updates an existing article-supplier association (supplier SKU, packaging unit, stock, purchase price).
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | Article SKU |
|
||||
| `id` | yes | integer | articlesupplier assignment ID |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"sku": "MET-44910-B",
|
||||
"pu": 6,
|
||||
"stock": 95,
|
||||
"netPrice": 22.5
|
||||
}
|
||||
```
|
||||
|
||||
## Signals
|
||||
|
||||
On success, emits SSE signal: `article-<sku>` (see [`GET /events`](../events.md)).
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated supplier assignment
|
||||
|
||||
```json
|
||||
{
|
||||
"supplier": {
|
||||
"id": 1,
|
||||
"articleId": 1,
|
||||
"entityId": 1,
|
||||
"supplierName": "…",
|
||||
"sku": "…",
|
||||
"pu": 1,
|
||||
"stock": 1,
|
||||
"priceId": 1,
|
||||
"price": {
|
||||
"net": 1,
|
||||
"taxId": 1,
|
||||
"taxRate": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid pu, invalid stock, invalid price, invalid id, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Supplier assignment, article, or company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user