Skip to main content

productVariantStocksUpdate Mutation

Updates stocks for product variant.

Requires the MANAGE_PRODUCTSpermission.

Triggers the following webhook events:

  • PRODUCT_VARIANT_STOCK_UPDATED (async): A product variant stock is updated.
  • PRODUCT_VARIANT_BACK_IN_STOCK (async): A product variant stock transitioned from no availability to available quantity.
  • PRODUCT_VARIANT_OUT_OF_STOCK (async): A product variant stock transitioned from available quantity to no availability.
  • PRODUCT_VARIANT_BACK_IN_STOCK_IN_CHANNEL (async): A product variant is back in stock in a channel (non click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_OUT_OF_STOCK_IN_CHANNEL (async): A product variant is out of stock in a channel (non click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_BACK_IN_STOCK_FOR_CLICK_AND_COLLECT (async): A product variant is back in stock in a channel (click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_OUT_OF_STOCK_FOR_CLICK_AND_COLLECT (async): A product variant is out of stock in a channel (click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

productVariantStocksUpdate(
sku: String
stocks: [StockInput!]!
variantId: ID
): ProductVariantStocksUpdate
Details
type ProductVariantStocksUpdate {
productVariant: ProductVariant
bulkStockErrors: [BulkStockError!]! @deprecated
errors: [BulkStockError!]!
}

Arguments

sku ● String

SKU of product variant for which stocks will be updated.

stocks ● [StockInput!]!

Input list of stocks to create or update.

variantId ● ID

ID of a product variant for which stocks will be updated.

Type

ProductVariantStocksUpdate

Updates stocks for product variant.

Requires the MANAGE_PRODUCTSpermission.

Triggers the following webhook events:

  • PRODUCT_VARIANT_STOCK_UPDATED (async): A product variant stock is updated.
  • PRODUCT_VARIANT_BACK_IN_STOCK (async): A product variant stock transitioned from no availability to available quantity.
  • PRODUCT_VARIANT_OUT_OF_STOCK (async): A product variant stock transitioned from available quantity to no availability.
  • PRODUCT_VARIANT_BACK_IN_STOCK_IN_CHANNEL (async): A product variant is back in stock in a channel (non click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_OUT_OF_STOCK_IN_CHANNEL (async): A product variant is out of stock in a channel (non click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_BACK_IN_STOCK_FOR_CLICK_AND_COLLECT (async): A product variant is back in stock in a channel (click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.

  • PRODUCT_VARIANT_OUT_OF_STOCK_FOR_CLICK_AND_COLLECT (async): A product variant is out of stock in a channel (click-and-collect warehouses).

Note: Triggered only when the useLegacyShippingZoneStockAvailability shop setting is disabled.