Replies: 5 comments 1 reply
-
Fix your input data, the error message even tells you where it’s wrong. |
Beta Was this translation helpful? Give feedback.
-
Hi |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello, I'm getting the same error under the same circumstances, my only difference is I'm not passing marketplace=Marketplaces.ES, as I'm US and it defaults to that. Does submit_inventory_update just not work at all? Has anyone gotten this to work? |
Beta Was this translation helpful? Give feedback.
-
Ok, for anyone else who has an issue with this, as far as I can tell, the problem is that this particular API call does NOT want the MarketplaceIds or marketplaceIds parameters passed to it. There's actually a mechanism within python-amazon-sp-api to refrain from sending the marketplace ID parameter. This is used for lots of other API calls, including several other ones in the Vendor Direct Fulfillment family. At any rate, it's missing from VendorDirectFulfillmentInventory. A workaround that worked for me is by modifying /sp_api/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py. Change the last line of that file to the following:
I'm going to file a new bug and reference this issue/discussion. |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions