Proper way to upload images using API

Solved
lucasconde
Tourist
11 0 3

Hi, I'm developing a small integration to import a data feed to my store and the idea is to use the API to create/update the products on Shopify.

 

What is the best approach to upload the images? Should I send it by using base64 in attachment property or if I set the src property with the URL Shopify will download it automatically?

0 Likes
Webgility1
Excursionist
27 1 6

This is an accepted solution.

Hi, 

You can use  : Create a new product with the default variant and a product image that will be downloaded by Shopify.

Refer the api : https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-01

In that method request size will be less. 

But you need to manage images at your location, once images are downloaded by shopify you can delete them. 

 

 

Poovizhi_Kannan
New Member
1 0 1

Hi, I'm trying to do the same. I'm trying to add/u[date products and images to the shopify store using API and I'm facing some problems with product variants and images. Can you share me your code?

lucasconde
Tourist
11 0 3

Hi, when adding the product just add the image URL, Shopify will download it automatically.