open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[BUG]: Update Listing Inventory - sku on property not working as documented

Open annedirkse opened this issue 3 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

When trying to write inventory with multiple properties, and a SKU tied to one of those properties, the SKUs are shown in the JSON response from the server, and in the draft listing thumbnail, but not in the Edit Listing page on Etsy.com. When the listing is saved subsequently the SKUs are deleted. I was able to get the expected behavior by specifying both property IDs, but this is contrary to the API documentation.

Steps to reproduce

I am trying to write inventory for our custom label products which have variations based on both Size and Material+Qty. SKUs for each size vary, so multiple material+qty variations have the same SKU. I assumed that I would submit that as

{"products":[{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["5 - Weatherproof Gloss"]}],"offerings":[{"price":11.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["10 - Weatherproof Gloss"]}],"offerings":[{"price":13.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["25 - Weatherproof Gloss"]}],"offerings":[{"price":17.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["50 - Weatherproof Gloss"]}],"offerings":[{"price":21.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["100 - Weatherproof Gloss"]}],"offerings":[{"price":29.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["5 - Weatherproof Matte"]}],"offerings":[{"price":11.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["10 - Weatherproof Matte"]}],"offerings":[{"price":12.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["25 - Weatherproof Matte"]}],"offerings":[{"price":17.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["50 - Weatherproof Matte"]}],"offerings":[{"price":21.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3008065120","property_values":[{"property_id":100,"property_name":"Size","values":["Regular Mouth - 2"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["100 - Weatherproof Matte"]}],"offerings":[{"price":29.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["5 - Weatherproof Gloss"]}],"offerings":[{"price":11.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["10 - Weatherproof Gloss"]}],"offerings":[{"price":12.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["25 - Weatherproof Gloss"]}],"offerings":[{"price":19.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["50 - Weatherproof Gloss"]}],"offerings":[{"price":26.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["100 - Weatherproof Gloss"]}],"offerings":[{"price":39.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["5 - Weatherproof Matte"]}],"offerings":[{"price":11.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["10 - Weatherproof Matte"]}],"offerings":[{"price":12.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["25 - Weatherproof Matte"]}],"offerings":[{"price":19.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["50 - Weatherproof Matte"]}],"offerings":[{"price":26.95,"is_enabled":true,"quantity":100}]},{"sku":"CL3293339382","property_values":[{"property_id":100,"property_name":"Size","values":["Wide Mouth - 2.5"]},{"property_id":513,"property_name":"Quantity \u0026 Material","values":["100 - Weatherproof Matte"]}],"offerings":[{"price":39.95,"is_enabled":true,"quantity":100}]}],"sku_on_property":[100],"price_on_property":[100,513]}

However this is not working as expected. When I submit the JSON above, the JSON response from the server shows the SKUs just as they were submitted, but the Etsy web interface does not. I just get blanks, where the SKUs should be.

Screen Shot 2022-02-09 at 11 55 14 AM

Interestingly, the thumbnail for the draft listing shows the assigned SKUs even though they are not shown on the listing page. Screen Shot 2022-02-09 at 11 56 51 AM

When I save the listing from the Etsy web UI, with no further changes, the SKUs are removed and no longer show in the thumbnail or in the JSON when querying the listing inventory via the API.

I was able to get the SKUs to write correctly by specifying both properties in the sku_on_property, "sku_on_property":[100,513]

Expected behavior

The documentation implies that, in my case above, it should just be the size property specified in sku_on_property.

sku_on_property | Array of integersAn array of unique listing property ID integers for the properties that change the product SKU, if any. For example, if you use specific skus for different colored products in the same listing, then this array contains the property ID for color.

When I submit the JSON above with both property IDs specified I get the expected result, which is different SKUs for each size, repeated for the different variations of each size, like this:

Screen Shot 2022-02-09 at 8 09 18 PM

Additional context

No response

annedirkse avatar Feb 10 '22 03:02 annedirkse

@annedirkse I've submitted the issue where editing the skus in the shop manager interface wipes the skus away from the thumbnail.

As for the rest of it, I can understand the confusion. The inventory system definitely confusing. The reason that it worked when you passed in both 100 and 513 on the sku_on_property is because you have both price and sku affecting those two properties.

etsyachristensen avatar Feb 11 '22 16:02 etsyachristensen

Hi, I'm not quite sure that I understand what you are saying? There are only 2 SKUs in the data represented, and when doing this previously through the v2 API I would get an error if the skus didn't match for every product with the same size. The server accepts that request as long as the SKUs are consistent for the property tied to the SKU, and reports that same data back in the response with the SKUs assigned (which are visible in the thumbnail, as well as when subsequently querying the inventory via the API. I think that the bug is actually that the Etsy web UI is not showing the SKUs.

When I sumbit an inventory update with sku tied only to the size property, the data returned is consistent with listings built manually in the Etsy UI where the only "SKU varies on property" checkbox is on the size, the material/quantity box is unchecked (the UI still requires you to specify the same SKU multiple times for each variation in this case).

Querying the listing/inventory for a manually created listing in this way yields sku_on_property 100 only, as does the listing inventory submitted via the API - the results are identical data for the manually created listings and the entry created by the Etsy UI, both with the same sku on property 100 (size) option set, with the custom property unset. The difference is only that the SKUs are not shown in the variations in the Etsy UI, even though they are set for the data submitted via the API.

To me it is expected behavior that the listing saved via the Etsy UI would remove the SKUs, because the textfields are blank in the UI, so the SKUs that exist for the products are overwritten. That they show up in the API model of the listing inventory UI seems to be the bug instead.

If setting a SKU on one property is not allowed via the API when two properties are present in the variation that should be explained in the documentation, and an error should be thrown when attempting to create inventory with sku varying on only one property.

If I am understanding this incorrectly I would say that this should be moved to a documentation bug, since that clearly indicates that "property on sku" pertains to a property that accepts different SKUs. The sku in our case does not vary based on the second property, so it is counter-intuitive that we are required to specify that as a property when that is not required in the web UI either - the result is different than expected, and we cannot replicate the settings that we have set for the manually created listing via the API, where only one box is checked.

annedirkse avatar Feb 11 '22 17:02 annedirkse

Apologies. I misunderstood. You are correct. If on your Size variation you only have the sku option marked then yes, you should only have to pass [100] as the sku_on_property. I'm not sure why changing it to [100,513] made the difference in making the skus appear. I've passed that bit on to our front end development team to look into.

etsyachristensen avatar Feb 11 '22 17:02 etsyachristensen

no worries, thanks!

annedirkse avatar Feb 11 '22 17:02 annedirkse