# aBOM (As-built Bill of Materials)

An As-built Bill of Materials (aBOM) tracks the build process of parts in a hierarchical tree structure. The aBOM will track which part instances and lots are used within the creation of parts, subsystems, and systems. The aBOM can be thought of as a more intricate copy of the mBOM, with relations to physical inventory objects rather than parts. See[ here for more info on aBOMs](https://manual.firstresonance.io/features/parts-and-trace/trace-aboms).

## Setup: Part inventory

### Creating Part Instances and Lots

To create an aBOM, you will need a  inventory. See the [Part Inventory API](https://manual.firstresonance.io/api/examples/part-inventory-and-kitting) for details on creating inventory. A part with inventory will have a part number, and that part should have an mBOM. This mBOM will be used to create the aBOM.

When it is first created, the part inventory will have only empty build requirements. Build requirements define the parameters for what parts can be installed.

## Installing parts

Installing a part is done via creating an aBOM installation. aBOM installations link inventories to `buildRequirements`. Conversely, uninstalling a part is done by deleting aBOM installations.

{% tabs %}
{% tab title="Create aBOM installation" %}

```graphql
mutation CreateABomInstallation($input: CreateABomInstallationInput!) {
    createAbomInstallation(input: $input) {
        abomInstallation {
            buildRequirementId
            buildRequirementReferenceDesignatorId
            partInventoryId
            quantity
        }
    }
}
```

{% endtab %}

{% tab title="Inputs" %}

```graphql
{
    "input": {
        "buildRequirementId": 1,
        "partInventoryId": 3,
        "quantity": 1
    }
}

```

{% endtab %}
{% endtabs %}

## Editing build requirements

You can add additional build requirements to an inventory that don't originate from the mBOM.&#x20;

To add a build requirement:

{% tabs %}
{% tab title="Create build requriement" %}

```graphql
mutation CreateBuildRequirement($input: CreateBuildRequirementInput!) {
  createBuildRequirement(input: $input) {
    buildRequirement {
      fixedQuantityPerBuildRequirement
      id
      madeOnAssembly
      originMbomItemId
      partId
      partInventories {
        id
      }
      quantityPerParentPartInventory
    }
  }
}
```

{% endtab %}

{% tab title="Inputs" %}

```graphql
{
  "input": {
    "partId": 1,
    "partInventoryId": 484,
    "quantityPerParentPartInventory": 5,
    "fixedQuantityPerBuildRequirement": 0,
    "madeOnAssembly": false
  }
}
```

{% endtab %}
{% endtabs %}

To edit a build requirement:

{% tabs %}
{% tab title="Update build requirement" %}

```graphql
mutation UpdateBuildRequirement($input: UpdateBuildRequirementInput!) {
    updateBuildRequirement(input: $input) {
        buildRequirement {
            fixedQuantityPerBuildRequirement
            id
        }
    }
}
```

{% endtab %}

{% tab title="Input" %}

```graphql
{
  "input": {
    "id": 1031,
    "etag": "dca4e886ecce4a499d15411006a6d82a",
    "quantityPerParentPartInventory": 8
  }
}
```

{% endtab %}
{% endtabs %}

In this example, the `quantityPer` of the `buildRequirement` is changed, but you could also change the fixed quantity, MOA designation, substitutes, and reference designators.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.firstresonance.io/api/examples/abom-as-built-bill-of-materials-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
