Skip to main content

EMP: Search → Book Flow

This guide walks through the complete flow: search for chargers, create a booking with driver_token, and monitor it.

Step 1: Search for chargers

Find available chargers near the driver's location:

curl -s "https://api.petitmonde.energy/api/v1/client/search?\
lat=48.1351&lng=11.5820&radius=25&connector_type=IEC_62196_T2_COMBO&power_min=50" \
-H "X-API-Key: YOUR_API_KEY" | jq .

Parameters:

  • lat, lng — Driver's GPS coordinates
  • radius — Search radius in km (default: 50, max: 200)
  • connector_type — Filter by plug type (optional)
  • power_min — Minimum power in kW (optional)

Key fields in the response:

  • results[].location_id — You'll need this for booking
  • results[].evses[].evse_uid — Specific charger to book
  • results[].evses[].status — Must be AVAILABLE
  • results[].supports_reservation — Must be true

Step 2: Display results to driver

Show the driver:

  • Location name, address, distance
  • Available EVSEs with connector type and power
  • Estimated price (from pricing.estimated_price)
  • Whether reservation is supported

Step 3: Create a booking

When the driver selects a charger and time:

curl -s -X POST https://api.petitmonde.energy/api/v1/client/bookings \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location_id": "DE-ENB-E123456",
"evse_uid": "DE*ENB*E123456*1",
"connector_id": "1",
"reservation_start": "2026-02-10T14:00:00Z",
"reservation_end": "2026-02-10T16:00:00Z",
"external_id": "driver-123-session-456",
"token_strategy": "driver_token",
"customer_id": "cust_abc123"
}' | jq .

Required fields for driver_token:

  • location_id, evse_uid — From the search result
  • reservation_start, reservation_end — ISO 8601, must be at least 15 min in the future
  • customer_id or token_id — Identifies which driver token to use

The response returns the booking in REQUESTED status.

Step 4: Poll for confirmation

curl -s https://api.petitmonde.energy/api/v1/client/bookings/BOOKING_ID \
-H "X-API-Key: YOUR_API_KEY" | jq '{status, cpo_reservation_id}'

Poll every 5–10 seconds until status changes from REQUESTED to CONFIRMED (or EXPIRED if the CPO doesn't respond).

Once confirmed, the driver can navigate to the charger. Their existing RFID card or app token will work — it's already synced to the CPO.

Step 5: Handle the outcome

StatusAction
CONFIRMEDShow the driver the reservation details and charger location
ATTENDINGVehicle detected — charging is about to start
COMPLETEDSession finished — show final price if available
EXPIREDCPO didn't respond — suggest trying another charger
NO_SHOWDriver didn't arrive — may incur a fee

Error Handling

CodeMeaningAction
400Invalid parametersCheck request body, dates must be in the future
404Location/EVSE not foundLocation may have been removed, re-search
409EVSE not availableTime slot taken, try another EVSE or time
429Rate limitedRead Retry-After header, wait and retry