> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ocpplab.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.io/_mcp/server.

# Get a CDR

GET https://api.ocpplab.io/cpo/cdrs/{cdr_id}

One CDR by OCPI id. If two parties use the same id, pass ``country_code`` and ``party_id`` (409 otherwise).

Reference: https://docs.ocpplab.io/api-reference/cpo/cdrs/get

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `cdr_id` (string, required) — OCPI CDR id.

### Query parameters

- `country_code` (string, optional, nullable) — Only this OCPI party country code, e.g. NL.
- `party_id` (string, optional, nullable) — Only this OCPI party id, e.g. OCP.

## Response

### 200

The requested object.

- `id` (integer, required)
- `cdr_id` (string, required)
- `start_date_time` (datetime, required)
- `end_date_time` (datetime, required)
- `cdr_token` (OcpiCdrToken, required) — Token snapshot stored on a session or CDR. Older rows may only have a uid. The other OCPI fields are null until the processor stored them.
- `auth_method` (CdrOutAuthMethod, required)
- `cdr_location` (OcpiCdrLocation, required) — Location snapshot billed on a CDR.
- `currency` (string, required)
- `charging_periods` (list of OcpiChargingPeriod, required)
- `total_cost` (OcpiPriceOutput, required)
- `total_energy` (string, required)
- `total_time` (string, required)
- `last_updated` (datetime, required)
- `role` (string, required)
- `origin` (CdrOutOrigin, required)
- `organization_id` (string, required)
- `country_code` (string, required)
- `party_id` (string, required)
- `ocpi_version` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `session_id` (string, optional, nullable)
- `authorization_reference` (string, optional, nullable)
- `meter_id` (string, optional, nullable)
- `tariffs` (list of OcpiTariffSnapshot, optional, nullable)
- `signed_data` (OcpiSignedData, optional, nullable) — Signed meter data attached to a CDR.
- `total_fixed_cost` (OcpiPriceOutput, optional, nullable)
- `total_energy_cost` (OcpiPriceOutput, optional, nullable)
- `total_time_cost` (OcpiPriceOutput, optional, nullable)
- `total_parking_time` (string, optional, nullable)
- `total_parking_cost` (OcpiPriceOutput, optional, nullable)
- `total_reservation_cost` (OcpiPriceOutput, optional, nullable)
- `remark` (string, optional, nullable)
- `invoice_reference_id` (string, optional, nullable)
- `credit` (boolean, optional, nullable)
- `credit_reference_id` (string, optional, nullable)
- `home_charging_compensation` (boolean, optional, nullable)
- `location_id` (string, optional, nullable)
- `evse_uid` (string, optional, nullable)
- `connector_id` (string, optional, nullable)
- `charge_point_id` (string, optional, nullable)
- `booking_id` (string, optional, nullable)
- `receiver_cdr_url` (string, optional, nullable)

## Errors

### 401 Unauthorized Error

Missing or invalid Bearer token

- `detail` (string, required) — Human-readable error message returned by the API.

### 404 Not Found Error

CDR not found for your organization

- `detail` (string, required) — Human-readable error message returned by the API.

### 409 Conflict Error

The id is used by more than one party; pass country_code and party_id

- `detail` (string, required) — Human-readable error message returned by the API.

### 422 Unprocessable Entity Error

The request does not match the schema

- `detail` (list of ValidationError, optional) — One entry per invalid field.

### 429 Too Many Requests Error

Gateway rate limit reached; retry after the given seconds

- `detail` (string, required) — Human-readable error message returned by the API.

### 502 Bad Gateway Error

Gateway unreachable, failing, or misconfigured

- `detail` (string, required) — Human-readable error message returned by the API.

### 504 Gateway Timeout Error

Gateway timed out

- `detail` (string, required) — Human-readable error message returned by the API.

## Types

### OcpiCdrToken

Token snapshot stored on a session or CDR. Older rows may only have a uid. The other OCPI fields are null until the processor stored them.

- `uid` (string, optional, nullable)
- `country_code` (string, optional, nullable)
- `party_id` (string, optional, nullable)
- `type` (string, optional, nullable)
- `contract_id` (string, optional, nullable)

### CdrOutAuthMethod

### OcpiCdrLocation

Location snapshot billed on a CDR.

- `id` (string, optional, nullable)
- `name` (string, optional, nullable)
- `evse_uid` (string, optional, nullable)
- `evse_id` (string, optional, nullable)
- `connector_id` (string, optional, nullable)
- `connector_standard` (string, optional, nullable)
- `connector_format` (string, optional, nullable)
- `connector_power_type` (string, optional, nullable)

### OcpiChargingPeriod

Energy, time, and parking measured from one moment in a session.

- `start_date_time` (datetime, required)
- `dimensions` (list of OcpiCdrDimension, optional, nullable)
- `tariff_id` (string, optional, nullable)

### OcpiPriceOutput

- `excl_vat` (string, required)
- `incl_vat` (string, optional, nullable)

### CdrOutOrigin

### OcpiTariffSnapshot

Tariff object stored on a CDR. Unknown OCPI fields are kept.

- `id` (string, optional, nullable)
- `currency` (string, optional, nullable)
- `elements` (list of OcpiTariffElementOutput, optional, nullable)

### OcpiSignedData

Signed meter data attached to a CDR.

- `encoding_method` (string, required)
- `signed_values` (list of OcpiSignedValue, required)
- `encoding_method_version` (integer, optional, nullable)
- `public_key` (string, optional, nullable)
- `url` (string, optional, nullable)

### ValidationError

Why one field is invalid.

- `loc` (list of ValidationErrorLocItems, required) — Where the field is: ``body`` / ``query`` / ``path`` / ``header``, then its name.
- `msg` (string, required) — What is wrong, in English.
- `type` (string, required) — Machine-readable error code, e.g. ``missing``.
- `input` (any, optional) — The value that was sent.
- `ctx` (ValidationErrorCtx, optional) — Details of the rule that failed, e.g. `{"le": 200}`.

### OcpiCdrDimension

One measured dimension inside a charging period.

- `type` (string, required)
- `volume` (string, required)

### OcpiTariffElementOutput

- `price_components` (list of OcpiPriceComponentOutput, required)
- `restrictions` (OcpiTariffRestrictionsOutput, optional, nullable)

### OcpiSignedValue

One signed meter value.

- `nature` (string, required)
- `plain_data` (string, required)
- `signed_data` (string, required)

### ValidationErrorLocItems

### ValidationErrorCtx

Details of the rule that failed, e.g. `{"le": 200}`.

### OcpiPriceComponentOutput

- `type` (string, required)
- `price` (string, required)
- `step_size` (integer, required)
- `vat` (string, optional, nullable)

### OcpiTariffRestrictionsOutput

- `start_time` (string, optional, nullable)
- `end_time` (string, optional, nullable)
- `start_date` (date, optional, nullable)
- `end_date` (date, optional, nullable)
- `min_kwh` (string, optional, nullable)
- `max_kwh` (string, optional, nullable)
- `min_duration` (integer, optional, nullable)
- `max_duration` (integer, optional, nullable)

## Examples

**Response**

```json
{
  "id": 4001,
  "cdr_id": "CDR-2026-09-30-0001",
  "start_date_time": "2026-09-30T08:00:00Z",
  "end_date_time": "2026-09-30T09:15:00Z",
  "cdr_token": {
    "uid": "04A2B3C4D5E6F7",
    "country_code": "NL",
    "party_id": "OCP",
    "type": "RFID",
    "contract_id": "NL-OCP-C12345678-X"
  },
  "auth_method": "WHITELIST",
  "cdr_location": {
    "id": "LOC-AMS-01",
    "name": "Amsterdam depot",
    "evse_uid": "NL*OCP*E1001*1",
    "evse_id": "NL*OCP*E1001*1",
    "connector_id": "1",
    "connector_standard": "IEC_62196_T2",
    "connector_format": "SOCKET",
    "connector_power_type": "AC_3_PHASE"
  },
  "currency": "EUR",
  "charging_periods": [
    {
      "start_date_time": "2026-09-30T08:00:00Z",
      "dimensions": [
        {
          "type": "ENERGY",
          "volume": "22.5"
        }
      ]
    }
  ],
  "total_cost": {
    "excl_vat": "9.20",
    "incl_vat": "11.13"
  },
  "total_energy": "22.5",
  "total_time": "1.25",
  "last_updated": "2026-09-30T09:15:00Z",
  "role": "CPO",
  "origin": "LOCAL",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "country_code": "NL",
  "party_id": "OCP",
  "ocpi_version": "2.2.1",
  "created_at": "2026-09-30T09:15:00Z",
  "updated_at": "2026-09-30T09:15:00Z",
  "session_id": "S-2026-09-30-0001",
  "location_id": "LOC-AMS-01",
  "evse_uid": "NL*OCP*E1001*1",
  "connector_id": "1",
  "charge_point_id": "CP-AMS-001"
}
```

**SDK Code**

```python
import requests

url = "https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001"

querystring = {"country_code":"NL","party_id":"OCP"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/cpo/cdrs/CDR-2026-09-30-0001?country_code=NL&party_id=OCP")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```