Product Image
This service has upsert logic. If a given product_sku
exists in the system, the product image will be updated with the given parameters. If there is no image for the product SKU, it will be created. Data that is not included in the request will be deleted even if it was added before.
Note: Image URLs must be accessible for "Omnitron" in order for the images to be uploaded to the CDN.
Parameter
Data Type
In
Required
Description
api_token
string
header
YES
product_sku
string
body
YES
Product SKU
images
dict
body
YES
Images dictionary. It has url and order keys
url
string
body
YES
Image URL
unit_type
string
body
Stocked quantity type. qty: Quantity
order
integer
body
Image order. Default_value = 0
image_type
string
body
Default or swatch. Swatch is a thumbnail image which is used to show product variants on the website. Defaul_value = default
Insert and Update Images
Request POST
It is used to replace existing downloadable_image
objects with new images or to add images to products that do not have images. Images of the product must be sent in a single request. When more than one image is wanted to be added, if any of them is wrong, none of the images will be added.
Downloadable image(s) the product has, but not in the request body, will be deleted.
Downloadable image(s) the product has also in the request body will be updated with order
and image_type
values.
Downloadable images just in the request body will be created.
Response
Returns the data of the successfully added images.
Retrieve Images
Request GET
In order to access the image data of all products, a request can be made without adding any parameters.
‘content_type’ header represents the response type.
‘Authorization’ header is a required header for authentication. You can retrieve api_token with login.
Path: api/i1/downloadable_image/
Response
When the request is sent without adding any parameters, the image data of all products will be listed on the basis of SKU.
“count” shows how many products exist in the system.
“next” shows the next page url to retrieve the desired image data.
“previous” shows the previous page url to retrieve the desired image data.
“results” shows every image property with detailed field descriptions.
Images are listed in the “images” area of each product.
Retrieve All Images for Given SKU
Request GET
When you want to list images of a particular product, information can be accessed by adding product_sku
information as a query parameter.
‘content_type’ header represents the response type.
‘Authorization’ header is a required header for authentication. You can retrieve api_token with login.
Path: api/i1/downloadable_image/
Response
The ID, URL, order and image_type
information of the images of the specified product will be listed as a response.
Delete All Images
Request POST
Every image for a product with the given SKU can be removed with the following request:
Path: api/i1/downloadable_image/
Response
If the deletion is successful, the transmitted data will be displayed in the response.
Delete a Single Image
Request POST
To delete a single image for a product, an image list should be sent without the image to be deleted.
Path: api/i1/downloadable_image/
Response
After the request is sent, all images belonging to the product will be sent as a response.
Update Order and Image Type
Request POST
To update any field, the POST request should be sent with the original data and the updated field.
Default order value is 0 if not sent with request.
Default image type value is default if not sent with request.
The data that already exists but is not included in the request for the update will be deleted.
Path: api/i1/downloadable_image/
Response
Edited or newly added data will be listed in the response.
Last updated
Was this helpful?