u
This commit is contained in:
46
docs/api/routes/article/set-brand.md
Normal file
46
docs/api/routes/article/set-brand.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# `PUT /article/{sku}/brand`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Set or clear article brand by SKU
|
||||
|
||||
Sets the article's `brandId` (must belong to the article's company).
|
||||
Pass `null` to clear the brand. Returns the same shape as GET by SKU.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"brandId": 3
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated article detail
|
||||
|
||||
```json
|
||||
{
|
||||
"article": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Validation error — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Article or brand not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
50
docs/api/routes/article/set-categories.md
Normal file
50
docs/api/routes/article/set-categories.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# `PUT /article/{sku}/categories`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Replace article categories by SKU
|
||||
|
||||
Replace-all the article's category list. Each category must belong to
|
||||
the article's company; ids must be unique. Empty array removes the
|
||||
article from all categories. Returns the same shape as GET by SKU.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"categoryIds": [
|
||||
4,
|
||||
7
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated article detail
|
||||
|
||||
```json
|
||||
{
|
||||
"article": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid categoryIds — `{"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`._
|
||||
48
docs/api/routes/article/set-eans.md
Normal file
48
docs/api/routes/article/set-eans.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# `PUT /article/{sku}/eans`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Replace article EANs by SKU
|
||||
|
||||
Replace-all EANs for the article. EANs must be non-empty unique strings;
|
||||
empty array clears all EANs. Returns the same shape as GET by SKU.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"eans": [
|
||||
"4001234567890"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated article detail
|
||||
|
||||
```json
|
||||
{
|
||||
"article": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid eans — `{"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`._
|
||||
46
docs/api/routes/article/set-weight.md
Normal file
46
docs/api/routes/article/set-weight.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# `PUT /article/{sku}/weight`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Set article weight by SKU
|
||||
|
||||
Sets the article's `weight`. Must be finite and `>= 0`.
|
||||
Returns the same shape as GET by SKU.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `sku` | yes | string | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"weight": 1.5
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Updated article detail
|
||||
|
||||
```json
|
||||
{
|
||||
"article": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid weight — `{"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`._
|
||||
35
docs/api/routes/brand/delete.md
Normal file
35
docs/api/routes/brand/delete.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# `DELETE /brand/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete brand
|
||||
|
||||
Deletes the brand for the selected company. Fails with `Brand in use`
|
||||
if any article still references it.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Brand not found — `{"error":"…"}` |
|
||||
| 409 | Brand in use — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
30
docs/api/routes/brand/list.md
Normal file
30
docs/api/routes/brand/list.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# `GET /brand`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List brands
|
||||
|
||||
Lists brands for the authenticated user's selected company, sorted by name.
|
||||
|
||||
## Response `200`
|
||||
|
||||
Brand list
|
||||
|
||||
```json
|
||||
{
|
||||
"brands": []
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | 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`._
|
||||
40
docs/api/routes/brand/upsert.md
Normal file
40
docs/api/routes/brand/upsert.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# `PUT /brand`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Upsert brand
|
||||
|
||||
Insert or update brand by `name` for the selected company. `gsprpinfo` optional.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Acme",
|
||||
"gsprpinfo": "Acme GmbH"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Upserted brand
|
||||
|
||||
```json
|
||||
{
|
||||
"brand": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid brand 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`._
|
||||
44
docs/api/routes/category/rename.md
Normal file
44
docs/api/routes/category/rename.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# `PATCH /category/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Rename category
|
||||
|
||||
Renames a category the user is authorized for (updates name and re-slugifies in the company default language).
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Category id |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Renamed category"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Renamed category
|
||||
|
||||
```json
|
||||
{
|
||||
"category": { … }
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Validation error (name required) — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Category not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user