Admin API / Mutations

updateProduct

Changes one listing. An omitted or null field does not change. variants replaces the variants of the listing: a stored variant that the list does not name is removed, with its stock. Omit variants to keep the variants as they are. adjustProductVariantQuantities changes stock by a delta. variantChanges adds, changes and removes the variants that it names, and keeps each other variant as it is stored when the change runs. media replaces the photos of the listing. mediaChanges adds and removes the photos and videos that it names, and keeps each other item as it is stored when the change runs. On a live auction listing, saleMode.liveAuction changes the auction settings, and the price of its one variant sets the auction floor; saleMode.buyNow cancels an auction that has not started, and the listing is a Buy Now listing whose other fields follow the Buy Now rules in the same call. While the auction runs, these give AuctionInProgressError. On a timed auction or giveaway listing, saleMode, variants and variantChanges give ProductValidationError with UNSUPPORTED_FOR_SALE_MODE. The other fields can change. The caller must be able to change the listing (Product.viewer.canEdit). A repeat with no new variant, no media photo by upload or fileUrl, no mediaChanges.remove and no shipping.shippingProfileId writes the same values. A repeat of mediaChanges.add adds no photo again, and a repeat of mediaChanges.remove gives MEDIA_NOT_FOUND. A repeat with expectedMediaIds after the first call changed the photos returns ProductMediaChangedError. A repeat with expectedVariantIds after the first call added or removed a variant returns ProductVariantsChangedError.

Requires a client key with one of these scopes: admin:products:writeRequires this member role or higher: SELLER
updateProduct(
  input: UpdateProductInput!
): UpdateProductPayload!

Arguments

ArgumentTypeDescription
inputUpdateProductInput!The listing and the fields to change.

Return type

UpdateProductPayload!