Admin API / Types

UpdateProductInput

Input

The listing to change and the fields to change. An omitted or null field does not change.

input UpdateProductInput

Input fields

FieldTypeDescription
collectionIds[ID!]Replaces the memberships of the listing in the manual collections that the caller can manage. A membership in another collection stays. [] removes the memberships that the caller can manage. Each ID at most once; a second use fails with VALIDATION_ERROR. An unknown, deleted, automated or livestream collection gives COLLECTION_NOT_FOUND. An owner-only collection gives UnauthorizedError with requiredRole: ADMIN to a caller below the ADMIN role.
descriptionStringThe long-form description. "" clears it.
expectedMediaIds[ID!]The Product.media IDs that the caller read, in display order. When the stored photos and videos of the listing differ in IDs or order, the call returns ProductMediaChangedError and changes nothing. [] expects no photo or video. Omitted or null: no check.
expectedVariantIds[ID!]The Product.variants IDs that the caller read, in any order. When the stored variants of the listing differ, the call returns ProductVariantsChangedError and changes nothing. A repeated ID never matches. Omitted or null: no check. With variants, the check makes sure that the list removes only the stored variants that the caller read.
media[ProductMediaInput!]Replaces the photos and videos of the listing, in display order. The first is the primary item. Name a stored item by its Product.media ID to keep it; a stored item that the list does not name is removed. [] removes every item. Omitted or null keeps the photos and videos as they are. At most 30 (MEDIA_LIMIT_EXCEEDED). Videos have no separate limit. Each item at most once; a second use fails with VALIDATION_ERROR. A repeat of the same list shows the same items, and an item that the list names by upload or by fileUrl gets a new Product.media ID.
mediaChangesProductMediaChangesInputAdds and removes the photos and videos that it names, and keeps each other item as it is stored when the change runs, in its order. The first item after the change is the primary item. Send mediaChanges or media, not both (VALIDATION_ERROR). {} changes nothing. When add puts an item on the listing, the listing has at most 30 items after the change (MEDIA_LIMIT_EXCEEDED at mediaChanges.add). The count includes each stored item, also an item that Product.media does not return. An add item whose file an item that the change keeps holds is not added again, so a repeat of an add adds nothing and succeeds. An add of the file of a remove item moves it last. A repeat of a remove gives MEDIA_NOT_FOUND. With expectedMediaIds, a repeat after the first call changed the photos returns ProductMediaChangedError.
productIdID!The listing.
saleModeProductSaleModeInputNew settings of the stored sale format: offers on a Buy Now listing, or the auction settings of a live auction listing. buyNow on a live auction listing whose auction has not started makes it a Buy Now listing.
shippingProductShippingInputReplaces every shipping setting, and the parcel and ship-from when sent. When no variant ships after the change, the listing ships free and a sent shipping is ignored. A variant that ships with no setting after the change gives SHIPPING_REQUIRED.
titleNonEmptyStringThe customer-facing title, trimmed.
variantChangesProductVariantChangesInputAdds, changes and removes the variants that it names, and keeps each other variant as it is stored when the change runs: its title, price, stock, SKU and shipping. Send variantChanges or variants, not both (VALIDATION_ERROR). Each productVariantId at most once across change and remove (VALIDATION_ERROR). After the change, the listing has 1 to 999 variants (VARIANT_COUNT_INVALID); a live auction listing has 1, and its price sets the auction floor. A repeat adds each add variant again with a new ID.
variants[ProductVariantInput!]Replaces every variant of the listing, in display order. A stored variant that the list does not name is removed, with its stock. Name a stored variant with productVariantId to keep it. Omit variants to keep the variants as they are. availableQuantity is an absolute value that replaces the stored stock, so a sale between the caller's read and this call is overwritten; adjustProductVariantQuantities changes stock by a delta and keeps such a sale. A repeat of the same list adds each new variant again with a new ID and removes the variant that the first call added. 1 to 999 variants (VARIANT_COUNT_INVALID); a live auction listing has 1, and its price sets the auction floor. Each productVariantId at most once; a second use fails with VALIDATION_ERROR.
visibilityProductVisibilityHIDDEN hides the listing from the storefront; PUBLIC shows it.