Quickstart

From "I have an API key" to a billed test charge session, in four 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.

3Quote 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.

4Start 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.

The Postman collection above has all three requests pre-filled, with {{apiKey}}, {{driverToken}}, and {{baseUrl}} as environment variables — set apiKey once, run Mint Driver Token, and Postman will carry the token into the other two requests for you.