> 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, and typical values.

<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.

* **Typical bounds:** 0.1 kWh (min) to 200–300 kWh (max).
* **When to adjust:** raise the upper bound for HPC or truck charging. Lower the minimum only if you want to catch near-zero sessions as CDRs.

### Cost Validation

Fails if total cost is outside your specified range.

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.

* **Typical bounds:** 60 seconds (min) to 86,400 seconds / 24 hours (max).
* **When to adjust:** tighten the max if your network has station auto-timeout shorter than 24h.

### Timestamp Validation

Fails on common timestamp problems:

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

### 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

No configuration required, the matching criteria are fixed.

### Missing CDRs

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

* **Typical grace period:** 6 to 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%.

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.

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.


---

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