Inventory Set Quantities User Error
An error that occurs during the execution of .
Anchor to FieldsFields
- code (InventorySetQuantitiesUserErrorCode)
- field ([String!])
- message (String!)
- Anchor to codecode•Inventory
Set Quantities User Error Code The error code.
Show enum values
- Anchor to fieldfield•[String!]
The path to the input field that caused the error.
- Anchor to messagemessage•String!non-null
The error message.
Anchor to MutationsMutations
- inventorySetQuantities (InventorySetQuantitiesPayload)
- •mutation
Set quantities of specified name using absolute values. This mutation supports compare-and-swap (CAS) functionality to handle concurrent requests properly.
As of 2026-04, each quantity in
quantitiesmust include avalue. The mutation only updates the quantity if the persisted quantity matches, and otherwise returns aCHANGE_FROM_QUANTITY_STALEerror. In order to opt out of the check for a quantity, explicitly passnullas its. Omittingreturns an error.Before 2026-04, if
is not set to true, the mutation will only update the quantity if the persisted quantity matches thevalue. If thevalue does not match the persisted value, the mutation will return an error. In order to opt out of thecheck, theargument can be set to true.NoteOnly use this mutation if calling on behalf of a system that acts as the source of truth for inventory quantities, otherwise please consider using the inventoryAdjustQuantities mutation.
Opting out of the compare-and-swap check can lead to inaccurate inventory quantities if multiple requests are made concurrently. It is recommended to always pass the expected current quantity as
(orbefore 2026-04) to ensure the accuracy of the inventory quantities, and to opt out of the check (with anull, orbefore 2026-04) only when necessary. For more information, refer to the compare and swap documentation.Note:Only use this mutation if calling on behalf of a system that acts as the source of truth for inventory quantities, otherwise please consider using the inventoryAdjustQuantities mutation.
Opting out of the compare-and-swap check can lead to inaccurate inventory quantities if multiple requests are made concurrently. It is recommended to always pass the expected current quantity as
(orbefore 2026-04) to ensure the accuracy of the inventory quantities, and to opt out of the check (with anull, orbefore 2026-04) only when necessary. For more information, refer to the compare and swap documentation.Note: Only use this mutation if calling on behalf of a system that acts as the source of truth for inventory quantities, otherwise please consider using the <a href="https://shopify.dev/api/admin-graphql/latest/mutations/inventoryAdjustQuantities">inventoryAdjustQuantities</a> mutation.</p> <p>Opting out of the compare-and-swap check can lead to inaccurate inventory quantities if multiple requests are made concurrently. It is recommended to always pass the expected current quantity as <code><span class="PreventFireFoxApplyingGapToWBR">change<wbr/>From<wbr/>Quantity</span></code> (or <code><span class="PreventFireFoxApplyingGapToWBR">compare<wbr/>Quantity</span></code> before 2026-04) to ensure the accuracy of the inventory quantities, and to opt out of the check (with a <code>null</code> <code><span class="PreventFireFoxApplyingGapToWBR">change<wbr/>From<wbr/>Quantity</span></code>, or <code><span class="PreventFireFoxApplyingGapToWBR">ignore<wbr/>Compare<wbr/>Quantity</span></code> before 2026-04) only when necessary. For more information, refer to the <a href="https://shopify.dev/docs/apps/build/orders-fulfillment/inventory-management-apps/manage-quantities-states#compare-and-swap">compare and swap documentation</a>.
CautionAs of 2026-01, this mutation supports an optional idempotency key using the
@idempotentdirective. As of 2026-04, the idempotency key is required and must be provided using the@idempotentdirective. For more information, see the idempotency documentation.Caution:As of 2026-01, this mutation supports an optional idempotency key using the
@idempotentdirective. As of 2026-04, the idempotency key is required and must be provided using the@idempotentdirective. For more information, see the idempotency documentation.Caution: As of 2026-01, this mutation supports an optional idempotency key using the <code>@idempotent</code> directive. As of 2026-04, the idempotency key is required and must be provided using the <code>@idempotent</code> directive. For more information, see the <a href="https://shopify.dev/docs/api/usage/idempotent-requests">idempotency documentation</a>.
Show payload
- Anchor to inputinput•Inventory
Set Quantities Input! required The information required to set inventory quantities.
Show input fields
Arguments