Rest Api Product Image Upload

We are using REST API to create new product in the system. We are using the POST request on Product Entity: https://docs.cs-cart.com/latest/developer_guide/api/entities/products.html

We are not able to figure out a way to upload image for new product through the REST API. Can someone please help? Any sample Postman/Curl?

Would be really thankful.

Hi, I have the same problem. Did you find a way to upload images via a API? BR Mario

Yea, is there any solution?

I wonder if there is any solution for this, already many people asking.

Hi everybody,

had same problems with main image and gallery images upload; Solved the upload during the creation of a new product (POST METHOD), but i'm still working on updating an existing gallery (e.g. deleting an image from product gallery but preserving the other ones).

- (tested and working) UPLOAD IMAGES VIA POST METHOD (i.e. CREATING A NEW PRODUCT)

{
    "main_pair": {
        "detailed": {
            "image_path": "valid_image_path"
        }
    },
    "image_pairs": [
        {
            "detailed": {
                "image_path": "valid_image_path"
            }
        },
        {
            "detailed": {
                "image_path": "valid_image_path"
            }
        }
    ]
}

- (still working on it..) UPDATE EXISTING PRODUCT GALLERY VIA PUT METHOD (i.e. deleting an image from the gallery but preserving the other ones)

*here i'm passing only the current existing gallery image that i want to preserve

{  
    "image_pairs": [
        {
            "detailed": {
                "image_path": "the current image path"
            }
        }
    ]
}

This is not working if i pass as image_path the current existing gallery image path BUT it WORKS if I pass fresh new images. I suppose that's because cs cart FIRST deletes all the images into the gallery THEN try to re-upload them following the no-longer-existing-image-path, the images it has just deleted.. -_- ).

Possible solution when updating the product gallery? re-uploading all the images you want to preserve.