> For the complete documentation index, see [llms.txt](https://carbonlink.gitbook.io/carbonlink-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://carbonlink.gitbook.io/carbonlink-api/core/api-reference/estimate.md).

# Estimate

{% hint style="warning" %}
API Key is required for all **Estimate** endpoints.
{% endhint %}

## Create a new Estimate event.

<mark style="color:green;">`POST`</mark> `https://api.carbonlink.io/v1/estimates`

#### Request Body

| Name        | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| kgCO2e      | number | <p>Weight of carbon emissions to remove from circulation, in kilograms.</p><p></p><p>Note: If both <code>kgCO2e</code> and <code>products</code> parameters are provided, the total combined emissions will be added to this estimate.</p>                                                                                                                                                                                                                                                                                                                                                       |
| products    | object | <p>This attribute computes the unit emission rate for this set of <strong>Products</strong>.</p><p></p><p>Key-value pairs where the key of each pair represents the ID of the <strong>Product</strong> to add to this estimate with a value corresponding to the quantity (# of units) of the <strong>Product</strong> to apply to this estimate.</p><p></p><p>Example:</p><p><code>{ "prod\_123": 1, "prod\_456": 3 }</code></p><p></p><p>Note: If both <code>kgCO2e</code> and <code>products</code> parameters are provided, the total combined emissions will be added to this estimate.</p> |
| customerRef | string | Internal reference to customer. (i.e. email address or another user identifier)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% tabs %}
{% tab title="200: OK Your estimate is now being processing." %}

```json
{
    estimateId: "YOUR-ESTIMATE-ID"
}
```

{% endtab %}
{% endtabs %}

## Retrieve an existing Estimate event.

<mark style="color:blue;">`GET`</mark> `https://api.carbonlink.io/v1/estimates`

Use query parameters to search for an Estimate event by the event ID.

#### Query Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | string | Event ID    |

{% tabs %}
{% tab title="200: OK Estimate event" %}

```json
{
  id: "est_12345678",
  kgCO2e: 123.45,
  price: 230.91,
  default_asset: "asset_123456...",
  breakdown: {
    "co2": 0.12,
    "ch4": 0.48,
    "sf6": 0.40
  },
  products: {
    "prod_123...": {
        id: "prod_123...",
        ...
    },
    "prod_456...": {
        id: "prod_456...",
        ...
    }
  },
  shipping_details: {
    distance: {
      unit: "mile",
      value: 12.12
    },
    route: "land",
    weight: {
      unit: "kg",
      value: 100
    },
  },
  active: true,
}
```

{% endtab %}
{% endtabs %}

## List all Estimate events.

<mark style="color:blue;">`GET`</mark> `https://api.carbonlink.io/v1/estimates`

{% tabs %}
{% tab title="200: OK List of Estimate events." %}

```json
[
    {
      id: "est_12345678",
      kgCO2e: 123.45,
      price: 230.91,
      default_asset: "asset_123456...",
      breakdown: {...},
      products: {...},
      shipping_details: {...},
      active: true,
    }
    {...}
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://carbonlink.gitbook.io/carbonlink-api/core/api-reference/estimate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
