Skip to main content

How it works

For any POST endpoint, include an Idempotency-Key header to ensure the request is only processed once:
curl -X POST https://api.ledger.so/v1/customers \
  -H "Authorization: Bearer $LEDGER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-customer-abc123" \
  -d '{"email": "[email protected]", "firstName": "Dev", "lastName": "Example", "type": "individual"}'
If you send the same idempotency key again with the same request, you will receive the original response.

Rules

  • Idempotency keys are scoped to the endpoint and HTTP method
  • Reusing a key for a different route or method returns 409 Conflict
  • Keys can be any string — UUIDs work well
  • Keys are only required for POST requests. GET, PATCH, and DELETE are naturally idempotent