Files
dashback/docs/api/routes/article/set-prices.md
2026-11-01 05:37:15 +01:00

69 lines
1.9 KiB
Markdown

# `PUT /article/{sku}/prices`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Replace POS prices by SKU (net > gross)
Replace-all prices for the company POS customer group.
`net` takes precedence over `gross`.
`taxRate` specifies the tax rate percentage (e.g. 19 for 19%), not monetary tax.
When `gross` is provided, net price is computed as `gross / (1 + taxRate / 100)`.
Prices are strictly scoped to the company's designated POS customer group (customergroupId returned on GET).
Empty `prices` clears all POS prices. Returns the same shape as GET by SKU.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `sku` | yes | string | |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `prices` | yes | object[] | |
| `prices[].net` | no | number | Net price (excl. VAT). Either `net` or `gross` is required. |
| `prices[].gross` | no | number | Gross price (incl. VAT). Net is computed as `gross / (1 + taxRate / 100)`. |
| `prices[].taxRate` | no | number | Tax rate percentage (e.g. 19 for 19%, 7 for 7%, 0 for 0%). |
| `prices[].minmultiplier` | no | number | Defaults to 1; must be unique per request. |
```json
{
"prices": [
{
"net": 10.5,
"taxRate": 19
},
{
"gross": 11.9,
"taxRate": 19,
"minmultiplier": 10
}
]
}
```
## Signals
On success, emits SSE signal: `article-<sku>` (see [`GET /events`](../events.md)).
## Response `204`
Updated
_No content_
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid prices, POS customer group required, or parent article cannot have prices — `{"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`._