Quickstart

From "I have an API key" to a billed test charge session, in five calls.

Download Postman collection

1Get your API key

Ask LotGrids to provision your fleet, or find your key in the Partner Dashboard's API Access tab if you already have an account.

2Mint a driver token
curl https://api.lotgrids.com/v1/driver-tokens \
  -X POST \
  -H "Authorization: ApiKey $LOTGRIDS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "driverEmail": "test.driver@fleetco.com" }'

Save the token from the response — you'll use it for the next two calls.

3Look up the charger's connectors
curl https://api.lotgrids.com/v1/chargers/connectors \
  -X POST \
  -H "Authorization: Bearer $DRIVER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "chargerId": "chg_04af1c" }'

The QR code your driver scans only encodes chargerId — a single charger can have more than one connector, so this is how your app learns what's actually there and which one is free. Show the driver the available ones and use their pick as connectorId below.

4Quote a charge
curl https://api.lotgrids.com/v1/sessions/quote \
  -X POST \
  -H "Authorization: Bearer $DRIVER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "chargerId": "chg_04af1c", "connectorId": "conn_02", "driverEmail": "test.driver@fleetco.com" }'

Note the quotedAmount and subWalletBalance — pick whichever is smaller as your amount for the next step.

5Start the session
curl https://api.lotgrids.com/v1/sessions \
  -X POST \
  -H "Authorization: Bearer $DRIVER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "chargerId": "chg_04af1c", "connectorId": "conn_02", "driverEmail": "test.driver@fleetco.com", "amount": 5000 }'

A 200 with a sessionId means the driver's sub-wallet was debited and the session is authorized. You're done.

Want to know when that session actually finishes instead of polling for it? Register a URL with Set Fleet Webhook once and LotGrids will POST to it — see Webhooks. On a test key, that fires about 60 seconds after Start Charge Session, matching the sandbox's own demo pacing.

The Postman collection above has every request pre-filled, with {{apiKeyTest}}, {{apiKeyLive}}, {{driverToken}}, and {{baseUrl}} as environment variables. Everything defaults to apiKeyTest, so it's safe to run start to finish without setting anything else up — set apiKeyTest once, run Mint Driver Token, and Postman will carry the token into the other requests for you.