Updating Item Brand and Tags Through Retail API

gchavezgchavez Member Posts: 4

I am wanting to update an item in the retail store with the account/item api call (specifically updating the items Brand and Tags. Reading through the api documentation I have not been able to find this information. Would anyone know if it is possible to update these two things, and if so, how to format them in the api payload?


This is the url I am using for this api call: https://api.lightspeedapp.com/API/Account/${accountId}/Item/${itemId}.json

4 comments

  • mattangermattanger Member Posts: 101 ✭

    First you have to to authenticate with the API, if you haven't.

    Then to update a tag, you'd have to make a PUT request with the JSON body. There are examples here: https://developers.lightspeedhq.com/retail/endpoints/Tag/

    To change the brand you would need to make a put request to the item endpoint with a different manufacturerID. Documented here: https://developers.lightspeedhq.com/retail/endpoints/Item/

    Matt Anger

    https://spectraretail.com/

  • gregaricangregarican Member Posts: 864 

    Looking back at older Fiddler captures I have from Retail, I see I was able to issue a POST request to create new products with tags. So I assume issuing a PUT request to the specific item's endpoint would work. In my case I had XML in the request body and hit the https://api.lightspeedapp.com/API/Account/{accountId}/Item endpoint to create the new product. In order to use XML in the request body for the PUT request I'd have to hit the https://api.lightspeedapp.com/API/Account/{accountId}/Item/{itemId} endpoint. The way that Retail API quirks out when working with tags means that I don't think the JSON endpoint will work. If memory serves correct. 😀

    Here is a sample of the XML request body I used.

    <?xml version="1.0"?>

    <Item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

     <itemID>0</itemID>

     <customSku>582409</customSku>

     <manufacturerSku>582409</manufacturerSku>

     <ItemShops>

      <ItemShop>

       <shopID>1</shopID>

       <qoh>0</qoh>

      </ItemShop>

      <ItemShop>

       <shopID>2</shopID>

       <qoh>1</qoh>

      </ItemShop>

     </ItemShops>

     <defaultCost>000.000</defaultCost>

     <discountable>true</discountable>

     <tax>true</tax>

     <itemType>default</itemType>

     <serialized>false</serialized>

     <description>Intertwined diamond engagement ring</description>

     <modelYear>0</modelYear>

     <upc />

     <ean />

     <publishToEcom>true</publishToEcom>

     <categoryID>0</categoryID>

     <taxClassID>1</taxClassID>

     <departmentID>0</departmentID>

     <itemMatrixID>0</itemMatrixID>

     <manufacturerID>0</manufacturerID>

     <seasonID>0</seasonID>

     <defaultVendorID>0</defaultVendorID>

     <Prices>

      <ItemPrice>

       <amount>3850.00</amount>

       <useTypeID>1</useTypeID>

       <useType>Default</useType>

      </ItemPrice>

      <ItemPrice>

       <amount>5550.00</amount>

       <useTypeID>2</useTypeID>

       <useType>MSRP</useType>

      </ItemPrice>

      <ItemPrice>

       <amount>3850.00</amount>

       <useTypeID>3</useTypeID>

       <useType>Online</useType>

      </ItemPrice>

     </Prices>

     <Note>

      <note>Pre-owned engagement ring crafted in 14 karat yellow gold and graced with a .70 carat, color FG, clarity VVS2 brilliant cut center diamond completed with a band set with 6 color GH, clarity SI2-3 brilliant diamonds weighing .18 carats total and 12 color G</note>

     </Note>

     <Tags>

      <tag>2000-5000</tag>

      <tag> Bridal</tag>

      <tag> Round</tag>

      <tag> STORE 5A</tag>

      <tag> vintage</tag>

     </Tags>

     <ItemECommerce>

      <longDescription>Pre-owned engagement ring crafted in 14 karat yellow gold and graced with a .70 carat, color FG, clarity VVS2 brilliant cut center diamond completed with a band set with 6 color GH, clarity SI2-3 brilliant diamonds weighing .18 carats total and 12 color GH, clarity VS2-SI1 baguette diamonds weighing .20 carats total. Ring size 7.5.</longDescription>

      <shortDescription>Intertwined diamond engagement ring</shortDescription>

      <weight>0</weight>

      <width>0</width>

      <height>0</height>

      <length>0</length>

      <listOnStore>true</listOnStore>

     </ItemECommerce>

    </Item>


    As for the Brand, I think that there are two different places where manufacturers and vendors are listed in the product. One is the manufacturerID and the other is the defaultVendorID. One of these equates to what is seen in the web client as the Brand.

    Hope this helps!

  • gregaricangregarican Member Posts: 864 

    ...and my memory didn't fail me. You can't issue a POST or PUT request dealing with tags unless you use XML. JSON doesn't work. Assume this was never fixed.


  • gchavezgchavez Member Posts: 4

    Update: I was able to update the brand for an item by passing in the payload manufacturerID: "". As well, I was able to update the tags for an item by passing in the payload Tags: { Tag: [{name: ""}]}

Sign In or Register to comment.