This commit is contained in:
seb
2026-10-01 10:19:16 +02:00
parent 956fadcc8d
commit 8a7500cb5a
11 changed files with 59 additions and 19 deletions

View File

@@ -23,11 +23,11 @@ Overview of all 136 API endpoints across all modules.
| `PUT` | `/article/{sku}/brand` | `sku:string, body: { brandId: integer }` | `200 { article: { id, sku, name, slug, track_stock, unitamount, weight, unit, brand, categoryIds: integer[], photos: object[], eans: string[], prices: object[], suppliers: object[] } }` | Set or clear article brand by SKU |
| `PUT` | `/article/{sku}/categories` | `sku:string, body: { categoryIds: integer[] }` | `200 { article: { id, sku, name, slug, track_stock, unitamount, weight, unit, brand, categoryIds: integer[], photos: object[], eans: string[], prices: object[], suppliers: object[] } }` | Replace article categories by SKU |
| `GET` | `/article/{sku}/children` | `sku:string` | `200 { children: { id, sku, name, fathersort, attributeValueId, attributeValue }[] }` | List child articles of a father article |
| `POST` | `/article/{sku}/children` | `sku:string, body: { attributeValueId?, value?, name? }` | `201 { article: { id, categoryId, name, sku, track_stock } }` | Add a child article to a father article |
| `POST` | `/article/{sku}/children` | `sku:string, body: { attributeValueId?, value?, name?, sku?: string }` | `201 { article: { id, categoryId, name, sku, track_stock } }` | Add a child article to a father article |
| `DELETE` | `/article/{sku}/children/{childSku}` | `sku:string, childSku:string, query: deleteArticle?:boolean` | `200 { success, deleted }` | Remove a child article from a father article |
| `PUT` | `/article/{sku}/eans` | `sku:string, body: { eans: string[] }` | `200 { article: { id, sku, name, slug, track_stock, unitamount, weight, unit, brand, categoryIds: integer[], photos: object[], eans: string[], prices: object[], suppliers: object[] } }` | Replace article EANs by SKU |
| `POST` | `/article/{sku}/father` | `sku:string, body: { isFather, attributeNameId? }` | `200 { article: { id, categoryId, name, sku, track_stock } }` | Toggle father mode for an article |
| `GET` | `/article/{sku}/history` | `sku:string` | `200 { history: { id, date, text }[] }` | Get article history by SKU |
| `GET` | `/article/{sku}/history` | `sku:string, query: limit?:integer` | `200 { history: { id, date, text }[], truncated }` | Get article history by SKU |
| `DELETE` | `/article/{sku}/image/{fullHash}` | `sku:string, fullHash:string` | `204 void` | Delete article image |
| `PUT` | `/article/{sku}/images/order` | `sku:string, body: { fullHashes: string[] }` | `200 { fullHashes: string[] }` | Reorder article images |
| `GET` | `/article/{sku}/optionslist` | `sku:string` | `200 { options: { id, articleId, sku, name, count, sort, mandated }[] }` | Get options list for an article |

View File

@@ -16,7 +16,7 @@ Replaces all attribute values for an article. Enforces exclusive constraint (max
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `attributevalues` | yes | any[] | |
| `attributevalues` | yes | any[] | Array of attribute value IDs (numbers) or objects with id or attributeValueId |
```json
{

View File

@@ -4,7 +4,7 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
Add a child article to a father article
Automatically generates SKU as fatherSku-attributeValueId and assigns the variant attribute.
Automatically generates SKU as fatherSku-nextFreeIndex (or accepts custom sku) and assigns the variant attribute.
## Path parameters
@@ -19,12 +19,14 @@ Automatically generates SKU as fatherSku-attributeValueId and assigns the varian
| `attributeValueId` | no | integer | ID of existing attribute value for the father's attribute |
| `value` | no | string | String value to find or create under the father's attribute |
| `name` | no | string | Optional custom variant name |
| `sku` | no | string | Optional custom SKU for the child article |
```json
{
"attributeValueId": 1,
"value": "…",
"name": "…"
"name": "…",
"sku": "…"
}
```
@@ -48,8 +50,7 @@ Created child article
| Status | Description |
|--------|-------------|
| 400 | Father not configured as father or missing value |
| 409 | Child SKU already exists |
| 400 | Father not configured as father, missing value, duplicate variant, or child SKU already exists |
---

View File

@@ -14,6 +14,12 @@ Auth like GET by SKU.
|-------|----------|------|-------------|
| `sku` | yes | string | Article SKU |
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `limit` | no | integer | Maximum number of entries to return (newest first). Omit for all entries. |
## Response `200`
Article history (newest first)