Is there a way to update stock by ean/sku code?

JarekJarek Member Posts: 8

Hi,

I want to update stock of item


<Item>

  <itemID>3</itemID>

  <systemSku readonly="true">210000000003</systemSku>

  <defaultCost currency="EUR">0</defaultCost>

  <avgCost currency="EUR">0</avgCost>

  <discountable>true</discountable>

  <tax>true</tax>

  <archived>false</archived>

  <itemType>default</itemType>

  <serialized>false</serialized>

  <description>Test Style</description>

  <modelYear>0</modelYear>

  <upc />

  <ean>601382303003</ean>

  <customSku>601382303003</customSku>

  <manufacturerSku />

  <createTime>2020-09-10T11:25:30+00:00</createTime>

  <timeStamp>2020-09-15T11:14:18+00:00</timeStamp>

  <publishToEcom>true</publishToEcom>

  <categoryID>0</categoryID>

  <taxClassID>1</taxClassID>

  <departmentID>0</departmentID>

  <itemMatrixID>0</itemMatrixID>

  <manufacturerID>0</manufacturerID>

  <seasonID>0</seasonID>

  <defaultVendorID>0</defaultVendorID>

  <ItemShops>

   <ItemShop>

     <itemShopID>8</itemShopID>

     <qoh>-3</qoh>

     <sellable readonly="true">0</sellable>

     <backorder>0</backorder>

     <componentQoh>0</componentQoh>

     <componentBackorder>0</componentBackorder>

     <reorderPoint>0</reorderPoint>

     <reorderLevel>0</reorderLevel>

     <timeStamp>2020-09-16T12:49:03+00:00</timeStamp>

     <itemID>3</itemID>

     <shopID>1</shopID>

     <MetaData>

      <layaways>0</layaways>

      <specialorders>0</specialorders>

      <workorders>0</workorders>

     </MetaData>

   </ItemShop>

   <ItemShop>

     <itemShopID>7</itemShopID>

     <qoh>-3</qoh>

     <sellable readonly="true">0</sellable>

     <backorder>0</backorder>

     <componentQoh>0</componentQoh>

     <componentBackorder>0</componentBackorder>

     <reorderPoint>0</reorderPoint>

     <reorderLevel>0</reorderLevel>

     <timeStamp>2020-09-16T12:49:03+00:00</timeStamp>

     <itemID>3</itemID>

     <shopID>0</shopID>

     <MetaData>

      <layaways>0</layaways>

      <specialorders>0</specialorders>

      <workorders>0</workorders>

     </MetaData>

   </ItemShop>

  </ItemShops>

  <Prices>

   <ItemPrice>

     <amount currency="EUR">5</amount>

     <useTypeID>1</useTypeID>

     <useType readonly="true">Default</useType>

   </ItemPrice>

   <ItemPrice>

     <amount currency="EUR">5</amount>

     <useTypeID>2</useTypeID>

     <useType readonly="true">MSRP</useType>

   </ItemPrice>

   <ItemPrice>

     <amount currency="EUR">5</amount>

     <useTypeID>3</useTypeID>

     <useType readonly="true">Online</useType>

   </ItemPrice>

  </Prices>

</Item>


To do that now I need

account id - no problem

shop id - no problem

I've ean 601382303003

but I cannot use it so I've to get somehow itemID but that's enough since I've on item shopID 0,1

and cannot skip on update shopID it fail on update of shop 0 since active shop is 1

so to update qoh I need to execute something like that:


curl -X PUT -H "Authorization: Bearer xxx" \

-d '{ 

   "ItemShops": { "ItemShop": [{ "itemShopID": 8, "qoh": 13 }]}

  }' "https://api.lightspeedapp.com/API/Account/yyy/Item/3.json"

   

Is there any simple way to do that just having ean and shop id?

1 comment

Sign In or Register to comment.