Product and Variation Images in the Trade Catalog: Overview of Methods

Different types of images can be added to products and variations:

  • DETAIL_PICTURE — detailed image, the field is available in the old product card,
  • PREVIEW_PICTURE — preview image, the field is available in the old product card,
  • MORE_PHOTO — additional images.

How to Add an Image to a Created Product

To add or replace an image for a created product, use the methods catalog.productImage.*. Specify the image type and pass an array of two elements in the fileContent parameter:

  • the name of the image file with its extension,
  • the file in base64 encoding.

If the image type is not specified, it will be saved as an additional image MORE_PHOTO.

Quick link: all methods

How to Add an Image When Creating a Product

Use the method catalog.product.add and pass an object in the format {fileData: [value1, value2]} to the previewPicture or detailPicture parameters:

  • value1 — the name of the image file with its extension,
  • value2 — the file in base64 encoding.

Typical use-cases and scenarios

Linking Product and Variation Images with Other Objects

Products. Specify the product ID for which you want to add an image. The list of IDs can be obtained using the methods:

Overview of Methods

Scope: catalog

Who can perform the method: administrator

Method

Description

catalog.productImage.add

Adds an image to a product or variation

catalog.productImage.get

Returns information about a specific product or variation image

catalog.productImage.list

Returns a list of product or variation images

catalog.productImage.delete

Deletes an image from a product or variation

catalog.productImage.getFields

Returns available fields for a product or variation image