Start here. This is the direct spoken answer to practice first.
Overview
A header and a map are not enough; idempotency is a persisted state machine around one logical operation.
The controller requires an idempotency key, validates its format, and passes it with a canonical request fingerprint to the application service. The service atomically claims the key in a durable store, performs the business transition, and records the terminal response or resource reference. A retry with the same key and same request returns the prior outcome. The same key with a different request is rejected as a conflict.