Skip to main content

productImageAdd

Requires permission products:product:update.

Adds a staged image (purpose PRODUCT_IMAGE) to the end of a product's gallery, or a variant's when variantId is given. It becomes the main image only when the gallery was empty. URLs are not accepted.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation ProductImageAdd($input: ProductImageAddInput!) {
productImageAdd(input: $input) {
id
name
status
createdAt
basePrice
baseUOMId
baseUOM {
id
code
colorCode
name
pluralName
createdAt
}
}
}

Variables:

{
"input": {
"productId": "id",
"stagedUploadKey": "string"
}
}

Response:

{
"data": {
"productImageAdd": {
"id": "id",
"name": "string",
"status": "ACTIVE",
"createdAt": "2025-01-15T00:00:00Z",
"basePrice": 0,
"baseUOMId": "id",
"baseUOM": {
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
}
}
productImageAdd(
input: ProductImageAddInput!
): Product!

Arguments​

productImageAdd.input ● ProductImageAddInput! non-null input​

The product or variant, and the staged image.

Type​

Product object​

A product: the master record with its variants, categories, units of measure and stock.