Skip to content
Idempotency Ledger

Idempotency audit for payment and order APIs

Find the requests your API charged twice.

Idempotency Ledger reads your request logs, books every write under its idempotency key and shows where a retry created a second charge, a second order or a second payout. Each problem comes with the amount at risk and the fix.

What it flags

Charges by keyNo. 0417

TimeKeyAmount
10:00:00ik_7f3a49.99
10:00:03ik_7f3a49.99
10:05:00ik_c04489.00
10:05:00ik_c04489.00
10:12:00ik_f6119.99

Extra charged+89.00 EUR

What it is

An auditor for idempotency keys. It replays your logged requests against the rules a correct API follows and books each one as first write, safe replay or problem.

Who it is for

Backend and payments engineers, SREs and support leads who need to know whether a customer was really charged twice and why.

What it solves

Retries are normal, but a retry that runs the work again creates real money problems. Logs hide them among thousands of lines. The ledger brings them to the top with totals.

Audit your request log

Paste or open a log export. Nothing is uploaded; parsing and checks run in this page.

One request per line, or a JSON array, or CSV with a header row.

Fields are found by name: time or ts, method, path or url, status, idempotency key, an id of the created object such as charge_id or order_id, amount, currency and customer. Nested JSON and Idempotency-Key headers work too.

Your audit appears here

Paste a log and press Audit log, or load the sample to see every kind of finding.

What the ledger flags

Each repeated key is checked in time order against what a correct server should have done.

  1. Double effect

    Same key, same request, two different created ids. The server ran the work twice. This is the costly one.

  2. Race

    Two copies landed within two seconds and both succeeded. Common with double clicks and aggressive client retries.

  3. Payload mismatch

    An old key came with new parameters. A correct server refuses with 422. Accepting it hides client bugs.

  4. Partial failure

    A 5xx that still created an object, followed by a retry that created another. Only visible when logs carry ids.

  5. No key

    Writes without a key cannot be deduplicated. Two identical ones close together are booked as a duplicate.

  6. Expired reuse

    A key that returns after the window is treated as new work. Choose the window to match your server.

How to use it

  1. Export a log

    Take the requests to one endpoint or service for a time range from your gateway, load balancer or app logs.

  2. Paste or open it

    JSON lines, a JSON array, CSV with headers or plain lines with key=value pairs all work.

  3. Set the key window

    Pick how long your server keeps keys. Stripe style APIs use 24 hours.

  4. Read the ledger

    Problems are listed first with the amount at risk. Open a key to see each line and the fix, then copy the report or download the CSV.

Good to know

  • Double effects are proven only when the log includes the id of the created object. Without ids, repeats are booked as replays.
  • Requests are compared by method, path and body, or by amount, currency and customer when there is no body.
  • Times are shown in UTC, and times without a zone are read as UTC. Lines without a time keep file order.
  • Large logs work, but trim them to the endpoints you care about for a faster read.
  • Nothing leaves your browser. Remove card numbers and personal data before sharing a report anyway.

Questions

What is an idempotency key?

A unique value the client sends with a write. If the same request comes again with the same key, the server returns the first result instead of doing the work twice.

Why is a 409 marked as correct?

It means a second copy arrived while the first was still running and the server refused to run it in parallel. The client can retry later and get the stored result.

Why does a payload mismatch matter if only one was charged?

Accepting new parameters under an old key means the client has a bug that reuses keys. The next time it will create a wrong charge that looks like a replay.

Do I need ids in my logs?

They make the audit precise. Log the id of the object each write created, such as charge_id or order_id.

Talk to the builder

Questions, ideas or a job offer? Send a message on X or Telegram.

Support the builder

If this tool saved you time, you can send a tip to this EVM address from your own wallet.

0xd28Fd90eD69092bd01598f237aad33a0cc9c3EeA