When I was creating a product, there were images in my product description. The current image URLs are the image urls of CJ. I hope to upload the images to Shopify and obtain the image URL, and replace the image URL of CJ with the image Url of Shopify. How can I do this?
Which api does it need to use?
I don’t think there’s one specific API that will take your existing image URLs, upload a image and replace the existing image URLs with the Shopify one - but you should be able to do this in separate steps.
Create a new product or locate the ID of the existing product you want to add images to.
Use the POST /admin/api/2023-10/products/{product_id}/images.json endpoint to upload a new image. In the request body, you need to include the src field which should contain the source URL of the image you want to upload. Here is an example:
Shopify will upload the image from the source URL you provided to their servers. Once the image is uploaded, the response will include the new image object with its ID and the new URL on Shopify’s servers. You can use this URL to replace the old one in your product description.
I have tried this before, and the uploaded image will also display the images in the shopify product images, which is not what I want. Is there any way I can upload an image without displaying it in the shopify product image?