docs: describe idempotent POST charge external IDs#36
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 780d3a3c54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| stable `ExternalID`. The value is included in the MPP charge request and echoed | ||
| back in the `Payment-Receipt`, so servers can distinguish a safe retry from a | ||
| different paid operation. |
There was a problem hiding this comment.
Clarify that ExternalID does not enforce idempotency
For paid POST retries, ExternalID is only serialized into the challenge/receipt; server.Mpp.Charge does not persist or reject previously seen IDs, so a retry after the paid operation succeeds but the response is lost can still run the POST side effect again unless the application keeps its own idempotency record keyed by Idempotency-Key. This wording makes the new section sound like passing the header through is enough to make retries safe, so it should explicitly mention the required app-side idempotency/cache check before performing the operation.
Useful? React with 👍 / 👎.
Signed-off-by: EfeDurmaz16 <[email protected]>
|
Addressed the ExternalID/idempotency clarification in commit d7dce81. The README now states that ExternalID is receipt metadata only and that applications still need their own idempotency record/cache before running paid side effects. Verified with |
Summary
Documents how to use
ChargeParams.ExternalIDfor idempotent paid POST routes and agent tool calls.The Go SDK already includes
ExternalIDin the charge request and echoes it back in thePayment-Receipt. This README section shows how to pass an existingIdempotency-Keyheader through as the stable operation ID so retries can be distinguished from different paid operations.Changes
Idempotent POST Chargessection to the READMEIdempotency-Keymapped intoChargeParams.ExternalIDVerification
git diff --checkgo test ./...