Adding product filters and categories through the API

in Development
We are trying to use the eCom API to add filters and categories to products in batch. We have not been successful so far on either attempt though. Here is what we do in Python using requests, and what we get as a response:
In response, we get a 403 back:
We see the same behavior when we try the "categories/products" endpoint to attach a category to a product.
Other operations (reading product and category data, creating webhooks, etc.) work as expected, so I don't think this is a matter of authentication.
What am I doing wrong?
payload = { "productFilterValue": { "filter": 5010, "filtervalue": 17975 }}
In response, we get a 403 back:
'{"error":{"code":403,"method":"CREATE","request":"\\/us\\/products\\/15239803\\/filtervalues.json", "message":"The server understood the request, but is refusing to fulfill it."}}'
Other operations (reading product and category data, creating webhooks, etc.) work as expected, so I don't think this is a matter of authentication.
What am I doing wrong?
Answers
The first thing I noticed was the naming of the Product Filter Value object. The object should be named productFiltervalue (no upper case 'v').
Secondly, you'll want to wrap your payload in single quotes as follows:
Let me know if that works for you.
Thanks,
Product Manager
Lightspeed HQ
Thank you for your response. Unfortunately this did not turn out to be the solution. Here is what I have with your edits:
As I mentioned in my original question, the same thing happens when we try to add products to categories:
I checked your account and realized that this error is in fact related to the permissions on the API key.
Shops that have Omnichannel enabled cannot write to products via the eCom API. Only the Retail API allows for writing to products on Omnichannel shops. We should make this error message more clear.
Thanks,
Product Manager
Lightspeed HQ
As retail API does not give access to product filters, how do you recommend we go about updating filters in batch?
Same with multiple categories. As retail only allows a single category to be associated with a product, there is no way for us to set multiple categories through the retail API. How do you recommend that we set multiple categories on a product at the eCom side?
The only way to update filters (and categories) in batch is by doing a product import. You can read more about product imports here:
https://ecom-support.lightspeedhq.com/hc/en-us/articles/220320628-Editing-products-through-import
Product Manager
Lightspeed HQ
Maybe I’m reading this wrong, but it doesn’t seem to answer the question on multiple categories, as there seems to be only one category in the import template.
We were also told that the filter import feature doesn’t currently work, is it resolved now?
To import multiple categories you would need to do multiple imports. Each product import can add one set of categories: main, secondary, tertiary.
I hope that helps answer your question.
Product Manager
Lightspeed HQ