Image Upload Basics

Image Upload Basics

Here's a list of things to keep in mind when trying to upload images for products with the API:

  • Uploading images is done with the following endpoint: /api/2.0/products/{product_id}/actions/image_upload.
  • The request has to be multipart/form-data with the binary image data submitted as the value of the image field of the form.
  • Images can be in jpg|jpeg|png|gif|tiff|tif|webp formats.
  • There is a maximum 10MB filesize for the images.
  • The image CANNOT be submitted as the URL pointing to the file.
  • It's not possible to attach image information to the request when creating a product. Creating a product and uploading the image has to happen with two separate requests.
  • If uploading the same image multiple times to the same product, the image will be reused, not added multiple times. This is not considered an error case.
  • This API is not for adding variant level images.
  • A product can have a maximum of 250 images.

Code samples

We've prepared a number of simple code examples for different languages showing how a locally available image file can be uploaded to Lightspeed Retail (X-Series):