> ## 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.

# Products

> Mutations for creating and managing products with sustainability data.

## createProduct

Create a new product with sustainability data.

```graphql theme={null}
mutation {
  createProduct(input: {
    name: "Bio-based Window Frame"
    sku: "BWF-001"
    sectorTag: HIGHTECH_MANUFACTURING
    materialComposition: [
      { name: "Bio-based composite", percentage: 65, isBioBased: true, recycledContent: 20 },
      { name: "Aluminum", percentage: 30, isBioBased: false, recycledContent: 80, origin: "NL" },
      { name: "Rubber seals", percentage: 5, isBioBased: false, recycledContent: 0 }
    ]
    certifications: ["ISO14001", "BREEAM"]
    sectorMetadata: {
      rareEarthMetals: [],
      energyClass: "A+",
      repairabilityScore: 8
    }
  }) {
    id
    name
    sectorTag
    impactScore {
      co2Equivalent
      mkiScore
    }
    createdAt
  }
}
```

**Input:**

| Field                 | Type               | Required | Description                  |
| --------------------- | ------------------ | -------- | ---------------------------- |
| `name`                | String!            | Yes      | Product name                 |
| `sku`                 | String             | No       | SKU identifier               |
| `sectorTag`           | SectorTag!         | Yes      | Sector classification        |
| `materialComposition` | \[MaterialInput!]! | Yes      | Material breakdown           |
| `certifications`      | \[String!]         | No       | Environmental certifications |
| `sectorMetadata`      | JSON               | No       | Sector-specific data         |

## updateProduct

Update an existing product.

```graphql theme={null}
mutation {
  updateProduct(
    id: "prod_abc123"
    input: {
      name: "Bio-based Window Frame v2"
      materialComposition: [
        { name: "Bio-based composite", percentage: 75, isBioBased: true, recycledContent: 30 },
        { name: "Recycled aluminum", percentage: 22, isBioBased: false, recycledContent: 95, origin: "NL" },
        { name: "Natural rubber", percentage: 3, isBioBased: true, recycledContent: 0 }
      ]
    }
  ) {
    id
    name
    impactScore {
      co2Equivalent
      mkiScore
    }
    updatedAt
  }
}
```

## deleteProduct

Delete a product and its associated data.

```graphql theme={null}
mutation {
  deleteProduct(id: "prod_abc123") {
    success
    deletedAt
  }
}
```

<Warning>
  Deleting a product also removes its DPP, EPD data, and supply chain records. This action cannot be undone.
</Warning>

## importProducts

Batch import products from a CSV or JSON source.

```graphql theme={null}
mutation {
  importProducts(input: {
    source: URL
    sourceUrl: "https://example.com/products.csv"
    format: CSV
    sectorTag: FOOD
    mapping: {
      name: "product_name"
      sku: "sku_code"
      co2: "carbon_footprint_kg"
    }
  }) {
    jobId
    status
    totalProducts
    imported
    failed
    errors { row message }
  }
}
```
