1. Create a sandbox API key
1
Open Developers → API keys
Sign in to the fleet portal, open Developers in the sidebar, then the API keys tab.
2
Create a key
Click Create key and choose Sandbox. Give it a name that says which system will use it (for example
accounting-sync-dev), and pick its scopes. Read only grants fleet:read; Full access grants every scope. You can also set an expiry date.3
Copy the key now
The full key, such as
cxk_test_7Hq2…, is shown once. Store it in your secret manager. ChargeExpress keeps only a hash, so a lost key cannot be recovered; revoke it and create another.2. Make your first request
Retrieve your fleet. The key needs thefleet:read scope. With a sandbox key this returns your fleet’s sandbox copy, which is created on your first request.
Response
X-Request-Id header such as req_m2k8q4w9z1x7c3v5b6n0p2r4. Log it; it’s the fastest way for support to find your request. If something goes wrong you’ll get an error object instead.
3. Register a webhook endpoint
Webhooks tell you when sessions finish, the wallet is funded, and more. Your endpoint must be a publichttps:// URL on port 443 or 8443.
You can register it in the portal (Developers → Webhooks) or with the API, using a key with webhooks:write:
curl
secret. Like the API key, it is returned only here (and from rotate_secret):
Response
["*"] to subscribe to every event type, including ones added later.
An endpoint registered with a sandbox key belongs to the sandbox: it receives only sandbox events (livemode: false).
4. Verify the signature
Every delivery is aPOST with a JSON event and an X-ChargeExpress-Signature header. Verify it against the raw request body before you trust the payload. This Express handler uses the verifier from Verifying signatures:
server.js
5. Send a test event
Click Send test on the endpoint in the portal, or call the API:curl
ping event to the endpoint straight away and tells you what your server answered. To try a real event shape, send {"type": "session.completed"} (or any other event type) as the body:
Response
/events and are never retried.
6. Run a session in the sandbox
Start a session on a simulated charger from Developers → Sandbox in the fleet portal, and watchsession.started, session.stopped_by_limit and session.completed arrive at your endpoint within seconds. The Sandbox guide walks through it, including a simulated top-up.
Going live
When your integration works against the sandbox:- Create a live key (
cxk_live_…) in the production fleet portal under Developers → API keys → Create key → Live. Live keys are only offered there. - Swap it into your secret store in place of the sandbox key, and change the base URL to
https://partners.chargeexpressltd.com/api/public/v1. Live keys only work there, and sandbox keys only work onhttps://stage.partners.chargeexpressltd.com/api/public/v1. - Register your webhook endpoints again with the live key, and store their new signing secrets. Sandbox endpoints never receive live events.
- If one server receives both sandbox and live events, branch on the event’s
livemode.
Next steps
- Sandbox: simulated chargers, payments and resets.
- Authentication: scopes, sandbox vs live keys, rotation.
- Charging flow: follow your drivers’ sessions and read their cost.
- Webhooks overview: retries, ordering and redelivery.

