50 lines
1.2 KiB
Markdown
50 lines
1.2 KiB
Markdown
# `POST /article/{sku}/children`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Create and attach a new child article to a parent article
|
|
|
|
Automatically generates SKU as parentSku-nextFreeIndex and name from parent name + value. Rejects a caller-supplied sku.
|
|
|
|
## Path parameters
|
|
|
|
| Param | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `sku` | yes | string | Parent article SKU |
|
|
|
|
## Body (JSON)
|
|
|
|
| Field | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `attributeValueId` | no | integer | ID of existing attribute value for the parent's attribute |
|
|
| `value` | no | string | String value to find or create under the parent's attribute |
|
|
| `name` | no | string | Optional custom variant name |
|
|
|
|
```json
|
|
{
|
|
"attributeValueId": 1,
|
|
"value": "…",
|
|
"name": "…"
|
|
}
|
|
```
|
|
|
|
## Response `201`
|
|
|
|
Created child article
|
|
|
|
```json
|
|
{
|
|
"sku": "…"
|
|
}
|
|
```
|
|
|
|
## Errors
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 400 | Parent not configured as parent, missing value, duplicate variant, or sku was provided in body |
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|