Describe the bug
Hi, I'm trying to update the inventory of my VendorCentral DF account, and when try to do it, it returns a "Invalid content was found starting with element 'marketplaceIds'. One of '{inventory}' is expected."
To Reproduce
(See the code attached for more)
The call is:
inv = VendorDirectFulfillmentInventory(marketplace=Marketplaces.ES,credentials=credentials).submit_inventory_update(warehouseId='BSVM',inventory=jsonl) print(inv)
It returns:
Traceback (most recent call last): File "/root/Desktop/python3file.py", line 43, in <module> inv = VendorDirectFulfillmentInventory(marketplace=Marketplaces.ES,credentials=credentials).submit_inventory_update(warehouseId='BSVM',inventory=jsonl) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/helpers.py", line 19, in wrapper return function(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/sp_api/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py", line 58, in submit_inventory_update return self._request(fill_query_params(kwargs.pop('path'), warehouseId), data=kwargs) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/client.py", line 153, in _request return self._check_response(res, res_no_data, bulk, wrap_list) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/client.py", line 176, in _check_response raise exception(error, headers=res.headers) sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': "Invalid content was found starting with element 'marketplaceIds'. One of '{inventory}' is expected.", 'details': ''}, {'code': 'InvalidInput', 'message': 'MarketplaceIds', 'details': ''}]
Expected behavior
Update the inventory of this article..
Desktop (please complete the following information):
- OS: Windows, python 3.10.8, sp_api 0.17.5
Additional context
I tried to use a proxy to see the data sent and it's: (Removed indentificable information)
POST /vendor/directFulfillment/inventory/v1/warehouses/BSVM/items HTTP/2 Host: sellingpartnerapi-eu.amazon.com User-Agent: python-sp-api-0.17.5 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive X-Amz-Access-Token: REMOVED X-Amz-Date: 20221212T091249Z Content-Type: application/json Content-Length: 289 Authorization: REMOVED {"inventory": {"sellingParty": {"partyId": "REMOVED"}, "isFullUpdate": false, "items": [{"buyerProductIdentifier": "REMOVED", "availableQuantity": {"amount": 100, "unitOfMeasure": "Each"}, "isObsolete": false}]}, "marketplaceIds": ["REMOVED"], "MarketplaceIds": ["REMOVED"]}
Other API calls like "VendorDirectFulfillmentOrders().get_orders()" works, then I assume that credentials are not the problem
EXAMPLE.TXT
Describe the bug
Hi, I'm trying to update the inventory of my VendorCentral DF account, and when try to do it, it returns a "Invalid content was found starting with element 'marketplaceIds'. One of '{inventory}' is expected."
To Reproduce
(See the code attached for more)
The call is:
inv = VendorDirectFulfillmentInventory(marketplace=Marketplaces.ES,credentials=credentials).submit_inventory_update(warehouseId='BSVM',inventory=jsonl) print(inv)It returns:
Traceback (most recent call last): File "/root/Desktop/python3file.py", line 43, in <module> inv = VendorDirectFulfillmentInventory(marketplace=Marketplaces.ES,credentials=credentials).submit_inventory_update(warehouseId='BSVM',inventory=jsonl) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/helpers.py", line 19, in wrapper return function(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/sp_api/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py", line 58, in submit_inventory_update return self._request(fill_query_params(kwargs.pop('path'), warehouseId), data=kwargs) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/client.py", line 153, in _request return self._check_response(res, res_no_data, bulk, wrap_list) File "/usr/local/lib/python3.10/dist-packages/sp_api/base/client.py", line 176, in _check_response raise exception(error, headers=res.headers) sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': "Invalid content was found starting with element 'marketplaceIds'. One of '{inventory}' is expected.", 'details': ''}, {'code': 'InvalidInput', 'message': 'MarketplaceIds', 'details': ''}]Expected behavior
Update the inventory of this article..
Desktop (please complete the following information):
Additional context
I tried to use a proxy to see the data sent and it's: (Removed indentificable information)
POST /vendor/directFulfillment/inventory/v1/warehouses/BSVM/items HTTP/2 Host: sellingpartnerapi-eu.amazon.com User-Agent: python-sp-api-0.17.5 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive X-Amz-Access-Token: REMOVED X-Amz-Date: 20221212T091249Z Content-Type: application/json Content-Length: 289 Authorization: REMOVED {"inventory": {"sellingParty": {"partyId": "REMOVED"}, "isFullUpdate": false, "items": [{"buyerProductIdentifier": "REMOVED", "availableQuantity": {"amount": 100, "unitOfMeasure": "Each"}, "isObsolete": false}]}, "marketplaceIds": ["REMOVED"], "MarketplaceIds": ["REMOVED"]}Other API calls like "VendorDirectFulfillmentOrders().get_orders()" works, then I assume that credentials are not the problem
EXAMPLE.TXT