Idempotency ensures that making the same request multiple times has the same effect as making it once. This prevents duplicate operations when network issues or retries occur.

Use Idempotency only with POST request. Not needed for GET and DELETE requests.

How It Works

Include an Idempotency-Key header with a unique value for POST requests:

curl -X POST https://api.chargeapi.co/v1/charging_sessions \
  -H "Authorization: Bearer ch_sk_test_..." \
  -H "Idempotency-Key: unique_key_123" \
  -d '{"vehicle": "veh_123", "station": "sta_456"}'

Key Expiration
Idempotency keys expire after 24 hours. After expiration, the same key can be reused.

Key Uniqueness
Never reuse the same idempotency key for different operations. Each request should have a unique key.