Import your products into SCAYLE
Add Images Variants & Stock
- Product Data Management
- Tech
Robert Merten
VP Tech
Images are essential for your products. All products need at least one image to be sellable via SCAYLE. You can add product images that are either stored in the SCAYLE Content Delivery Network (CDN) or images that are self-hosted, for example on your own CDN. Additionally, the Admin API offers endpoints to delete specific product images, update their position, or fetch them. We will focus on the create product image operation in this section. For further information about the other endpoints please refer to Images.
POST /products/{productIdentifier}/images
The productIdentifier
either accepts the product identifier or the reference key. For more details see Identifiers.
When creating product images, you can either self-host the files or upload them to the SCAYLE CDN. When you upload a new image, it will be sorted into the last position. However, you can update the position and attributes after creating a product using the respective Admin API endpoint.
You can upload product images as base64 encoded attachments or by providing the URLs of the existing images. Furthermore, you can add product image meta information as simple attributes (remember, we already used simple attributes to enhance our product data in the Create Product section).
The Admin API supports and recommends the following image file types:
Opting for the SCAYLE CDN is an excellent choice if you don’t operate your own CDN already. However, the SCAYLE CDN only supports specific file types. This network should only be used for product images. Keep in mind that the SCAYLE CDN is not a replacement for content-relation images or a content management system.
Now it is time to add images using the Admin API. We’ll assume that Fashion Store doesn’t have its own CDN, so we’ll use SCAYLE’s. Therefore, we won’t reference the image, but instead upload it using the Admin API. We will also assume the following:
POST /products/1/images
{
"source": {
"url": "https://fashion-store.com/images/image.jpeg"
}
}
Parameter | Type |
---|---|
productIdentifer | In this case we use the id of the product, which was returned after the create product request. Technically, we could also have used the referenceKey . |
source.url | When uploading an image to the CDN, you have to provide an asset source in the source property of an image. You can either specify a URL or a base64-encoded string containing valid binary image data. In our case, we specified the relevant URL. |
Want to take a look at some other scenarios? For example, simply referencing images or uploading images based on binary data. Please see Create Product Image.
Amazing! You have successfully added images to your products via the Admin API.
Import your products into SCAYLE
Robert Merten
VP Tech