---
title: "PUT /api/bom-lines/{id}"
method: PUT
path: "/api/bom-lines/{id}"
tags: ["Products/BOM-Lines"]
---

# PUT /api/bom-lines/{id}

`PUT /api/bom-lines/{id}`

Edit a BOM line. As on create, `entity` is the product whose BOM is being edited (it decides whether the shared BOM is edited or forked for that product first) and `component` is the part the line records — they are different products, and both accept a Retraced ID or your own externalId. This is a full replace of the line's optional fields: omitted fields are cleared.

## Path parameters

- `id` string, required

## Request body

- object
  - `entity` object, required — The product whose BOM you are writing to — the owning product, not the part. Never stored on the line: it picks which of the BOM header's links you act through, which decides whether the shared BOM is edited or a private copy is forked for that product first (copy-on-write). Pass the style to edit the BOM for the whole product family; pass a variant or SKU that only inherits the BOM to fork it for that product alone. `bomHeaderId` cannot replace it: one header is linked to the style and to every variant/SKU inheriting it, each link with its own ownership flag.
    - `styleId` string, required — The product whose BOM you are writing to — the owning product, not the part. Accepts the Retraced ID or your own externalId. Decides whether the shared BOM is edited or forked for that product first (copy-on-write).
  - `component` object, required — The product used as a component — the part. This is what the line records. It must exist and carry at least one code (`400 component_codes_not_found` otherwise). A different product from `entity`: a t-shirt (entity) lists a fabric (component) in its BOM.
    - `styleId` string, required — The product used as a component — the part this line records. Accepts the Retraced ID or your own externalId. Must carry at least one code.
  - `placementId` string
  - `quantity` number
  - `quantityUnit` 'LITRE' | 'MILLILITRE' | 'CENTILITRE' | 'CUBIC_DECIMETRE' | 'CUBIC_METRE' | 'GALLON' | 'QUART' | 'PINT' | 'GILL' | 'FLUID_OUNCE' | 'FLUID_DRAM' | 'MINIM' | 'BUSHEL' | 'ACRE_FOOT' | 'CORD' | 'CUBIC_YARD' | 'CUBIC_FOOT' | 'CUBIC_INCH' | 'PECK' | 'METRE' | 'MILLIMETRE' | 'DECIMETRE' | 'CENTIMETRE' | 'INCH' | 'NAUTICAL_MILE' | 'MILE' | 'FURLONG' | 'ROD' | 'FATHOM' | 'YARD' | 'FOOT' | 'GRAM' | 'GRAM_PER_SQUARE_METER' | 'GRAM_PER_SQUARE_FOOT' | 'GRAM_PER_SQUARE_YARD' | 'OUNCE_PER_SQUARE_YARD' | 'MILLIGRAM' | 'KILOGRAM' | 'METRIC_TON' | 'POUNDS' | 'SHORT_TON' | 'LONG_TON' | 'HUNDREDWEIGHT' | 'SHORT_HUNDREDWEIGHT' | 'LONG_HUNDREDWEIGHT' | 'OUNCE' | 'DRAM' | 'GRAIN' | 'PENNYWEIGHT' | 'SCRUPLE' | 'STONE' | 'SQUARE_METRE' | 'SQUARE_DECIMETRE' | 'SQUARE_CENTIMETRE' | 'SQUARE_INCH' | 'SQUARE_MILE' | 'SQUARE_FEET' | 'SQUARE_ROD' | 'SQUARE_YARD' | 'ACRE' | 'PIECES' | 'PAIR' | 'PERCENTAGE' | 'DENIER' | 'JUTE' | 'ENGLISH_COUNT' | 'METRIC_COUNT' | 'WORSTED_COUNT' | 'TEX' | 'KILOWATT_HOUR' | 'MOUND'
  - `weight` number
  - `weightUnit` 'LITRE' | 'MILLILITRE' | 'CENTILITRE' | 'CUBIC_DECIMETRE' | 'CUBIC_METRE' | 'GALLON' | 'QUART' | 'PINT' | 'GILL' | 'FLUID_OUNCE' | 'FLUID_DRAM' | 'MINIM' | 'BUSHEL' | 'ACRE_FOOT' | 'CORD' | 'CUBIC_YARD' | 'CUBIC_FOOT' | 'CUBIC_INCH' | 'PECK' | 'METRE' | 'MILLIMETRE' | 'DECIMETRE' | 'CENTIMETRE' | 'INCH' | 'NAUTICAL_MILE' | 'MILE' | 'FURLONG' | 'ROD' | 'FATHOM' | 'YARD' | 'FOOT' | 'GRAM' | 'GRAM_PER_SQUARE_METER' | 'GRAM_PER_SQUARE_FOOT' | 'GRAM_PER_SQUARE_YARD' | 'OUNCE_PER_SQUARE_YARD' | 'MILLIGRAM' | 'KILOGRAM' | 'METRIC_TON' | 'POUNDS' | 'SHORT_TON' | 'LONG_TON' | 'HUNDREDWEIGHT' | 'SHORT_HUNDREDWEIGHT' | 'LONG_HUNDREDWEIGHT' | 'OUNCE' | 'DRAM' | 'GRAIN' | 'PENNYWEIGHT' | 'SCRUPLE' | 'STONE' | 'SQUARE_METRE' | 'SQUARE_DECIMETRE' | 'SQUARE_CENTIMETRE' | 'SQUARE_INCH' | 'SQUARE_MILE' | 'SQUARE_FEET' | 'SQUARE_ROD' | 'SQUARE_YARD' | 'ACRE' | 'PIECES' | 'PAIR' | 'PERCENTAGE' | 'DENIER' | 'JUTE' | 'ENGLISH_COUNT' | 'METRIC_COUNT' | 'WORSTED_COUNT' | 'TEX' | 'KILOWATT_HOUR' | 'MOUND'
  - `countryOfOrigin` string
  - `isMainComponent` boolean

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `id` string, required
    - `bomHeaderId` string, required
    - `placementId` string, required
    - `styleId` string, required
    - `quantity` number, required
    - `quantityUnit` string, required
    - `weight` number, required
    - `weightUnit` string, required
    - `countryOfOrigin` string, required
    - `isMainComponent` boolean, required
    - `createdAt` string, required
    - `createdByUserId` string, required
    - `createdByCompanyId` string, required
    - `updatedAt` string, required
    - `updatedByUserId` string, required
    - `updatedByCompanyId` string, required

---

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