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

source

(Required) String that specifies the fully qualified URL for the image to resize. This is returned in the response to
GET /ccstore/v1/products/{id} or
GET /ccstore/v1/collections/{id}.

height

(Required) The maximum height for the resized image, in pixels. If the request does not include either height or width, the source image is not resized.

width

(Required) The maximum width for the resized image, in pixels. If the request does not include either height or width, the source image is not resized.

quality

A number that lets you control the image resolution quality. The value of quality is a number from 0.0 (worst resolution but fastest load time) to 1.0 (best resolution but slowest load time).

For example, you might want to reduce the resolution of product listing images to speed up image loading times.

The default value of, quality is 1.0.

outputFormat

The format of the converted images. Only JPEG is supported.

alphaChannelColor

The hexadecimal color code for the replacement color of the PNG alpha channel (default is white, FFFFFF).

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.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices