# epr.de

Calculate German packaging kilograms by VerpackG or VerpackDG material type for one LUCID system operator and period. Returns an audit trail, a CSV for mapped weights and LUCID XML for complete reports. Charges $0.50 per period when a file is produced.

- REST: `POST https://api.kanagu.dev/v1/epr/de`
- MCP tool: `epr.de` at https://api.kanagu.dev/mcp
- Price: $0.50 USD per report, on successful calls only. Trial: 10 calls per IP per UTC day without a key, shared by REST and MCP.
- Auth: `Authorization: Bearer <key>` for billed calls. Retries: reuse `Idempotency-Key`.

## Request body

- `period` (object, required): Inclusive shipment dates for one reporting period.
- `period.start` (string (date), required)
- `period.end` (string (date), required)
- `systemOperatorId` ("DE6005779374130" | "DE6005973594801" | "DE6006382012686" | "DE6004919627351" | "DE6005906579671" | "DE6005959764031" | … (14 values), required): LUCID registration ID of the system operator for these volumes. See the ZSVR XML guide §2.3.4.
- `reportTypeCode` ("HMM1" | "HJM1", required): LUCID full report type. HMM1 is intra-year and HJM1 is year-end.
- `bom` (array of object, required): Only include packaging subject to system participation and assigned to this system operator.
- `bom[].sku` (string (max 80 chars), required)
- `bom[].components` (array of object, required)
- `bom[].components[].material` (string (max 80 chars), required)
- `bom[].components[].gramsPerUnit` (number (≤ 100000), required)
- `bom[].components[].rigidity` ("rigid" | "flexible")
- `bom[].components[].recycledContentPct` (number (0 to 100))
- `bom[].components[].materialCode` ("10000" | "20000" | "30000" | "40000" | "50000" | "60000" | … (9 values)): Verified ZSVR MaterialCode for a material or composite that requires classification.
- `shipments` (array of object, required)
- `shipments[].sku` (string (max 80 chars), required)
- `shipments[].quantity` (integer (0 to 1000000), required)
- `shipments[].destination` (string, required)
- `shipments[].date` (string (date), required)
- `shipments[].returns` (integer (0 to 1000000)): Units returned from this shipment, including ordinary customer returns.
- `shipments[].notPlacedOnMarket` (integer (0 to 1000000)): Subset of returns documented as never placed on this market. Only these units are subtracted.

## Response

- `destination` (string, required)
- `period` (object, required): Inclusive shipment dates for one reporting period.
- `period.start` (string (date), required)
- `period.end` (string (date), required)
- `source` (object, required)
- `source.url` (string (uri), required)
- `source.version` (string, required)
- `needs_review` (boolean, required)
- `totals` (array of object, required)
- `totals[].category` (string, required)
- `totals[].label` (string, required)
- `totals[].kg` (number, required)
- `totals[].lucidMass` (string, required): LUCID mass in kg with a decimal comma and three decimal places.
- `trail` (array of object, required)
- `trail[].sku` (string (max 80 chars), required)
- `trail[].shipmentIndices` (array of number, required)
- `trail[].bomIndex` (number | null, required)
- `trail[].shippedUnits` (number, required)
- `trail[].returnedUnits` (number, required)
- `trail[].notPlacedOnMarketUnits` (number, required)
- `trail[].reportableUnits` (number, required)
- `trail[].components` (array of object, required)
- `trail[].components[].componentIndex` (number, required)
- `trail[].components[].material` (string (max 80 chars), required)
- `trail[].components[].gramsPerUnit` (number (≤ 100000), required)
- `trail[].components[].rigidity` ("rigid" | "flexible")
- `trail[].components[].recycledContentPct` (number (0 to 100))
- `trail[].components[].kg` (number, required)
- `trail[].components[].category` (string | null, required)
- `trail[].components[].status` ("mapped" | "excluded" | "needs_review", required)
- `trail[].components[].reason` ("unmapped_material" | "missing_classification_attributes" | "ambiguous_category" | "category_requires_confirmation" | "unknown_category")
- `trail[].components[].suppliedCategory` (string)
- `trail[].components[].missingAttributes` (array of string)
- `trail[].components[].candidateCategories` (array of string)
- `trail[].components[].exclusion` (string)
- `trail[].issue` ("missing_bom")
- `systemOperatorId` ("DE6005779374130" | "DE6005973594801" | "DE6006382012686" | "DE6004919627351" | "DE6005906579671" | "DE6005959764031" | … (14 values), required): LUCID registration ID of the system operator for these volumes. See the ZSVR XML guide §2.3.4.
- `reportTypeCode` ("HMM1" | "HJM1", required): LUCID full report type. HMM1 is intra-year and HJM1 is year-end.
- `schema` (object, required)
- `schema.url` (string (uri), required)
- `schema.version` (string, required)
- `csv` (string | null, required): CSV of mapped weights. Null if no weights were mapped.
- `xml` (string | null, required): Save this JSON string as UTF-8 without trimming. Its leading U+FEFF becomes the BOM required by LUCID. Null if the report requires review or no weights were mapped.

## Example

```sh
curl https://api.kanagu.dev/v1/epr/de \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":{"start":"2026-04-01","end":"2026-06-30"},"systemOperatorId":"DE6004919627351","reportTypeCode":"HMM1","bom":[{"sku":"tea","components":[{"material":"paperboard","gramsPerUnit":42.5,"rigidity":"rigid","recycledContentPct":60},{"material":"LDPE","gramsPerUnit":1.8,"rigidity":"flexible"}]}],"shipments":[{"sku":"tea","destination":"DE","quantity":85,"returns":2,"date":"2026-06-01"}]}'
```

```ts
const res = await fetch("https://api.kanagu.dev/v1/epr/de", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "period": {
      "start": "2026-04-01",
      "end": "2026-06-30"
    },
    "systemOperatorId": "DE6004919627351",
    "reportTypeCode": "HMM1",
    "bom": [
      {
        "sku": "tea",
        "components": [
          {
            "material": "paperboard",
            "gramsPerUnit": 42.5,
            "rigidity": "rigid",
            "recycledContentPct": 60
          },
          {
            "material": "LDPE",
            "gramsPerUnit": 1.8,
            "rigidity": "flexible"
          }
        ]
      }
    ],
    "shipments": [
      {
        "sku": "tea",
        "destination": "DE",
        "quantity": 85,
        "returns": 2,
        "date": "2026-06-01"
      }
    ]
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
```

## Errors

JSON `{"error":{"code","message"}}`.

- 400 `invalid_input`: The body does not match the request schema. The message names each field.
- 400 `invalid_json`: The body is missing or is not valid JSON.
- 400 `invalid_idempotency_key`: Idempotency-Key must be 1–128 visible ASCII characters.
- 401 `invalid_api_key`: The Bearer key is missing, malformed, invalid or inactive.
- 402 `free_allowance_exhausted`: This month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left.
- 404 `not_found`: No operation at this path.
- 409 `idempotency_conflict`: The Idempotency-Key was already used with a different body.
- 413 `payload_too_large`: JSON bodies may be at most 64 KiB.
- 429 `trial_limit`: The anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left.
- 500 `internal_error`: The call failed on our side. It is not billed; retry with the same Idempotency-Key.

## JSON Schema

Request:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "end": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Inclusive shipment dates for one reporting period."
    },
    "systemOperatorId": {
      "type": "string",
      "enum": [
        "DE6005779374130",
        "DE6005973594801",
        "DE6006382012686",
        "DE6004919627351",
        "DE6005906579671",
        "DE6005959764031",
        "DE6007094250999",
        "DE6007086225568",
        "DE6007168805143",
        "DE6004738522858",
        "DE6004844021815",
        "DE6007780383579",
        "DE6257129182400",
        "DE6161328237553"
      ],
      "description": "LUCID registration ID of the system operator for these volumes. See the ZSVR XML guide §2.3.4."
    },
    "reportTypeCode": {
      "type": "string",
      "enum": [
        "HMM1",
        "HJM1"
      ],
      "description": "LUCID full report type. HMM1 is intra-year and HJM1 is year-end."
    },
    "bom": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "components": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "material": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "gramsPerUnit": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 100000
                },
                "rigidity": {
                  "type": "string",
                  "enum": [
                    "rigid",
                    "flexible"
                  ]
                },
                "recycledContentPct": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                },
                "materialCode": {
                  "description": "Verified ZSVR MaterialCode for a material or composite that requires classification.",
                  "type": "string",
                  "enum": [
                    "10000",
                    "20000",
                    "30000",
                    "40000",
                    "50000",
                    "60000",
                    "68000",
                    "70000",
                    "80000"
                  ]
                }
              },
              "required": [
                "material",
                "gramsPerUnit"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "sku",
          "components"
        ],
        "additionalProperties": false
      },
      "description": "Only include packaging subject to system participation and assigned to this system operator."
    },
    "shipments": {
      "maxItems": 2000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "destination": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "returns": {
            "default": 0,
            "description": "Units returned from this shipment, including ordinary customer returns.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "notPlacedOnMarket": {
            "default": 0,
            "description": "Subset of returns documented as never placed on this market. Only these units are subtracted.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "sku",
          "quantity",
          "destination",
          "date"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "period",
    "systemOperatorId",
    "reportTypeCode",
    "bom",
    "shipments"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "period": {
        "start": "2026-04-01",
        "end": "2026-06-30"
      },
      "systemOperatorId": "DE6004919627351",
      "reportTypeCode": "HMM1",
      "bom": [
        {
          "sku": "tea",
          "components": [
            {
              "material": "paperboard",
              "gramsPerUnit": 42.5,
              "rigidity": "rigid",
              "recycledContentPct": 60
            },
            {
              "material": "LDPE",
              "gramsPerUnit": 1.8,
              "rigidity": "flexible"
            }
          ]
        }
      ],
      "shipments": [
        {
          "sku": "tea",
          "destination": "DE",
          "quantity": 85,
          "returns": 2,
          "date": "2026-06-01"
        }
      ]
    }
  ]
}
```

Response:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "destination": {
      "type": "string"
    },
    "period": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "end": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Inclusive shipment dates for one reporting period."
    },
    "source": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "url",
        "version"
      ],
      "additionalProperties": false
    },
    "needs_review": {
      "type": "boolean"
    },
    "totals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kg": {
            "type": "number"
          },
          "lucidMass": {
            "type": "string",
            "description": "LUCID mass in kg with a decimal comma and three decimal places."
          }
        },
        "required": [
          "category",
          "label",
          "kg",
          "lucidMass"
        ],
        "additionalProperties": false
      }
    },
    "trail": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "shipmentIndices": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "bomIndex": {
            "type": [
              "number",
              "null"
            ]
          },
          "shippedUnits": {
            "type": "number"
          },
          "returnedUnits": {
            "type": "number"
          },
          "notPlacedOnMarketUnits": {
            "type": "number"
          },
          "reportableUnits": {
            "type": "number"
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "componentIndex": {
                  "type": "number"
                },
                "material": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "gramsPerUnit": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 100000
                },
                "rigidity": {
                  "type": "string",
                  "enum": [
                    "rigid",
                    "flexible"
                  ]
                },
                "recycledContentPct": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                },
                "kg": {
                  "type": "number"
                },
                "category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "mapped",
                    "excluded",
                    "needs_review"
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "unmapped_material",
                        "missing_classification_attributes",
                        "ambiguous_category",
                        "category_requires_confirmation"
                      ]
                    },
                    {
                      "type": "string",
                      "const": "unknown_category"
                    }
                  ]
                },
                "suppliedCategory": {
                  "type": "string"
                },
                "missingAttributes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "candidateCategories": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclusion": {
                  "type": "string"
                }
              },
              "required": [
                "componentIndex",
                "material",
                "gramsPerUnit",
                "kg",
                "category",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "issue": {
            "type": "string",
            "const": "missing_bom"
          }
        },
        "required": [
          "sku",
          "shipmentIndices",
          "bomIndex",
          "shippedUnits",
          "returnedUnits",
          "notPlacedOnMarketUnits",
          "reportableUnits",
          "components"
        ],
        "additionalProperties": false
      }
    },
    "systemOperatorId": {
      "type": "string",
      "enum": [
        "DE6005779374130",
        "DE6005973594801",
        "DE6006382012686",
        "DE6004919627351",
        "DE6005906579671",
        "DE6005959764031",
        "DE6007094250999",
        "DE6007086225568",
        "DE6007168805143",
        "DE6004738522858",
        "DE6004844021815",
        "DE6007780383579",
        "DE6257129182400",
        "DE6161328237553"
      ],
      "description": "LUCID registration ID of the system operator for these volumes. See the ZSVR XML guide §2.3.4."
    },
    "reportTypeCode": {
      "type": "string",
      "enum": [
        "HMM1",
        "HJM1"
      ],
      "description": "LUCID full report type. HMM1 is intra-year and HJM1 is year-end."
    },
    "schema": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "url",
        "version"
      ],
      "additionalProperties": false
    },
    "csv": {
      "description": "CSV of mapped weights. Null if no weights were mapped.",
      "type": [
        "string",
        "null"
      ]
    },
    "xml": {
      "description": "Save this JSON string as UTF-8 without trimming. Its leading U+FEFF becomes the BOM required by LUCID. Null if the report requires review or no weights were mapped.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "destination",
    "period",
    "source",
    "needs_review",
    "totals",
    "trail",
    "systemOperatorId",
    "reportTypeCode",
    "schema",
    "csv",
    "xml"
  ],
  "additionalProperties": false
}
```
