> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cariqa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Charging Sessions

> Usage patterns for retrieving charging session data and history

## Session History and Details

### List User's Charging Sessions

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.get(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/",
      headers=headers
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/', {
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    }
  });
  ```
</CodeGroup>

Response includes comprehensive session data:

```json theme={null}
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "ab7ae756-b663-43b9-a025-40c51dd503d9",
      "start_time": "2026-04-02T13:51:18.754610Z",
      "end_time": "2026-04-02T13:51:28.754611Z",
      "duration": 10,
      "consumed_energy": "10.000",
      "is_active": false,
      "evse_id": "DE*CIQ*EELDF6XWZU41P*2",
      "station_info": {
        "station_name": "EVA Charge",
        "station_address": "Ludwigstraße, 9, 67547, Worms",
        "country": "DE",
        "station_speed": "slow",
        "connector_standard": "IEC_62196_T2",
        "connector_power": 22,
        "support_phone": "+4971134214480",
        "latitude": "49.630383",
        "longitude": "8.368902"
      },
      "is_partner": true,
      "logo_url": "https://storage.googleapis.com/cariqa-cpo-logos/evacharge.png?generation=1739874740770603&md5_hash=8dcf9c9d17149760b1c9033218ed1c19&size=11759",
      "user_facing_session_prices": {
        "kwh_price": "0.54",
        "time_price": null,
        "session_fee": null,
        "blocking_fee": null,
        "starting_fee": null,
        "grace_period_minutes": null,
        "blocking_cap": null,
        "currency": "eur"
      },
      "session_cost": {
        "kwh_cost": "5.39",
        "time_cost": "0.00",
        "session_fee_cost": "0.00",
        "blocking_fee_cost": "0.00",
        "starting_fee_cost": "0.00",
        "invoice_download": "https://connect.cariqa.com/download/?<params>",
        "invoice_vat": "0.86",
        "invoice_summary": "5.39",
        "invoice_credits": "0.00",
        "invoice_discount": "0.00",
        "currency": "eur"
      },
	  "rates": 5
    }
  ]
}
```

### Get Single Session Details

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN", 
      "Content-Type": "application/json"
  }

  response = requests.get(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/",
      headers=headers
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/', {
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    }
  });
  ```
</CodeGroup>

Response provides the same detailed session object with complete station information, pricing breakdown, and invoice links.

### Patch Single Session Details

Rate the charging session:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "rates": 5,
    }'
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN", 
      "Content-Type": "application/json"
  }

  data = {
      "rates": 5,
  }

  response = requests.patch(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/",
      headers=headers,
  	json=data
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      rates: 5,
    })
  });
  ```
</CodeGroup>

Response provides the same detailed session object with complete station information, pricing breakdown, and invoice links.

## Start-Stop-CDR Flow

The complete charging lifecycle consists of starting a session, monitoring progress, stopping the session, and receiving the final Charge Detail Record (CDR).

### Start Charging Session

Initiate a charging session by providing the EVSE ID and payment method:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/start/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "evse_id": "DE*CIQ*EELDF6XWZU41P*2",
      "payment_method_id": "pm_1TD1M3HtgZxQ1KXx5wMzfx15"
    }'
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  }

  start_data = {
      "evse_id": "DEALLEGO0034232",
      "payment_method_id": "pm_1ABC123DEF456"
  }

  response = requests.post(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/start/",
      headers=headers,
      json=start_data
  )
  session_start = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/start/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      evse_id: 'DEALLEGO0034232',
      payment_method_id: 'pm_1ABC123DEF456'
    })
  });

  const sessionStart = await response.json();
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "id": "ab7ae756-b663-43b9-a025-40c51dd503d9",
  "start_time": "2026-04-02T13:51:18.754610Z",
  "end_time": null,
  "duration": 0,
  "consumed_energy": "0.000",
  "is_active": true,
  "evse_id": "DE*CIQ*EELDF6XWZU41P*2",
  "station_info": {
    "station_name": "EVA Charge",
    "station_address": "Ludwigstraße, 9, 67547, Worms",
    "country": "DE",
    "station_speed": "slow",
    "connector_standard": "IEC_62196_T2",
    "connector_power": 22,
    "support_phone": "+4971134214480",
    "latitude": "49.630383",
    "longitude": "8.368902"
  },
  "is_partner": true,
  "logo_url": "https://storage.googleapis.com/cariqa-cpo-logos/evacharge.png?generation=1739874740770603&md5_hash=8dcf9c9d17149760b1c9033218ed1c19&size=11759",
  "user_facing_session_prices": {
    "kwh_price": "0.54",
    "time_price": null,
    "session_fee": null,
    "blocking_fee": null,
    "starting_fee": null,
    "grace_period_minutes": null,
    "blocking_cap": null,
    "currency": "eur"
  },
  "session_cost": null,
  "rates": null
}
```

### Stop Charging Session

End the charging session manually by providing the session ID:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/stop/ab7ae756-b663-43b9-a025-40c51dd503d9/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/stop/ab7ae756-b663-43b9-a025-40c51dd503d9/",
      headers=headers
  )
  stop_result = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging/stop/ab7ae756-b663-43b9-a025-40c51dd503d9/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    }
  });

  const stopResult = await response.json();
  ```
</CodeGroup>

### CDR Processing and Final Receipt

After the charging session ends (either manually stopped or automatically), the system receives a Charge Detail Record (CDR) from the charging network that contains the final consumption and cost data. This process happens automatically in the backend:

1. **CDR Reception**: The charging station operator sends consumption data
2. **Session Update**: Final energy consumption, duration, and costs are calculated
3. **Payment Processing**: Pre-authorized amount is captured based on actual consumption
4. **Invoice Generation**: Detailed invoice with breakdown is created
5. **Receipt Availability**: Session data includes final costs and invoice links

Retrieve the final session details with complete CDR data:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.get(
      "https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/",
      headers=headers
  )
  final_session = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://connect.cariqa.com/api/v1/users/9405cf8c-8375-4373-b4d3-b61f9a0c01eb/charging-sessions/ab7ae756-b663-43b9-a025-40c51dd503d9/', {
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    }
  });

  const finalSession = await response.json();
  ```
</CodeGroup>

**CDR-Enhanced Response:**

```json theme={null}
{
  "id": "ab7ae756-b663-43b9-a025-40c51dd503d9",
  "start_time": "2026-04-02T13:51:18.754610Z",
  "end_time": "2026-04-02T13:51:28.754611Z",
  "duration": 10,
  "consumed_energy": "10.000",
  "is_active": false,
  "evse_id": "DE*CIQ*EELDF6XWZU41P*2",
  "station_info": {
    "station_name": "EVA Charge",
    "station_address": "Ludwigstraße, 9, 67547, Worms",
    "country": "DE",
    "station_speed": "slow",
    "connector_standard": "IEC_62196_T2",
    "connector_power": 22,
    "support_phone": "+4971134214480",
    "latitude": "49.630383",
    "longitude": "8.368902"
  },
  "is_partner": true,
  "logo_url": "https://storage.googleapis.com/cariqa-cpo-logos/evacharge.png?generation=1739874740770603&md5_hash=8dcf9c9d17149760b1c9033218ed1c19&size=11759",
  "user_facing_session_prices": {
    "kwh_price": "0.54",
    "time_price": null,
    "session_fee": null,
    "blocking_fee": null,
    "starting_fee": null,
    "grace_period_minutes": null,
    "blocking_cap": null,
    "currency": "eur"
  },
  "session_cost": {
    "kwh_cost": "5.39",
    "time_cost": "0.00",
    "session_fee_cost": "0.00",
    "blocking_fee_cost": "0.00",
    "starting_fee_cost": "0.00",
    "invoice_download": "https://connect.cariqa.com/download/?<params>",
    "invoice_vat": "0.86",
    "invoice_summary": "5.39",
    "invoice_credits": "0.00",
    "invoice_discount": "0.00",
    "currency": "eur"
  },
  "rates": 5
}
```

### Session Status Tracking

The charging session lifecycle is managed through several key fields that change as the session progresses from start to completion:

**Session Lifecycle States:**

1. **Session Initiated** (Start Command Sent):

```json theme={null}
{
  "is_active": true,
  "end_time": null,
  "consumed_energy": "0.000",
  "session_cost": null
}
```

2. **Active Charging** (Energy Consumption Updates):

```json theme={null}
{
  "is_active": true,
  "end_time": null,
  "consumed_energy": "5.420",
  "session_cost": null
}
```

3. **Stop Command Sent** (Manual or Automatic):

```json theme={null}
{
  "is_active": false,
  "end_time": null,
  "consumed_energy": "8.750",
  "session_cost": null
}
```

4. **CDR Received and Processed** (Final State):

```json theme={null}
{
  "is_active": false,
  "end_time": "2026-04-02T13:51:28.754611Z",
  "consumed_energy": "10.000",
  "payg_summary": {
    "kwh_cost": "5.39",
    "time_cost": "0.00",
    "session_fee_cost": "0.00",
    "blocking_fee_cost": "0.00",
    "starting_fee_cost": "0.00",
    "invoice_download": "https://connect.cariqa.com/download/?<params>",
    "invoice_vat": "0.86",
    "invoice_summary": "5.39",
    "invoice_credits": "0.00",
    "invoice_discount": "0.00",
    "currency": "eur"
  }
}
```

**Recommendations:**

* Poll every 10-30 seconds while `is_active: true` for real-time updates
* Continue polling after `is_active: false` until `end_time` is populated but with extended period
* Session is complete when `end_time` is not null
* Check error handling guide for [Start Charging Session](/start-charging-errors-handling) and [Stop Charging Session](/stop-charging-errors-handling).
