How do you handle billing when a retry times out twice?

by•

Charging per request makes error handling so much stress. Keying by the payload hash alongside a short-lived payment ID has worked well for us.

That way, if a client retries with the exact same payload, they just fetch the cached result without hitting the core logic or getting billed again. We purge these after about 12 hours.

Are you returning the cached output with a specific header so the client knows it was a replay?

4 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.