> For the complete documentation index, see [llms.txt](https://docs.enapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enapi.com/cdr-clearing/what-is-cdr-clearing.md).

# What is CDR Clearing

CDR Clearing is ENAPI's automatic validation and review layer for Charge Detail Records.

### The problem

A CDR is the billing record the CPO generates after a charging session ends. Everything downstream — your invoicing, your partner's receivables, the driver's final charge — depends on it being accurate. In practice, CDRs often aren't.

Common issues:

* **Cost calculation errors** — the CDR's cost doesn't match what the tariff says it should be.
* **Tariff mismatches** — the CDR applies a different tariff than the one active at session time.
* **Missing or malformed fields** — required OCPI fields aren't populated, or timestamps don't make sense.
* **Missing CDRs entirely** — a session completes but no CDR arrives.

Left uncaught, these issues corrupt invoicing and create disputes weeks after the fact, when the data is hard to reconstruct.

### The solution

Every CDR flowing through ENAPI runs against validation rules you define. CDRs that pass are automatically accepted and ready for billing. CDRs that fail at least one validation check are flagged for review — by both you and your partner — before they should be invoiced.

### How it fits in the billing chain

1. A charging session ends. The CPO generates a CDR.
2. The CDR is delivered to ENAPI.
3. ENAPI matches the CDR to its session and runs your configured validation rules.
4. Passing CDRs are automatically accepted.
5. Flagged CDRs are moved to the "To Review" status in the CDR Inbox. Both CPO and eMSP review them.
6. Once both parties agree on an outcome (accept or reject), the CDR is marked **Completed**.
7. If the CPO accepts the CDR, the CPO is confirming it will invoice it; if the eMSP accepts the CDR, the eMSP is confirming it intends to pay it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.enapi.com/cdr-clearing/what-is-cdr-clearing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
