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

# Period Emissions

> Get emissions breakdown for a sold product period

# Period Emissions

Retrieve the emissions breakdown for a specific sold product period. Returns downstream emissions calculated for Scope 3 Category 11 (Use of Sold Products), including use-phase and end-of-life emissions.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="sold_product_id" type="string" required>
  UUID of the sold product

  **Example:** `"550e8400-e29b-41d4-a716-446655440000"`
</ParamField>

<ParamField path="period_id" type="string" required>
  UUID of the period

  **Example:** `"11111111-1111-1111-1111-111111111111"`
</ParamField>

## Response

Returns a list of emission entries by type (HTTP 200).

<ResponseField name="items" type="array[object]">
  List of emission entries.

  <Expandable title="Emission Object">
    <ResponseField name="type" type="string">
      Emission type: `use_phase` or `end_of_life`.
    </ResponseField>

    <ResponseField name="status" type="string">
      Calculation status (e.g. `calculated`, `pending`).
    </ResponseField>

    <ResponseField name="quantity" type="number | null">
      Emissions in kgCO2e. `null` if not yet calculated.
    </ResponseField>

    <ResponseField name="has_missing_impacts" type="boolean">
      Whether some impacts could not be calculated.
    </ResponseField>

    <ResponseField name="use_of_product_data_id" type="string | null">
      UUID referencing the use-of-product configuration data. `null` for end-of-life.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/sold-products/550e8400-e29b-41d4-a716-446655440000/periods/11111111-1111-1111-1111-111111111111/emissions" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
  }

  product_id = "550e8400-e29b-41d4-a716-446655440000"
  period_id = "11111111-1111-1111-1111-111111111111"

  response = requests.get(
      f"https://api.dcycle.io/v1/sold-products/{product_id}/periods/{period_id}/emissions",
      headers=headers,
  )

  emissions = response.json()
  for emission in emissions["items"]:
      qty = emission["quantity"] or 0
      print(f"{emission['type']}: {qty} kgCO2e ({emission['status']})")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const headers = {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID,
  };

  const productId = '550e8400-e29b-41d4-a716-446655440000';
  const periodId = '11111111-1111-1111-1111-111111111111';

  axios.get(
    `https://api.dcycle.io/v1/sold-products/${productId}/periods/${periodId}/emissions`,
    { headers }
  )
  .then(response => {
    response.data.items.forEach(e =>
      console.log(`${e.type}: ${e.quantity ?? 0} kgCO2e (${e.status})`)
    );
  });
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "type": "use_phase",
      "status": "calculated",
      "quantity": 12500.0,
      "has_missing_impacts": false,
      "use_of_product_data_id": "data-uuid-001"
    },
    {
      "type": "end_of_life",
      "status": "calculated",
      "quantity": 350.0,
      "has_missing_impacts": false,
      "use_of_product_data_id": null
    }
  ]
}
```

## Common Errors

### 401 Unauthorized

**Cause:** Missing or invalid API key

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
```

### 403 Forbidden

**Cause:** The authenticated user is not a member of the organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
```

### 404 Not Found

**Cause:** The sold product or period does not exist or belongs to another organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Not Found"}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Period Country Sales" icon="earth-americas" href="/api-reference/sold-products/country-sales">
    View country-level sales for this period
  </Card>

  <Card title="Emissions Summary" icon="chart-line" href="/api-reference/emissions/get-summary">
    Get aggregated emissions across all categories
  </Card>
</CardGroup>
