--- title: Adding idempotency for inventory adjustments and refund mutations - Shopify developer changelog description: Shopify’s developer changelog documents all changes to Shopify’s platform. Find the latest news and learn about new platform opportunities. source_url: html: https://shopify.dev/changelog/adding-idempotency-for-inventory-adjustments-and-refund-mutations md: https://shopify.dev/changelog/adding-idempotency-for-inventory-adjustments-and-refund-mutations.md --- [Back to Developer changelog](https://shopify.dev/changelog) December 12, 2025 Tags: * Admin GraphQL API * 2026-01 # Adding idempotency for inventory adjustments and refund mutations This changelog relates to [concurrency protection features](https://shopify.dev/changelog/concurrency-protection-features). We're introducing idempotency keys for several inventory and refund mutations. This enhancement helps you build more reliable integrations by preventing duplicate operations when retrying failed requests. You pass idempotency keys in using an `idempotent` directive. Refer to the [idempotent requests docs](https://shopify.dev/docs/api/usage/idempotent-requests) for more details. The following mutations now support the optional `idempotent` directive: * [`refundCreate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/refundCreate) * [`inventoryShipmentReceive`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryShipmentReceive) * [`inventoryAdjustQuantities`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryAdjustQuantities) * [`inventoryMoveQuantities`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryMoveQuantities) * [`inventorySetQuantities`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventorySetQuantities) * [`inventorySetOnHandQuantities`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventorySetOnHandQuantities) * [`inventoryShipmentCreateInTransit`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryShipmentCreateInTransit) * [`inventoryShipmentCreate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryShipmentCreate) * [`inventoryTransferCreate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryTransferCreate) * [`inventoryTransferCreateAsReadyToShip`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryTransferCreateAsReadyToShip) * [`inventoryTransferDuplicate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryTransferDuplicate) * [`inventoryTransferSetItems`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryTransferSetItems) * [`inventorySetScheduledChanges`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventorySetScheduledChanges) * [`inventoryActivate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryActivate) * [`inventoryShipmentAddItems`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/inventoryShipmentAddItems) * [`locationActivate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/locationActivate) * [`locationDeactivate`](https://shopify.dev/docs/api/admin-graphql/2026-01/mutations/locationDeactivate) > **Note**: While the `idempotent` directive is optional for now, we plan to make it mandatory for these mutations in version `2026-04`. ## How to use the directive An idempotency key is a unique identifier (we recommend using a UUID) that you provide when making a mutation request (generally, you would regenerate this key on page load and after successful operations). If you retry the same request with the same idempotency key due to network issues or timeouts, Shopify will recognize it as a duplicate and ensure the inventory is only adjusted once (or that the refund is only created once), protecting against double-counting. It will return the result of the original operation instead of creating a new one. Example usage: ``` mutation { inventoryAdjustQuantities( input: { reason: "restock" name: "available" changes: [{ delta: 5 inventoryItemId: "gid://shopify/InventoryItem/123" locationId: "gid://shopify/Location/456" }] } ) @idempotent(key: "4f5b6ebf-143c-4da5-8d0f-fb8553bfd85d") { inventoryAdjustmentGroup { id } userErrors { code message } } } ``` ## Why we made this change Idempotency keys are essential for building robust, production-ready integrations. Network failures and timeouts are inevitable, and without idempotency protection, retrying requests could lead to duplicate refunds, incorrect inventory counts, or other data inconsistencies. Making this feature publicly available gives you the tools to handle these scenarios safely. ## Error codes If there's an issue with your idempotency key usage, you'll receive one of these error codes: * `IDEMPOTENCY_CONCURRENT_REQUEST`: Another request with the same idempotency key is currently being processed. * `IDEMPOTENCY_KEY_PARAMETER_MISMATCH`: The same idempotency key was used with different parameters.