Files
dashback/docs/api/routes/article/_sku/father.md
2026-10-04 19:38:16 +02:00

1.8 KiB

POST /article/{sku}/father

Protected. Requires a valid session cookie (credentials: 'include').

Toggle father mode for an article

Enables or disables father article status. Enabling requires specifying an attributeNameId; disabling requires the article to have zero children.

attributeNameId is conditionally required: it is optional in the schema because it is only required when isFather is true. Omitting it (or passing 0/a negative value) together with isFather: true returns 400 attributeNameId is required to become a father article. It must not be sent when isFather is false.

Path parameters

Param Required Type Description
sku yes string Article SKU

Body (JSON)

Field Required Type Description
isFather yes boolean True to make article a father, false to revert to regular article
attributeNameId no integer Conditionally required when isFather is true (required iff isFather=true). The attributename id used for the article's variants. Omitting it while enabling father mode returns 400. Must be omitted when isFather is false.
{
  "isFather": true,
  "attributeNameId": 1
}

Response 200

Updated article

{
  "article": {
    "id": 1,
    "categoryId": 1,
    "name": "…",
    "sku": "…",
    "track_stock": true
  }
}

Errors

Status Description
400 Invalid input, attributeNameId missing while isFather is true, article still
has children, article has stock/suppliers/a Stückliste/options, or the attribute is
already used by an ancestor father article.
404 Article or attribute name not found

Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.