# Add a BOM item to a product (/docs/api-reference/products/ProductsController_addBomItem)

`POST /api/factories/{factoryId}/products/{productId}/bom`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory ID |
| `productId` | path | yes | string | Product ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "componentPartNumber": {
      "type": "string",
      "description": "Component part number",
      "example": "PN-2001"
    },
    "componentName": {
      "type": "string",
      "description": "Component name",
      "example": "Steel Rod"
    },
    "quantity": {
      "type": "number",
      "description": "Quantity required",
      "default": 1
    },
    "unit": {
      "type": "string",
      "description": "Unit of measure",
      "default": "pcs"
    },
    "sortOrder": {
      "type": "number",
      "description": "Sort order",
      "default": 0
    },
    "onHand": {
      "type": "string",
      "description": "Freeform on-hand quantity note for this component (e.g. \"12 rolls\", \"~200 pcs in Bin A3\").",
      "example": "12 rolls"
    }
  },
  "required": [
    "componentPartNumber",
    "componentName"
  ]
}
```

## Responses

### 201: BOM item added