Idempotency logic for RefundLineItem mutation

Hello,

We are currently implementing logic to handle duplicate requests and need to ensure idempotency for the RefundLineItem mutation.

  1. Does this mutation natively support passing an idempotencyKey (as an argument or header)?

  2. 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!

Hi @rotanev

Good question.

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.

1 Like

There are some changes coming in this space in 2026-04 version, see Adding idempotency for inventory adjustments and refund mutations - Shopify developer changelog. Hopefully this can address your use case.

2 Likes

Hi @Rob-Shopify ! Thank you for the information. However, the link is not accessible.

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.

The changelog post should be visible again, sorry.

1 Like