To resize an existing image, you use the Store API, which provides access to the storefront. Issue a GET request to the /ccstore/v1/images
endpoint. The following table describes the query parameters you specify in the request.
Property | Description |
---|---|
| (Required) String that specifies the fully qualified URL for the image to resize. This is returned in the response to |
| (Required) The maximum height for the resized image, in pixels. If the request does not include either |
| (Required) The maximum width for the resized image, in pixels. If the request does not include either |
| A number that lets you control the image resolution quality. The value of For example, you might want to reduce the resolution of product listing images to speed up image loading times. The default value of, |
| The format of the converted images. Only |
| The hexadecimal color code for the replacement color of the PNG alpha channel (default is white, |
For example, the following request resizes a product image to 500x500:
GET /ccstore/v1/images/?source=/file/v7875483805069966233/products /APP_WeekendTrouser_full.jpg&height=500&width=500
Commerce Cloud images are cached by default in the Content Delivery Network (CDN). In this example, v7875483805069966233 is a timestamp that is automatically generated in URLs for product images. If you use the /images endpoint for other images, and you expect that you will update or resize images, it is important to include cache busting in the URL so that client browsers get the updated image and not a cached version.