Product Image URL

When a product has an image uploaded, the image can be used for example in a Configurator or on a Dashboard.

The URL to retrieve the image has the following pattern:

/pricefx/<partition>/productimages.get/<sku>?predefinedSize=<sizePreset>

or

/pricefx/<partition>/productimages.get/<sku>?width=<widthInPx>&height=<heightInPx>&type=<resizeStrategy>

predefinedSize – (String) Predefined preset for a size. Resizes the image to the size specified in the Pricefx server settings. This will use predefined values of the parameters width, height and type. The width and height will be taken from the Pricefx server settings, and the type value will be BOXED_SIZE_FIT.The available values are:

  • "thumbnail" – Default values are width = 32, height= 32.

  • "enlarged_thumbnail" – Default values are width = 124, height= 124.

  • "product_detail" – Default values are width = 800, height= 600.

width – (integer) Width of the image in pixels. For example "100"

height – (integer) Height of the image in pixels. For example "200"

type – (String) Strategy how the image should be resized.

  • FIXED_WIDTH – Resizes the height accordingly to the aspect ratio of the original image.

  • FIXED_HEIGHT – Resizes the width accordingly to the aspect ratio of the original image.

  • BOXED_SIZE_CROP – Resizes the image to fill the specified box size – the image is cropped.

  • BOXED_SIZE_FIT – Resizes the image keeping the aspect ratio and fitting the longest size to the specified box.

Technical Notes:

  • This will work only for authenticated users in the same partition.

  • You can specify the image size in the URL so that the image is not retrieved in its full size and resized in the browser.

  • The resized images are cached using the standard HTTP caching making them quicker to load next time.

Found an issue in documentation? Write to us.