Expose PUT /customergroup/order for exact-set sort updates, keep create/update name-only, and mark POS/Lieferanten as non-editable in list responses.
46 lines
849 B
Markdown
46 lines
849 B
Markdown
# `POST /customergroup`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Create customer group
|
|
|
|
Creates a customer group for the selected company.
|
|
Appends with the next `sort` index. Reserved names `POS` and `Lieferanten`
|
|
are not allowed (`Name not allowed`).
|
|
|
|
|
|
## Body (JSON)
|
|
|
|
```json
|
|
{
|
|
"name": "Kunden"
|
|
}
|
|
```
|
|
|
|
## Response `201`
|
|
|
|
Created customer group
|
|
|
|
```json
|
|
{
|
|
"customergroup": {
|
|
"id": 1,
|
|
"name": "…",
|
|
"sort": 1
|
|
}
|
|
}
|
|
```
|
|
|
|
## Errors
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 400 | Name required, name not allowed, or no company selected — `{"error":"…"}` |
|
|
| 401 | Unauthorized — `{"error":"…"}` |
|
|
| 403 | Not authorized — `{"error":"…"}` |
|
|
| 404 | Company not found — `{"error":"…"}` |
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|