---
title: What is idempotency?
description: The property that repeating the same request has the same effect as sending it once. It is what makes retries safe. Why it matters for merchants, and how GaaPay applies it.
url: https://gaapay.com/glossary/idempotency
updated: 2026-12-04
language: en
type: term
---

# What is idempotency?

> Idempotency means repeating the same request has the same effect as sending it once. In payments it is the difference between a timeout and a double charge.

Idempotency means repeating the same request has the same effect as sending it once. In payments it is the difference between a timeout and a double charge.

## Why it matters

Networks fail after the server has already committed. Without an idempotency key, a retry creates a second order or a second delivery. With one, the retry returns the original result — which is why the merchant order reference, not a random id, is the key.

## How GaaPay handles it

`merchant_order_ref` is unique per app and doubles as the idempotency key: repeating it returns the same order. In-flight duplicates return 409 `IDEMPOTENT_INFLIGHT` rather than creating a second order. Webhooks are deduplicated by `event_id`.

## Related terms

- [order](/glossary/order)
- [webhook](/glossary/webhook)
- [nonce](/glossary/nonce)
- [signature](/glossary/signature)

## Questions

### Should I generate a new reference on retry?

No. Reuse the original reference; that is what makes the retry safe. A new reference is a new order.

### Is the webhook idempotent?

Delivery is at-least-once, so your handler must be. Store `event_id` with a unique index and return 2xx on duplicates without repeating the work.

[Open the sandbox](/console) — **See it in a running checkout**: The sandbox runs the same state machine: detected, confirmed, settled — and a webhook you can verify.

## Related

- https://gaapay.com/glossary
- https://gaapay.com/chains
- https://gaapay.com/docs/concepts
