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

# Component Instances

> Create or manage a component instance (serial number / lot code)

## Create

Use `ComponentInstances.create()` to instantiate a new serial number or lot code.

<CodeGroup>
  ```python default theme={null}
  my_component_instance = serial.ComponentInstances.create(
      identifier="ABC-123", 
      component_name="Component Name"
  ) 
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField body="identifier" type="string" required>
    The serial number or lot code of the component instance
  </ParamField>

  <ParamField body="component_name" type="string" required>
    The name of the component that you want to create an instance of
  </ParamField>
</Accordion>

## Get

Use `ComponentInstances.get()` to get an existing instance of a serial number or lot code.

<CodeGroup>
  ```python default theme={null}
  my_component_instance = serial.ComponentInstances.get(
      identifier="ABC-123", 
  ) 
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField body="identifier" type="string" required>
    The serial number or lot code of the component instance
  </ParamField>
</Accordion>

## List

Use `ComponentInstances.list()` to list all component instances matching the query parameters

<CodeGroup>
  ```python defective theme={null}
  defective_components = serial.ComponentInstances.list(
      {
          "status": "DEFECTIVE"
      }
  ) 
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="component_type" type="string" optional>
    Component's Type (either SN or LOT)
  </ParamField>

  <ParamField query="status" type="string" optional>
    Component's Status (WIP, PLANNED, DEFECTIVE, COMPLETE)
  </ParamField>

  <ParamField query="part_number_id" type="string" optional>
    Components associated to particular work order
  </ParamField>

  <ParamField query="work_order_id" type="string" optional>
    Components associated with a specific part number
  </ParamField>
</Accordion>
