Updating Attributes (Omni Channel)

whappycannabiswhappycannabis Member Posts: 23

Hi, I'm trying to update custom attributes in eCom using the values we have in custom fields inside of LSRetail.

I'm using the retail API to get the data from LSRetail. That's easy and works greatd.

However, when I do my PUT of those values into the eCom API, I get a 403 error message:

{"error":{"code":403,"method":"UPDATE","request":"\/us\/products\/34857306\/attributes\/26714.json","message":"The server understood the request, but is refusing to fulfill it."}}

Using Python, this is my request:

key = "fd5662e2df572a--EDITED--bdb"
secret = "73302f1680a08--EDITED--ef199"
url = "https://api.shoplightspeed.com/us/products/" + str(eComID) + "/attributes/" + str(26714) + ".json"
payload = { 'productAttributes[value]': str(THC) + str(UOM) }
response = requests.put(url, data=payload, auth=(key, secret))

I also tried with productAttribute[value] (without the 's') and get the same error.

How can I update these custom attributes in eCom for each products (we have over 200 products to update each with their own different values for those attributes). I want to use the API for this.

Thanks, Max (eCom Store ID: 640569 and retail AccountID: 227120)

FYI, I am the store owner.

For clarity, this is what I am trying to update:

Doing this manually takes forever!

Tags:

15 comments

  • whappycannabiswhappycannabis Member Posts: 23

    Hello? Anyone from Lightspeed can shed some light on this? Thanks, Max.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    Hi @whappycannabis,

    Thank you for contacting us.

    This is because you can't write products when you're having an omnichannel, this because Retail is the leading product. Please check this page for more information https://retail-support.lightspeedhq.com/hc/en-us/articles/229129388-Important-considerations-about-product-information-in-Lightspeed-Retail

  • whappycannabiswhappycannabis Member Posts: 23

    Thanks @LucienVersendaal but the issue here is that these fields are unavailable in Retail and are only created in eCom once the product has been sent from Retail to eCom. These fields are unavailable in Retail and only available in eCom and can be updated withing the eCom GUI but why can't they be updated via the API if they can be updated via the eCom GUI? I understand for fields that are pushed from Retail to eCom but for fields that only exist in eCom, there must be a better way to updated those... Max.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    Hi @whappycannabis,

    I totally understand what you mean. I will check if we can find a workaround.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    @whappycannabis,

    Unfortunately there is no workaround. I've created an internal ticket for our dev team to improve this. When I got something back from our dev team, I will let you know directly.

  • YoniYoni Member Posts: 3

    I would also like to be notified when this problem is solved. I need to be able to update the eCom-only fields for omnichannel products via the eCom API.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    @Yoni

    If there are any updates, I will let you know via this thread.

  • whappycannabiswhappycannabis Member Posts: 23

    Hi again, there are other fields that are only available in eCom and not in LS Retail that I need to update through the API. Those fields are the data01, data02 and data03 fields that sit at the product level in eCom. Unless you show me a way to update those in LS Retail, these would also need to be added to this enhancement request as there is really no workaround here for omnichannel shops to mass-update those fields programmatically.

    When trying the following code, I get the following:

    <Response [403]>
    {"error":{"code":403,"method":"UPDATE","request":"\/us\/products\/34857306.json","message":"The server understood the request, but is refusing to fulfill it: No \"update\" permission to \"products\" using this key"}}
    

    This is the code I want to use to update those data01, data02, data03 fields:

    def Update_eComAttributes(eComID, THC, CBD, UOM):
      key = "fd5662e2...7bdb"
      secret = "73302f16...ddef199"
    
        url = "https://api.shoplightspeed.com/us/products/" + str(eComID) + ".json"
    
      payload = {
        'product[data01]': str(THC) + str(UOM),
        'product[data02]': str(CBD) + str(UOM)
       }
       
      response = requests.put(url, data=payload, auth=(key, secret))
    
  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    Hi @whappycannabis,

    This is because you can't write products when you're having an omnichannel, this because Retail is the leading product. Please check this page for more information https://retail-support.lightspeedhq.com/hc/en-us/articles/229129388-Important-considerations-about-product-information-in-Lightspeed-Retail

  • whappycannabiswhappycannabis Member Posts: 23

    Hi @LucienVersendaal thanks for following up. Since LightSpeed are preventing omnichannel store owners from updating their own eCom data through the eCom API and that this data cannot be updated through the Retail API (because those fields are not in Retail), then LightSpeed should either allow store owners to update those fields using the eCom API ... or ... add new fields in Retail that sync back to eCom so we can update those fields using the Retail API. Thoughts?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    @whappycannabis,

    I totally agree on that, a few months ago I create an internal ticket for our devs because a lot of partners are facing this issue. It makes no sense that you can't update fields that aren't available for Retail, only eCom. What I do is creating a ticket for you with this issue attached, when there are any updates on this I will let you know directly.

  • whappycannabiswhappycannabis Member Posts: 23

    Hi again @LucienVersendaal . What's the latest update on this? Been a while ;)

  • Ali_MasoumieAli_Masoumie Moderator, Lightspeed Staff Posts: 137 moderator

    Hi,

    Unfortunately not, but I see that Lucien has created a ticket for you which is assigned to the case. Lucien will notify you in the ticket when there is an update.

  • whappycannabiswhappycannabis Member Posts: 23

    Hi again @Ali_Masoumie and @LucienVersendaal I am trying to find a good workaround (NOT through the UI) to do this because of all the LS limitations and thought about a request that I can send to the URL directly. URL seems to be like this for these properties https://whappy-cannabis-corp-640569.shoplightspeed.com/admin/products/#######/properties/#####

    The first set of "#" seems to be the productID and the second set is the propertyID/attribute. What would a well formed request to update this look like? I'm getting the teapot error with most of what I try.

    Please note that if I navigate tot this URL, login and then I can update and it works well within a browser. Seems to be a "patch" request?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 861 moderator

    When I'm visiting the link I'm getting this


Sign In or Register to comment.