---
title: "Monthly billing report for an existing allocation (kWh → EUR, #284)"
method: POST
path: "/api/energy-sharing-allocation/allocations/:id/billing-report"
tags: ["Energy Sharing Allocation"]
---

# Monthly billing report for an existing allocation (kWh → EUR, #284)

`POST /api/energy-sharing-allocation/allocations/:id/billing-report`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/energy-sharing-allocation/allocations/:id/billing-report`
- Auth: none declared

Replays the allocation, fetches each consumer's EDM consumption timeseries, caps the quota-based allocation at actual consumption (#282), aggregates Restmenge/Überschuss per consumer (#283), and applies `tariffEurPerKWh` to produce a billing report. Only allocatedKWh (internal solar share actually used) is billed — remainderKWh (grid draw) is reported for transparency but never billed here. A consumer with no EDM consumption data for the period gets billingAmountEur: null, never a misleading €0.00.

## Path parameters

- `id` string, required

## Query parameters

- `token` string

## Request body

- object
  - `tariffEurPerKWh` number, required: Internal price per kWh of allocated solar — required input, never a hardcoded default.
  - `format` 'json' | 'csv'
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Billing report (JSON) or semicolon-delimited CSV export

## Other responses

- `404`: Allocation not found

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
