Hi,
I'm using python and etsy2 to try to update the inventory, but failing to do that.
My test code looks the following:
# getting the inventory:
ll = eapi.getInventory(listing_id=int(l.etsy_id))
ll.keys()
RESULT: dict_keys(['products', 'price_on_property', 'quantity_on_property', 'sku_on_property'])
#ll['products'][0]
{'product_id': 6490481917,
'sku': '2410187731',
'property_values': [{'property_id': 513,
'property_name': 'Colors',
'scale_id': None,
'scale_name': None,
'values': ['Athletic Heather'],
'value_ids': [74650027590]},
{'property_id': 514,
'property_name': 'Sizes',
'scale_id': None,
'scale_name': None,
'values': ['XS'],
'value_ids': [71931464861]}],
'offerings': [{'offering_id': 6590510769,
'price': {'amount': 1785,
'divisor': 100,
'currency_code': 'EUR',
'currency_formatted_short': '€17.85',
'currency_formatted_long': '€17.85 EUR',
'currency_formatted_raw': '17.85'},
'quantity': 58,
'is_enabled': 1,
'is_deleted': 0}],
'is_deleted': 0}
#Making some change on the prices (prices dictionary becomes an integer):
for x in ll['products']:
x['offerings'][0]['price'] = x['offerings'][0]['price']['amount'] + 1
ll['products'][0]['offerings']
[{'offering_id': 6590510769,
'price': 1786,
'quantity': 58,
'is_enabled': 1,
'is_deleted': 0}]
And trying to update the Inventory fails:
eapi.updateInventory(listing_id=int(l.etsy_id), products=json.dumps(ll['products']))
with:
.
I do have listings_w permission scope, I'm able to update for instance title, tags, pictures.
Could anybody highlight me what am I missing?
As far as I can trace the call calls this url:
with PUT method and a data argument, which is a dictionary
Thanks.