> 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/validation-rules-reference.md).

# Validation Rules Reference

Every rule, what it checks, its default, and when to adjust it. The defaults are the values a new Default or partner-specific rule set starts with.

<figure><img src="https://303450155-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FheBP0sH0U1Rrp1jIot9S%2Fuploads%2FnUJBqmceiaHTsdGoIMag%2FScreenshot%202026-05-04%20at%2009.45.42%20(1).png?alt=media&amp;token=0fd9d797-7b1b-4963-bbb2-d374bae00167" alt="" width="563"><figcaption><p>CDR clearing validation rule setting.</p></figcaption></figure>

### Energy Validation

Fails if total kWh is outside your specified range.

* **Default:** on, maximum 75 kWh, no minimum.
* **When to adjust:** raise the maximum for HPC or truck charging, for example to 200–300 kWh. Set a minimum (for example 0.1 kWh) only if you want to catch near-zero sessions as CDRs.

### Cost Validation

Fails if total cost is outside your specified range.

* **Default:** off.

Useful as a coarse sanity check — catches CDRs that are free when they shouldn't be, or multiples of the expected cost.

### Duration Validation

Fails if session duration is outside your specified range.

* **Default:** on, maximum 86,400 seconds (24 hours), no minimum.
* **When to adjust:** tighten the maximum if your network has a station auto-timeout shorter than 24 hours.

### Timestamp Validation

Fails on common timestamp problems:

* Start time after end time.
* Timestamps in the future.
* CDRs delivered long after the session ended.

**Default:** on, a CDR must arrive within 43,200 seconds (12 hours) of the session ending.

### Duplicate CDR

Fails if ENAPI receives more than one CDR from the CPO for what appears to be the same charging session. A session is treated as a duplicate when all of these match:

* Location and EVSE IDs
* Token UID
* Energy delivered
* Start and end times, within a 5-minute window

**Default:** off.

No configuration required, the matching criteria are fixed.

### Missing CDRs

Flags completed sessions that never produced a CDR within a grace period.

* **Default:** on, grace period 3,600 seconds (1 hour).
* **When to adjust:** raise the grace period if your partner sends CDRs in batches, for example to 6–24 hours (21,600–86,400 seconds).
* **Why it matters:** missing CDRs are silent revenue leakage — without this rule, nothing surfaces them.

### Tariff Cost Consistency

Fails if the CDR's reported cost differs from ENAPI's independently calculated cost by more than 2% or about €0.02, whichever is more.

* **Default:** off.

Our most valuable rule. Catches pricing engine bugs, wrong tariff application, and manual entry errors. ENAPI calculates expected cost from the active tariff and session data, then compares.

### Charging Speed Validation

Fails if the energy delivered exceeds what the charger could physically deliver in the session's duration. 5% tolerance built in to absorb meter noise.

* **Default:** on.

Catches meter failures and data corruption — when a 50 kW charger reports 500 kWh in a 20-minute session, this is what flags it.

### Token Validation

Fails if the token used to start the session was invalid at that time, or if the eMSP denied authorization but the session happened anyway.

* **Default:** off.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.enapi.com/cdr-clearing/validation-rules-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
