Skip to main content
Anchor to InventorySetQuantitiesPayload

InventorySetQuantitiesPayload

payload

Return type for inventorySetQuantities mutation.

Anchor to inventoryAdjustmentGroupinventoryAdjustmentGroup
•InventoryAdjustmentGroup

The group of changes made by the operation.

Show fields
•[InventorySetQuantitiesUserError!]!
non-null

The list of errors that occurred from executing the mutation.

Show fields

Was this section helpful?

Anchor to Mutations with this payloadMutations with this payload

•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 quantities must include a changeFromQuantity value. The mutation only updates the quantity if the persisted quantity matches changeFromQuantity, and otherwise returns a CHANGE_FROM_QUANTITY_STALE error. In order to opt out of the check for a quantity, explicitly pass null as its changeFromQuantity. Omitting changeFromQuantity returns an error.

Before 2026-04, if ignoreCompareQuantity is not set to true, the mutation will only update the quantity if the persisted quantity matches the compareQuantity value. If the compareQuantity value does not match the persisted value, the mutation will return an error. In order to opt out of the compareQuantity check, the ignoreCompareQuantity argument can be set to true.


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 changeFromQuantity (or compareQuantity before 2026-04) to ensure the accuracy of the inventory quantities, and to opt out of the check (with a null changeFromQuantity, or ignoreCompareQuantity before 2026-04) only when necessary. For more information, refer to the compare and swap documentation.



Caution

As of 2026-01, this mutation supports an optional idempotency key using the @idempotent directive. As of 2026-04, the idempotency key is required and must be provided using the @idempotent directive. For more information, see the idempotency documentation.


Show payload

Arguments

•InventorySetQuantitiesInput!
required

The information required to set inventory quantities.

Show input fields


Was this section helpful?