Menu

A paid API request timed out. Should the retry charge again?
📰

A paid API request timed out. Should the retry charge again?

DEV Community: backend·midday.day·9 days ago
#eop4JOsw
#devtobackend#devto#dev#payment#settlement
Reading 0:00
15s threshold

Your client sends a paid request for a report. The connection times out. Did the payment fail, did the upstream service fail, or did everything finish except delivery of the response?

A timeout cannot answer that question. Automatically authorizing another payment turns a transport failure into a possible duplicate charge.

For an x402 pay-per-call API, the useful default is to recover the original operation before creating another paid operation.

Payment success is not request success

Keep payment state separate from fulfillment state. Verification checks whether a payment payload meets the payment requirements. Settlement concerns the movement of funds. Neither proves that your upstream API produced the report or that the buyer received it.

The official facilitator documentation distinguishes verification from settlement. Its settlement recovery behavior also depends on the mechanism and implementation.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.