> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Bill of Materials

> This endpoint creates a new bill of materials

### Body

<ParamField body="id" type="string">
  This is the id of the bill of materials
</ParamField>

<ParamField body="number" type="string">
  This is the number of the bill of materials
</ParamField>

<ParamField body="name" type="string">
  This is the name of the bill of materials
</ParamField>

<ParamField body="description" type="string">
  This is the description of the bill of materials
</ParamField>

<ParamField body="groups" type="string">
  This is the groups of the bill of materials
</ParamField>

<ParamField body="created_at" type="string">
  This is the date and time when the bill of materials was created
</ParamField>

<ParamField body="updated_at" type="string">
  This is the date and time when the bill of materials was last updated
</ParamField>

<ParamField body="valid" type="boolean">
  This indicates whether the bill of materials is valid or not
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the id of the bill of materials.
</ResponseField>

<ResponseField name="number" type="string">
  This is the number of the bill of materials.
</ResponseField>

<ResponseField name="name" type="string">
  This is the name of the bill of materials.
</ResponseField>

<ResponseField name="description" type="string">
  This is the description of the bill of materials.
</ResponseField>

<ResponseField name="groups" type="string">
  This is the groups of the bill of materials.
</ResponseField>

<ResponseField name="created_at" type="string">
  This is the date and time when the bill of materials was created.
</ResponseField>

<ResponseField name="updated_at" type="string">
  This is the date and time when the bill of materials was last updated.
</ResponseField>

<ResponseField name="valid" type="boolean">
  This indicates whether the bill of materials is valid or not.
</ResponseField>

<ResponseField name="line_items" type="object ">
  This is an array of line items associated with the bill of materials.

  <Expandable title="Show child attributes">
    <ResponseField name="id" type="string">
      This is the id of the line item.
    </ResponseField>

    <ResponseField name="bill_of_materials_number" type="string">
      This is the number of the bill of materials to which the line item belongs.
    </ResponseField>

    <ResponseField name="line_type" type="string">
      This is the type or category of the line item.
    </ResponseField>

    <ResponseField name="part_number" type="string">
      This is the number or code associated with the part or item.
    </ResponseField>

    <ResponseField name="part_name" type="string">
      This is the name of the part or item.
    </ResponseField>

    <ResponseField name="purchase_supply_type" type="string">
      This is the type or category of the purchase/supply associated with the line item.
    </ResponseField>

    <ResponseField name="quantity" type="number">
      This is the quantity of the part or item required in the bill of materials.
    </ResponseField>

    <ResponseField name="status" type="string">
      This is the status or state of the line item.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/bill_of_materials' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b"
  }'
  ```

  ```graphQL GraphQL theme={null}

      mutation addBillOfMaterial($bill_of_material: bill_of_materials_insert_input!) {
        insert_bill_of_materials(objects: [$bill_of_material]) {
          returning {
            id
          }
        }
      }
  ```

  ```javascript Node.js theme={null}

  const created = await stateset.billofmaterials.create(
    'bom_ODkRWQtx9NVsRX'
  );

  ```

  ```python Python theme={null}

  created = stateset.billofmaterials.create(
    'bom_ODkRWQtx9NVsRX'
  )

  ```

  ```ruby Ruby theme={null}

  created = Stateset::BillOfMaterials.create(
    'bom_ODkRWQtx9NVsRX'
  )

  ```

  ```php PHP theme={null}

  $created = $stateset->billofmaterials->create(
    'bom_ODkRWQtx9NVsRX'
  );

  ```

  ```go Go theme={null}

  created, err := stateset.BillOfMaterials.Create(
    'bom_ODkRWQtx9NVsRX'
  )

  ```

  ```java Java theme={null}

  BillOfMaterials created = stateset.billOfMaterials.create(
    'bom_ODkRWQtx9NVsRX'
  );

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    {
      "id": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b",
      "number": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b",
      "name": "Bill of Materials",
      "description": "Bill of Materials",
      "groups": "Bill of Materials",
      "created_at": "2021-01-01T00:00:00.000Z",
      "updated_at": "2021-01-01T00:00:00.000Z",
      "valid": true,
      "line_items": [
        {
          "id": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b",
          "bill_of_materials_number": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b",
          "line_type": "Bill of Materials",
          "part_number": "5f7b1b4a-5b0b-4b0a-8b0b-4b0a5b0b4a5b",
          "part_name": "Bill of Materials",
          "purchase_supply_type": "Bill of Materials",
          "quantity": 1,
          "status": "Bill of Materials"
        }
      ]
    }
  }
  ```
</ResponseExample>
