Consolidate CUPS
Merge duplicate CUPS codes by rewriting invoices to a single target value
POST
Consolidate CUPS
Consolidates duplicate or near-duplicate CUPS codes by rewriting thecups
field on the matching electricity invoices to a single canonical
target_cups value. Use List CUPS Groups
first to discover the groups that should be merged.
Only electricity invoices that match one of the provided source
(cups, facility_id) pairs and that are not backed by a Datadis supply
contract are rewritten.
Consolidation only changes the
cups value on the matched invoices. It does
not reassign facilities and does not recalculate emissions. If you
need to recalculate after consolidating, use
Recalculate Invoices.Request
Headers
Your API key for authentication.Example:
sk_live_1234567890abcdefYour organization UUID.Example:
ff4adcc7-8172-45fe-9cf1-e90a6de53aa9Body Parameters
The canonical CUPS value to write onto every matched invoice. Must be
non-empty.Example:
ES0021000000000000001ABThe
(cups, facility_id) pairs whose invoices should be rewritten to
target_cups.Response
Number of invoices whose
cups was rewritten.Facilities that had at least one invoice rewritten.
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
FACILITY_NOT_BELONG_TO_ORGANIZATION | 403 | A source facility_id is not part of the caller’s organization |
CUPS_LOCKED_BY_DATADIS | 409 | A selected source CUPS is backed by a Datadis supply contract |
| — | 422 | target_cups is empty or the request body is malformed |

