---
title: "Idempotency in API Design — Definition & Engineering Context"
description: "Idempotency is the API design principle where making the same HTTP request multiple times produces identical server state — critical for financial transactions and payment APIs where network failures can cause duplicate requests."
canonical: https://erpstack.io/glossary/idempotency
markdown_url: https://erpstack.io/glossary/idempotency.md
publisher: ERPStack
---

# Idempotency in API Design

> **Definition:** Idempotency is the API design principle where making the same HTTP request multiple times produces identical server state — critical for financial transactions and payment APIs where network failures can cause duplicate requests.

## In depth

In unreliable networks, HTTP requests can be retried. Without idempotency, a retry of a payment POST could double-charge a customer. Idempotent APIs solve this by requiring clients to send a unique Idempotency-Key header with every state-changing request. The server records completed operations by key and returns the original response for duplicates without re-executing the logic. Stripe, PayPal, and all major payment APIs require idempotency keys.

## How ERPStack applies this

We implement idempotency key tables in PostgreSQL with ON CONFLICT DO NOTHING semantics for all payment, payout, and inventory mutation API routes — as demonstrated in an artisan-manufacturing ERP build where 118 idempotent API routes eliminated all payout duplication errors.

## Related reading

- [API-First Development](https://erpstack.io/glossary/api-first)
- [ACID Compliance](https://erpstack.io/glossary/acid-compliance)
- [Artisan Manufacturing ERP Case Study](https://erpstack.io/case-studies/shwet-artistry-erp)
