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

# Common workflows

## Provision a charger in a new location

This is the most common setup sequence:

1. list models for a brand
2. create a location
3. create a charger deployment bound to that location

```bash title="Shell"
curl "$BASE_URL/catalog/brands/wallbox/models?page=1&limit=50" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

curl -X POST "$BASE_URL/locations" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Lyon Fleet Depot",
    "address": "8 Rue des Freres Lumiere",
    "city": "Lyon",
    "country": "FR",
    "coordinates": { "latitude": 45.764, "longitude": 4.8357 },
    "timezone": "Europe/Paris",
    "owner_name": "Private Fleet Operations",
    "public": false
  }'

curl -X POST "$BASE_URL/chargers" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "identity": "CP-FAST-201",
    "brand_slug": "abb",
    "model_slug": "terra-184",
    "connector_type": "CCS2",
    "ws_url": "wss://example-ocpp-backend.test/ws",
    "ocpp_version": "OCPP2.0.1",
    "charge_point_name": "Fast Bay 01",
    "location_id": "4090477f-a416-4515-a302-97aa344a0a2a",
    "location_name": "Lyon Fleet Depot"
  }'
```

```python title="Python"
import os
from ocpplab import OcpplabSDK

client = OcpplabSDK(
    token=os.environ["ACCESS_TOKEN"],
    base_url=os.environ["BASE_URL"],
)

models = client.catalog.list_models(brand_slug="wallbox", page=1, limit=50)

location = client.locations.create(
    name="Lyon Fleet Depot",
    address="8 Rue des Freres Lumiere",
    city="Lyon",
    country="FR",
    coordinates={"latitude": 45.764, "longitude": 4.8357},
    timezone="Europe/Paris",
    owner_name="Private Fleet Operations",
    public=False,
)

client.chargers.create(
    identity="CP-FAST-201",
    brand_slug="abb",
    model_slug="terra-184",
    connector_type="CCS2",
    ws_url="wss://example-ocpp-backend.test/ws",
    ocpp_version="OCPP2.0.1",
    charge_point_name="Fast Bay 01",
    location_id=location.id,
    location_name="Lyon Fleet Depot",
)
```

```javascript title="Node.js"
import { OcpplabSDK } from "ocpplab";

const client = new OcpplabSDK({
  token: process.env.ACCESS_TOKEN!,
  baseUrl: process.env.BASE_URL!,
});

const models = await client.catalog.listModels("wallbox", { page: 1, limit: 50 });

const location = await client.locations.create({
  name: "Lyon Fleet Depot",
  address: "8 Rue des Freres Lumiere",
  city: "Lyon",
  country: "FR",
  coordinates: { latitude: 45.764, longitude: 4.8357 },
  timezone: "Europe/Paris",
  owner_name: "Private Fleet Operations",
  public: false,
});

await client.chargers.create({
  identity: "CP-FAST-201",
  brand_slug: "abb",
  model_slug: "terra-184",
  connector_type: "CCS2",
  ws_url: "wss://example-ocpp-backend.test/ws",
  ocpp_version: "OCPP2.0.1",
  charge_point_name: "Fast Bay 01",
  location_id: location.id,
  location_name: "Lyon Fleet Depot",
});
```

## Bulk-provision chargers from a template

Use `location_chargers.create` with one or more `ChargerGroup` entries to stamp out many chargers at once.

```bash title="Shell"
curl -X POST "$BASE_URL/locations/$LOCATION_ID/chargers" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "template": {
        "brand_slug": "alfen",
        "model_slug": "alfen_eve_double_pg_line_de",
        "connector_type": "Type2",
        "ocpp_version": "OCPP1.6",
        "ws_url": "wss://ocpp.ocpplab.com",
        "identity_prefix": "SITE_01_",
        "template_name": "Bay"
      },
      "charger_ids": ["001", "002"]
    }
  ]'
```

```python title="Python"
from ocpplab import ChargerGroup, ChargerTemplate

client.location_chargers.create(
    location_id=LOCATION_ID,
    request=[
        ChargerGroup(
            template=ChargerTemplate(
                brand_slug="alfen",
                model_slug="alfen_eve_double_pg_line_de",
                connector_type="Type2",
                ocpp_version="OCPP1.6",
                ws_url="wss://ocpp.ocpplab.com",
                identity_prefix="SITE_01_",
                template_name="Bay",
            ),
            charger_ids=["001", "002"],
        )
    ],
)
```

```javascript title="Node.js"
await client.locationChargers.create({
  location_id: LOCATION_ID,
  body: [
    {
      template: {
        brand_slug: "alfen",
        model_slug: "alfen_eve_double_pg_line_de",
        connector_type: "Type2",
        ocpp_version: "OCPP1.6",
        ws_url: "wss://ocpp.ocpplab.com",
        identity_prefix: "SITE_01_",
        template_name: "Bay",
      },
      charger_ids: ["001", "002"],
    },
  ],
});
```

## Spin up a CPO bundle from a preset

```bash title="Shell"
curl -X POST "$BASE_URL/ocpi/cpos" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "small-urban-ac",
    "country_code": "FR",
    "party_id": "DEM",
    "name_prefix": "demo"
  }'
```

```python title="Python"
cpo = client.ocpi_cpos.create(
    template="small-urban-ac",
    country_code="FR",
    party_id="DEM",
    name_prefix="demo",
)
```

```javascript title="Node.js"
const cpo = await client.ocpiCpos.create({
  template: "small-urban-ac",
  country_code: "FR",
  party_id: "DEM",
  name_prefix: "demo",
});
```

## Run a bulk transaction command in one location

When `charger_ids` is omitted, location-scoped command routes target all chargers in the location.

```bash title="Shell"
curl -X POST "$BASE_URL/locations/$LOCATION_ID/chargers/start-transaction" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id_tag": "TAG-RFID-001",
    "evse_id": 1,
    "connector_id": 1
  }'
```

```python title="Python"
client.location_chargers.start_transaction(
    location_id=LOCATION_ID,
    id_tag="TAG-RFID-001",
    evse_id=1,
    connector_id=1,
)
```

```javascript title="Node.js"
await client.locationChargers.startTransaction(LOCATION_ID, {
  id_tag: "TAG-RFID-001",
  evse_id: 1,
  connector_id: 1,
});
```

To target only a subset:

```bash title="Shell"
curl -X POST "$BASE_URL/locations/$LOCATION_ID/chargers/start-transaction" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "charger_ids": ["dep-123", "dep-124"],
    "id_tag": "TAG-RFID-001",
    "evse_id": 1,
    "connector_id": 1
  }'
```

```python title="Python"
client.location_chargers.start_transaction(
    location_id=LOCATION_ID,
    charger_ids=["dep-123", "dep-124"],
    id_tag="TAG-RFID-001",
    evse_id=1,
    connector_id=1,
)
```

```javascript title="Node.js"
await client.locationChargers.startTransaction(LOCATION_ID, {
  charger_ids: ["dep-123", "dep-124"],
  id_tag: "TAG-RFID-001",
  evse_id: 1,
  connector_id: 1,
});
```

## Inspect logs after a command

Use logs as the first verification tool after sending commands:

```bash title="Shell"
curl "$BASE_URL/chargers/$CHARGER_ID/logs?start_date=2026-04-09T00:00:00Z&end_date=2026-04-09T23:59:59Z&event=BootNotification&limit=100&offset=0" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

```python title="Python"
logs = client.chargers.list_logs(
    charger_id=CHARGER_ID,
    start_date="2026-04-09T00:00:00Z",
    end_date="2026-04-09T23:59:59Z",
    event="BootNotification",
    limit=100,
    offset=0,
)
```

```javascript title="Node.js"
const logs = await client.chargers.listLogs(CHARGER_ID, {
  start_date: "2026-04-09T00:00:00Z",
  end_date: "2026-04-09T23:59:59Z",
  event: "BootNotification",
  limit: 100,
  offset: 0,
});
```

Typical response shape:

```json
{
  "data": [
    {
      "direction": "cp_to_csms",
      "action": "BootNotification",
      "message": "[2,\"boot-001\",\"BootNotification\",{\"charge_point_vendor\":\"OCPPLAB\",\"charge_point_model\":\"SDK-DC-50\"}]",
      "timestamp": "2026-04-09T09:30:00Z"
    }
  ],
  "total": 1,
  "limit": 1000,
  "offset": 0
}
```

## Update configuration and clear cache

```bash title="Shell"
curl -X POST "$BASE_URL/chargers/$CHARGER_ID/configuration" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "HeartbeatInterval": "30",
    "MeterValuesSampledInterval": "15"
  }'

curl -X POST "$BASE_URL/chargers/$CHARGER_ID/cache/reset" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

```python title="Python"
client.chargers.update_configuration(
    charger_id=CHARGER_ID,
    HeartbeatInterval="30",
    MeterValuesSampledInterval="15",
)
client.chargers.reset_cache(charger_id=CHARGER_ID)
```

```javascript title="Node.js"
await client.chargers.updateConfiguration(CHARGER_ID, {
  HeartbeatInterval: "30",
  MeterValuesSampledInterval: "15",
});
await client.chargers.resetCache(CHARGER_ID);
```

## Manage the local authorization list

```bash title="Shell"
curl -X POST "$BASE_URL/chargers/$CHARGER_ID/local-auth-list" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "list_version": 2,
    "entries": [
      { "id_tag": "TAG-RFID-001", "expiry_date": "2026-12-31T23:59:59Z" },
      { "id_tag": "TAG-RFID-002", "expiry_date": "2026-06-30T23:59:59Z" }
    ]
  }'
```

```python title="Python"
client.chargers.set_local_auth_list(
    charger_id=CHARGER_ID,
    list_version=2,
    entries=[
        {"id_tag": "TAG-RFID-001", "expiry_date": "2026-12-31T23:59:59Z"},
        {"id_tag": "TAG-RFID-002", "expiry_date": "2026-06-30T23:59:59Z"},
    ],
)
```

```javascript title="Node.js"
await client.chargers.setLocalAuthList(CHARGER_ID, {
  list_version: 2,
  entries: [
    { id_tag: "TAG-RFID-001", expiry_date: "2026-12-31T23:59:59Z" },
    { id_tag: "TAG-RFID-002", expiry_date: "2026-06-30T23:59:59Z" },
  ],
});
```

## Inject and clear a fault

```bash title="Shell"
curl -X POST "$BASE_URL/chargers/$CHARGER_ID/inject-fault?fault_type=OverCurrent&evse_id=1&connector_id=1" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

```python title="Python"
client.chargers.inject_fault(
    charger_id=CHARGER_ID,
    fault_type="OverCurrent",
    evse_id=1,
    connector_id=1,
)
```

```javascript title="Node.js"
await client.chargers.injectFault(CHARGER_ID, {
  fault_type: "OverCurrent",
  evse_id: 1,
  connector_id: 1,
});
```

Use the corresponding clear-fault route to return the charger to a healthy state after your test run.