commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Product → Upload Product image

AI-generated

Summary

Upload an image for a specified product variant in commercetools by providing a publicly accessible image URL. Attach the image to the master variant or a specific variant via ID or SKU, optionally specifying the filename and whether the image is added to staged or current product data.

Inputs

  • Product ID (required) — The unique identifier of the product to which the image will be uploaded.
  • Image URL (required) — A publicly accessible URL of the image (JPEG, PNG, or GIF, up to 10 MB) that commercetools will fetch.
  • Filename — An optional filename to store alongside the image in commercetools.
  • Variant ID — The ID of the product variant to attach the image to; use 0 to attach to the master variant.
  • SKU — An alternative to Variant ID; the SKU of the product variant to attach the image to.
  • Staged — Boolean flag indicating whether the image should be added to staged product data (true) or current product data (false). Defaults to true.

Output shape

a single JSON object representing the updated product image information as returned by the commercetools API

The operation fetches the image from the provided URL and attaches it to the specified product variant. Errors are returned in a JSON structure noting failure. The node requires commercetools OAuth2 credentials and the project key and region to build the API request URL.

Links

Discussion