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

# Supply Chain

> Visualize and query supply chain hierarchies from Tier 1 to Tier N.

The Supply Chain module provides a graph-based view of a product's entire supply chain, from direct suppliers (Tier 1) down to raw material origins (Tier N). This enables full transparency and Scope 3 emissions tracking.

## Querying a supply chain

```graphql theme={null}
query {
  supplyChain(productId: "prod_abc123") {
    product {
      id
      name
    }
    tiers {
      level
      suppliers {
        id
        name
        country
        certificationId
        transportMethod
        co2Contribution
        percentage
        children {
          id
          name
          country
          co2Contribution
        }
      }
    }
    totalTiers
    totalSuppliers
    aggregatedImpact {
      co2Equivalent
      mkiScore
    }
  }
}
```

**Response:**

```json theme={null}
{
  "data": {
    "supplyChain": {
      "product": {
        "id": "prod_abc123",
        "name": "Bio-based Window Frame"
      },
      "tiers": [
        {
          "level": 1,
          "suppliers": [
            {
              "id": "sup_001",
              "name": "FrameWorks BV",
              "country": "NL",
              "certificationId": "ISO14001-2024",
              "transportMethod": "TRUCK",
              "co2Contribution": 4.2,
              "percentage": 34,
              "children": [
                {
                  "id": "sup_002",
                  "name": "BioResin GmbH",
                  "country": "DE",
                  "co2Contribution": 3.1
                }
              ]
            }
          ]
        }
      ],
      "totalTiers": 3,
      "totalSuppliers": 12,
      "aggregatedImpact": {
        "co2Equivalent": 12.4,
        "mkiScore": 0.87
      }
    }
  }
}
```

## Supply chain graph

The supply chain is modeled as a directed graph. Each node represents a supplier with the following properties:

| Field             | Type        | Description                                 |
| ----------------- | ----------- | ------------------------------------------- |
| `id`              | ID          | Unique supplier identifier                  |
| `name`            | String      | Supplier name                               |
| `country`         | String      | ISO country code                            |
| `tier`            | Int         | Tier level (1 = direct supplier)            |
| `transportMethod` | Enum        | How goods are transported to the next tier  |
| `certificationId` | String      | Environmental certification reference       |
| `co2Contribution` | Float       | This supplier's CO2 contribution in kg CO2e |
| `percentage`      | Float       | Percentage of total product impact          |
| `children`        | \[Supplier] | Nested sub-suppliers                        |

## Filtering by tier

```graphql theme={null}
query {
  supplyChain(productId: "prod_abc123", maxTier: 2) {
    tiers {
      level
      suppliers { name country co2Contribution }
    }
  }
}
```

## Hotspot analysis

Identify the biggest contributors to a product's environmental impact across the chain:

```graphql theme={null}
query {
  supplyChainHotspots(
    productId: "prod_abc123"
    metric: CO2_EQUIVALENT
    limit: 5
  ) {
    supplier { id name country tier }
    contribution
    percentage
    recommendation
  }
}
```

## Use cases

* **Transparency pages**: Interactive supply chain visualizations on product pages
* **Scope 3 reporting**: Automated upstream and downstream emissions tracking
* **Supplier evaluation**: Identify high-impact suppliers for improvement programs
* **DPP compliance**: Supply chain data is a required component of Digital Product Passports
