Item with matching ean already exists

thisconnectthisconnect Member Posts: 13

hi

when i try to update an item through the API, i use the itemID, not EAN number

like this :

Item/22006.json => {"ItemShops":{"ItemShop":{"itemShopID":"77128","qoh":2}}}

but i get this error:

Item not updated. Item with matching ean already exists. ItemID: 22005, ean: 5711529362122, desc: ...

please explain me why!

i want to change item 22006 and i do not care if some other item 22005 has the same EAN number...

and why does the user not get an error when adding the second product with the same EAN number? (how do they get in the database if it is such a big problem)

this is messing up my whole implementation, as i can not update stock of these items...

could anyone explain? have a solution?

how can i update the item?

thx!

4 comments

  • gregaricangregarican Member Posts: 469 

    Strange, as I just tested this out and purposely defined two different items with the same EAN in the Retail web client. Updating one of them via the API went through just fine. Not sure what's going on in this regard.

    Here is a screen shot of the two items in the Retail web client.

    And here is a capture of the API request/response pair. Worked as expected.

    PUT https://api.merchantos.com/API/Account/{my_account_id}/Item/55.json HTTP/1.1

    Content-Type: text/plain

    Authorization: Bearer {my_auth}

    User-Agent: PostmanRuntime/7.26.2

    Accept: */*

    Postman-Token: 8baa30a1-abba-4d95-b132-57c135640ca5

    Host: api.merchantos.com

    Accept-Encoding: gzip, deflate, br

    Connection: keep-alive

    Content-Length: 177

    Cookie: __cfduid=dda0ac1d36e0a39418cec6e95f640cc5a1594744559


     "Note": { 

      "note": "This again is a newly-updated note." 

     },

     "ItemShops": {

      "ItemShop": {

       "itemShopID": 164,

       "shopID": 1,

       "qoh": 1

      }

     }

    }

    HTTP/1.1 200 OK

    Date: Fri, 31 Jul 2020 13:48:26 GMT

    Content-Type: application/json

    Content-Length: 4640

    Connection: keep-alive

    x-frame-options: SAMEORIGIN

    X-XSS-Protection: 1; mode=block

    X-Content-Type-Options: nosniff

    X-LS-Acct-Id: {my_account_id}

    X-LS-OAuth-Client-Id: 64577

    X-LS-API-Bucket-Level: 10/100

    X-LS-Shard-Id: 18

    X-LS-API-Drip-Rate: 5

    X-LS-Master-System: false

    X-LS-Master-Account: true

    X-LS-Master-Catalog: false

    Vary: Accept-Encoding

    CF-Cache-Status: DYNAMIC

    cf-request-id: 0446baa3b700009ed9ec17f200000001

    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"

    Server: cloudflare

    CF-RAY: 5bb7c6e5fc489ed9-ORD


    {"@attributes":{"count":"1"},"Item":{"itemID":"55","systemSku":"210000000055","defaultCost":"100","avgCost":"100","discountable":"true","tax":"true","archived":"true","itemType":"default","serialized":"false","description":"Samsung 40\" tv (Sample API Upload).","modelYear":"0","upc":"12345678901","ean":"1234567890123","customSku":"12341234","manufacturerSku":"43214321","createTime":"2018-02-16T12:54:18+00:00","timeStamp":"2020-07-31T13:48:26+00:00","publishToEcom":"true","categoryID":"36","taxClassID":"1","departmentID":"0","itemMatrixID":"0","manufacturerID":"0","seasonID":"0","defaultVendorID":"200","Note":{"note":"This again is a newly-updated note.","isPublic":"false","timeStamp":"2020-07-31T13:48:26+00:00"},"ItemECommerce":{"itemECommerceID":"4361","longDescription":"<p>This is the web store long description.<\/p>","shortDescription":"<p>This is the web store short description.<\/p>","weight":"0","width":"0","height":"0","length":"0","listOnStore":"false"},"ItemShops":{"ItemShop":[{"itemShopID":"164","qoh":"1","sellable":"1","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2020-07-22T17:46:09+00:00","itemID":"55","shopID":"1"},{"itemShopID":"165","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-02-16T20:31:38+00:00","itemID":"55","shopID":"2"},{"itemShopID":"1408","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-04-30T15:26:23+00:00","itemID":"55","shopID":"3"},{"itemShopID":"1919","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-04-30T15:29:46+00:00","itemID":"55","shopID":"4"},{"itemShopID":"2430","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-04-30T15:32:04+00:00","itemID":"55","shopID":"5"},{"itemShopID":"76195","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2020-02-05T20:49:44+00:00","itemID":"55","shopID":"6"},{"itemShopID":"163","qoh":"0","sellable":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2019-11-12T16:23:13+00:00","itemID":"55","shopID":"0"}]},"CustomFieldValues":{"CustomFieldValue":[{"customFieldValueID":"430","customFieldID":"13","name":"Stone 2","type":"single_choice","value":{"customFieldChoiceID":"194","value":"","name":"Agate","canBeDeleted":"false","customFieldID":"13"}},{"customFieldValueID":"431","customFieldID":"15","name":"Stone 2 Attributes","type":"text","value":"These are the Accent Stone 2 Attributes."},{"customFieldValueID":"432","customFieldID":"5","name":"Includes","type":"multi_choice","value":{"customFieldChoiceID":"60","value":"","name":"Box","canBeDeleted":"false","customFieldID":"5"}},{"customFieldValueID":"433","customFieldID":"5","name":"Includes","type":"multi_choice","value":{"customFieldChoiceID":"64","value":"","name":"Warranty Card","canBeDeleted":"false","customFieldID":"5"}},{"customFieldValueID":"434","customFieldID":"17","name":"Stone 3 Attributes","type":"text","value":""},{"customFieldValueID":"435","customFieldID":"19","name":"Stone 4 Attributes","type":"text","value":""},{"customFieldValueID":"436","customFieldID":"24","name":"Accessory Dimensions","type":"text","value":""},{"customFieldValueID":"437","customFieldID":"29","name":"Year","type":"string","value":""},{"customFieldValueID":"438","customFieldID":"26","name":"Condition","type":"text","value":""},{"customFieldValueID":"439","customFieldID":"9","name":"Main Stone Attributes","type":"text","value":""},{"customFieldValueID":"77689","customFieldID":"39","name":"Cert\/Serial Number","type":"string","value":""},{"customFieldValueID":"77690","customFieldID":"46","name":"Watch Caliber","type":"string","value":""},{"customFieldValueID":"77691","customFieldID":"37","name":"Watch Case Size","type":"string","value":""},{"customFieldValueID":"77692","customFieldID":"34","name":"Watch Model Number","type":"string","value":""},{"customFieldValueID":"78479","customFieldID":"47","name":"Publish to Shopify","type":"boolean","value":"false"}]},"Prices":{"ItemPrice":[{"amount":"220","useTypeID":"1","useType":"Default"},{"amount":"550","useTypeID":"2","useType":"MSRP"},{"amount":"220","useTypeID":"3","useType":"Online"}]},"Tags":{"@attributes":{"count":"2"},"tag":["tag1","tag2"]}}}

  • darryl_ssdarryl_ss Member Posts: 63

    @Lightspeed Team I'm having the same issue right now, we're set to go live on Monday morning and can't update the stock from the old system. @thisconnect did you find a solution by any chance?

    This is a real big issue. 🤯

  • darryl_ssdarryl_ss Member Posts: 63

    Seems the only solution is to find all of the duplicate ean's and remove the items :(. Oh well here we go.

    Shame the importer doesn't spot these duplicates, would save a lot of hassle.

  • thisconnectthisconnect Member Posts: 13

    strange that we have different results... i'm still getting the duplicate errors.

    are there "versions" of the API, even when using same URL? i also use https://api.merchantos.com/API/Account/... maybe by Bearer or account/country ?

    i see both your products are not identical (one has UPC the not). i tried adding a UPC code to one of the duplicates also, but still get error....

    note: i tested with my retail account and when i try to add stock (through web interface) i get an error ("Couldn't save (Please Try Again)") but the stock is still added. this means the lightspeed web interface also has difficulties with the double EAN in some way

    ...

    we really should find a solution for this (or know why you do not have the same error...)

Sign In or Register to comment.