Is an idempotency key the same as a primary key?
It can be. The point is that the sender's id is unique in your store.
Glossary
Idempotency means doing the same operation twice has the same result as doing it once. The second call does not create a second charge, a second invoice, or a second stock deduction.
A webhook from a payment provider will be delivered more than once. Store the provider event id and ignore a repeat. The same rule applies when a POS sells offline and syncs later. Kasheer POS keeps selling when the connection drops and syncs when it returns. A retry of that sync must not create a second ZATCA invoice for the same sale.
KiipList has the sibling problem on stock. A sale on one channel has to reduce quantity once, on every channel, not twice because two workers processed the same order.
It can be. The point is that the sender's id is unique in your store.
Kasheer POS.
KiipList.
No. The check is part of the slice that touches payments or sync.