Errors in inventory import

mceliasmcelias Member Posts: 3

Hi All, what is this error in the inventory import that has started happening?

Request

<?xml version="1.0" encoding="UTF-8"?> <Item> <upc>8413351212022</upc> <customSku>8413351212022</customSku> <ItemShops> <ItemShop> <itemShopID>0</itemShopID> <qoh>1</qoh> <itemID>9407</itemID> <shopID>1</shopID> </ItemShop> </ItemShops> </Item>

Error

<?xml version="1.0" encoding="UTF-8"?> <Error> <httpCode>422</httpCode> <httpMessage>Unprocessable Entity</httpMessage> <message>Item not Updated. "ItemShops.itemID" cannot be set on Update.</message> <errorClass>Exception</errorClass> </Error>

3 comments

  • mceliasmcelias Member Posts: 3

    @nd


    Hi All, what is this error in the inventory import that has started happening?

    Request

    <?xml version="1.0" encoding="UTF-8"?> <Item> <upc>8413351212022</upc> <customSku>8413351212022</customSku> <ItemShops> <ItemShop> <itemShopID>0</itemShopID> <qoh>1</qoh> <itemID>9407</itemID> <shopID>1</shopID> </ItemShop> </ItemShops> </Item>

    Error

    <?xml version="1.0" encoding="UTF-8"?> <Error> <httpCode>422</httpCode> <httpMessage>Unprocessable Entity</httpMessage> <message>Item not Updated. "ItemShops.itemID" cannot be set on Update.</message> <errorClass>Exception</errorClass> </Error>

  • mceliasmcelias Member Posts: 3

    Can someone please reply

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator

    Hey @mcelias,

    There are a few things wrong in your request:

    You need to remove the itemID since this cannot be set by a request body since it's already set in the database. Plus, the itemID will be in your request url as seen here:

    https://api.lightspeedapp.com/API/Account/{accountID}/Item/{itemID}.xml

    In addition the itemShopID cannot be 0. It should be an integer greater than 0 and will be determined on the ItemShops object through a read

     <Item>
       <upc>8413351212022</upc>
       <customSku>8413351212022</customSku>
       <ItemShops>
         <ItemShop>
           <itemShopID>0</itemShopID> // itemShopID cannot be 0
           <qoh>1</qoh>
           <itemID>9407</itemID>  // Remove
           <shopID>1</shopID>
         </ItemShop>
       </ItemShops>
     </Item>
    

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.