Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Idempotency key

A unique id attached to a request so the receiver can recognise a repeat and not perform the same action twice.

Say it to an AI

Express 5 + Prisma handler for payment.succeeded webhooks that credits the user's wallet. Delivery is at-least-once, so make it idempotent: use event.id as the idempotency key in a unique-keyed table and insert it plus the balance increment in one database transaction.

How an expert would brief the stronger version of “Wallet top-up webhook”.

See it

Try it as a puzzle →

Endpoint in a savings app that tops up a user's wallet when the payment provider reports a successful card payment.

Study A · the stronger one
Study B · the weaker one

Why: A uses the provider's event.id as the key, stored in the webhookEvent table with skipDuplicates: true.

Related words

  • Edge case
  • Guard clause
  • Swallowed exception
  • Fail fast
  • Side effect
  • Log level
  • Custom error class
  • instanceof check

Room 4 · Errors & edge cases

Learn “Idempotency key” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle