Import a list of products using the Product API

Solved
Highlighted
Tourist
7 0 0

I am using the Product API to import product in my shopify shop(POST /admin/api/2020-07/products.json ) with parameter one product (https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-07 ).

How can I import a list of products in the same time and not one product at the time. I have tried using Postamn several inputs and none worked.

Thank you,

Daniela

 

0 Likes
Highlighted
Shopify Partner
528 38 109

This is an accepted solution.

The REST API doesn't allow for batch record creation/update. The GraphQL API does allow for batch record retrieval through bulk operations. But nothing defined for batching new/updated records. Your code could iterate through your source records and add them one at a time. But this means 1,000 API calls for 1,000 new products. Taking into account the API request limiting and whatnot.

Since this is your own Shopify shop, can't you utilize the CSV import function to add new products in the Shopify web admin? While it doesn't expose all of the product fields it at least builds out the basis of what's needed, right?

1 Like
Highlighted
Tourist
7 0 0

Thank you Greg, unfortunately the client doesn't want the CSV import feature. Using GraphQL might be a better option? I haven't worked that much with GraphQL but am willing to give it a go. what are the limitations for my case? The clients has up to 5000 products.

 

0 Likes
Highlighted
Tourist
7 0 0

With the REST api I can have 4 requests/second, therefor I would need approx. 17 min per 4000 requests. I guess this is an operation the client will not do at a regular basis so if planned correctly it can be feasible. Do you see any issues with this? Thank you

0 Likes
Highlighted
Shopify Partner
528 38 109

This is an accepted solution.

I thought the base Shopify plan allows for 2 API requests/second. At any rate, that isn't a terribly long process importing in products serially using the API. The GraphQL API doesn't have bulk operations for adding/updating records. Only retrieving them. At any rate, for a one-time import this is reasonable. Less than an hour using the 2 requests/second limitation. Sure beats when we converted one of our companies to Lightspeed Retail. It took literally 2 whole days to import in the product dataset. They only allow one GET per second and one PUT/POST every 10 seconds!

1 Like
Highlighted
Tourist
7 0 0

Thank you Greg, we have Shopify Plus so we have 4 requests per second.

Thank you for your reply again

0 Likes
Highlighted
Excursionist
31 1 1

Hi Daniela,

Vesta eCommerce can do this for you www.vesta.us.

Regards,

Greg 

0 Likes