We are currently implementing logic to handle duplicate requests and need to ensure idempotency for the RefundLineItem mutation.
Does this mutation natively support passing an idempotencyKey (as an argument or header)?
If native support is not available, is it considered acceptable practice to use the note field within RefundInput to store a unique call identifier for deduplication?
Any advice on the recommended approach would be appreciated. Thanks!
Typically there isn’t idempotency built into mutations via a key. That’s usually reserved for webhook events.
However, it looks like this mutation offers a prop to prevent over-refunding which I think is the most risk:
In my experience, the best way to implement idempotency is to build it yourself in your own database. I typically store the gid of the object created, or in this case it might help to store a response ID of some sort.
Thanks for the advice. However, I am facing a very specific situation where, unfortunately, I cannot support idempotency on my side. The execution actually failed before the response was received.