Product api create duplicate product

bajwa_rajat
Shopify Partner
13 0 1

Hi, I am using shopify product POST api to upload multiple products to my shopify store . But sometimes for some products single API create two products with same data. This is causing duplicacy of products on store.

https://help.shopify.com/en/api/reference/products/product#create-2019-07

Any solution to this ?

Hello 
Looks problem is related to hardcoded/constent request payload.
Cross check your API code.

If helpful then please Like and Accept Solution. Free Website Review and advice for sale from Hire us
Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO | Digital Marketing | Site Speed Optimization | Performance Site Audit
For Quick Chat Whats app | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87
0 Likes
CleverJeweler
New Member
2 0 0

What do you mean by hardcoded/consent request? I am also noticing when we add or update products via the api they sometimes duplicate.

 

According to the coding, it should only go in once....

 

0 Likes

It means code in your file is repeated.

Hardcoded means static code or it will not change when your API request.

If helpful then please Like and Accept Solution. Free Website Review and advice for sale from Hire us
Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO | Digital Marketing | Site Speed Optimization | Performance Site Audit
For Quick Chat Whats app | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87
0 Likes
CleverJeweler
New Member
2 0 0

The call to the api is only being made once in the coding, but some items are still going in as duplicates. I noticed one of the items is showing an sku but the duplicate is not.

 

Any other ideas why this would happen?

0 Likes
Medteck
New Member
1 0 0

I'm having the exact same issue. Did you figure it out finally ?

0 Likes
HunkyBill
Shopify Expert
4488 45 485

You could provide more details. An aspect of this you have not made clear:

  • are you sure a product with the same title, hence handle, does not already exist?
  • what are the created at date/time stamps assigned to the original product and the dupe? Are they close?

Are you sure your code is not sending more than one request with the same payload? In other words, is your test of product creation a one and done thing, or is it part of a bigger production process in a loop?

So many things to rule out. I have created hundreds of thousands of products in hundreds of shops using API calls, and have yet to see duplicate products show up because of Shopify. Not that that can't happen, of course it could, but still, most of the time it is API consumer code at fault, not the API itself. Anyway, tick off more boxes for us in the community, and maybe we could help you.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes