## Modifying Bill of Materials (BoM)

To modify a Bill of Materials (BoM), use the Product endpoint. The request will look like this (replace `dev` with your account):

### cURL Request

```curl
curl --request POST \
     --url https://app.finaleinventory.com/dev/api/product/100000 \
     --header 'authorization: Basic XXX' \
     --data '{"productAssocList":[{"productAssocTypeId":"MANUF_COMPONENT","productAssocUrl":"/dev/api/productassoc/100000","productAssocItemList":[{"productUrl":"/dev/api/product/100001","quantity":8}]}],"productId":"100000","productUrl":"/dev/api/product/100000"}'
```

### Breaking Out the Data Sent for the Request

```json
{
  "productAssocList": [
    { "productAssocTypeId": "MANUF_COMPONENT",
      "productAssocUrl": "/dev/api/productassoc/100000",
      "productAssocItemList": [
        { "productUrl": "/dev/api/product/100001", "quantity": 8 }
      ]
    }
  ],
  "productId": "100000",
  "productUrl": "/dev/api/product/100000"
}
```

### Important Notes
- The `productAssocUrl` for the specific `productAssocList` must be correct. When creating a new `productAssocList` from an empty product, you can exclude the `productAssocUrl`. In all other cases, specify it.
- If you don’t specify a `productAssocUrl` when updating the `productAssocList`, it will create a new entry instead of replacing the existing one. This extra entry will not be picked up by builds in the UI or imports.
- The UI and Imports only pull the first `productAssocList` entry. All other entries will be ignored.

### Required Values
- **productAssocList**: List of product BoMs. Our UI/Imports only support a single BoM, even though our API can handle multiple.
- **productAssocUrl**: Unique identifier for the `productAssocList` entry. Required for all update operations.
- **productAssocTypeId**: Always "MANUF_COMPONENT" for BoMs.
- **productAssocItemList**: Associated item list for the BoM. Each entry must have a `productUrl` and a quantity.
- **productId**, **productUrl**: Both are required for any updates to the product API.

### Additional Note
Product URLs must be obtained from the product collection, as a different internal identifier is used than the visible product ID.
