---
title: "POST /api/material-lines/"
method: POST
path: "/api/material-lines/"
tags: ["Products/Material-Lines"]
---

# POST /api/material-lines/

`POST /api/material-lines/`

## Request body

- object
  - `styleId` string, required
  - `materialHeaderId` string, required
  - `parentId` string, nullable
  - `percentage` number, required
  - `rawMaterialId` string, required
  - `weights` number
  - `weightUnit` string
  - `level` integer
  - `position` integer
  - `countriesOfOrigin` string[]
  - `forCompanyId` string

## Response `201`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `id` string, required
    - `materialHeaderId` string, required
    - `rawMaterialId` string, nullable, required
    - `percentage` number, nullable, required
    - `weights` number, nullable, required
    - `weightUnit` string, nullable, required
    - `parentId` string, nullable, required
    - `hierarchy` number, nullable, required
    - `position` number, nullable, required
    - `countriesOfOrigin` string[], nullable, required
    - `createdAt` string, date-time, required
    - `createdByUserId` string, nullable, required
    - `createdByCompanyId` string, nullable, required
    - `updatedAt` string, date-time, required
    - `updatedByUserId` string, nullable, required
    - `updatedByCompanyId` string, nullable, required

## Changes

> 22 revisions in range; 1 not diffed.

- **2026-08-31** `97e51f27dc77` — 13 breaking, 13 info
  - request property `parentId` list-of-types was narrowed by removing types `null` from media type `application/json`
  - the response property `data/countriesOfOrigin` became nullable for the status `201`
  - the response property `data/createdByCompanyId` became nullable for the status `201`
  - the response property `data/createdByUserId` became nullable for the status `201`
  - …22 more
- **2026-08-21** `ae0f0a740727` — 1 info
  - the request property `parentId` became optional

[Change history](https://skmtc.dev/retraced/apis/api-reference/changes/api/material-lines/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) · [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/retraced/api-reference/revisions/97e51f27dc77/schema)
