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

# Attribution by API

Attribution allows partial amortization of a CO₂e flux to a particular GHG entry. In many cases, attribution can be
handled automatically by Certify's amortization rules, however more custom attribution strategies can be implemented
using the API.

<Info>
  Prefer the `ghg_entry*` attribution endpoints on this page. The `removal*` endpoints remain available as deprecated
  compatibility aliases.
</Info>

<Tip>
  The user guides on [attributing components](/user-guides/certify/attribution) and [project
  emissions](/user-guides/certify/project-emissions) give a useful general introduction to concepts covered in the rest
  of this page.
</Tip>

## Attribution within a GHG entry

To add a new project operation component with partial attribution to a GHG entry, first [create the
component](/api-reference/certify/post-component) and then call the [Patch GHG Entry
Components](/api-reference/certify/patch-ghg-entry-components) endpoint with a request as follows:

```json Patch GHG Entry Components theme={null}
{
  "components_to_add": [
    {
      "attribution_factor": 0.612,
      "component_group_key": "biomass-transport",
      "component_id": "cmp_1EP2SB7MZ1S036PY"
    }
  ]
}
```

The attribution factor is a fraction and determines the proportion of the component that is attributed to the GHG entry. In the example
above, 0.612 (or 61.2%) of the biomass transport component will be attributed to the GHG entry.

## GHG Statement level attribution

Emissions can be [added to a GHG statement](/user-guides/certify/attribution#ghg-statement-level-attribution) if they
relate to that reporting period. In the case that a statement has multiple GHG entries, the emission will be automatically
split evenly across all GHG entries.

The component can be created and attributed in the same request to [Post GHG Statement
Component](/api-reference/certify/post-ghg-statement-component). Note that no attribution factor is needed in this
case as attribution is calculated automatically.

```json Add a GHG statement level emission theme={null}
{
  "component_data": {
    "activity_completed_at": "2023-11-07T05:31:56Z",
    "activity_started_at": "2023-11-07T05:31:56Z",
    "component_blueprint_key": "<string>",
    "description": "<string>",
    "display_name": "<string>",
    "inputs": [
      {
        "__typename": "CreateComponentListInput",
        "datapoint_ids": [
          "dtp_1DVKHKS101S0Q61Q"
        ],
        "input_key": "<string>"
      }
    ],
    "project_id": "prj_1CTWZQGKE1S0VAXA",
    "supplier_reference_id": "<string>"
  },
  "ghg_statement_id": "ggs_1GDQJ99Z51S0DYW9"
}
```

## Attribution of project emissions

Project emissions can be automatically allocated by Certify using an [amortization
rule](/user-guides/certify/project-emissions#amortization-rules). If a `Manual` amortization rule is selected, suppliers
can define their own amortization strategy using API updates to amend GHG entries.

Once a project emission and GHG entry have been created, the emission can be attributed by calling
the [Post Project Component GHG Entry Attribution](/api-reference/certify/post-project-component-ghg-entry-attribution)
endpoint:

```json Attribute project emission to GHG entry theme={null}
{
  "attribution_factor": 0.654,
  "ghg_entry_id": "rmv_1EEM6NJXX1S0EXKD"
}
```

<Info>
  The project emission component ID is specified as a path parameter in the request.
</Info>

## Full attribution

Components cannot be attributed beyond 100%. In the event a request is sent attempting to over-attribute a component,
the API will respond with a `400` error.
