Ошибки при вызове createinboundplan в python-amazon-sp-apiPython

Программы на Python
Ответить
Anonymous
 Ошибки при вызове createinboundplan в python-amazon-sp-api

Сообщение Anonymous »

Я совершенно озадачен попыткой перейти на новый API SP API Inbound Fulfillment на первом этапе (createInboundPlan).
Вот полезная нагрузка непосредственно перед ее отправкой в ​​/inboundPlans
{'body': {'destinationMarketplaces': ['A1F83G8C2ARO7P'], 'items': [{'labelOwner': 'SELLER', 'msku': 'GNT~300506-9-10~RubiesDisneyFroze', 'prepOwner': 'SELLER', 'quantity': 24}, {'labelOwner': 'SELLER', 'msku': 'GNT~6061626~SpinMasterGamesSkillm', 'prepOwner': 'SELLER', 'quantity': 8}, {'labelOwner': 'SELLER', 'msku': 'GNT~F2934~MyLittlePonyPlayDoh', 'prepOwner': 'SELLER', 'quantity': 24}, {'labelOwner': 'SELLER', 'msku': 'GNT~HKV33~PollyPocketMiniToysCampAdve', 'prepOwner': 'SELLER', 'quantity': 32}, {'labelOwner': 'SELLER', 'msku': 'GNT~TM15537~McFarlaneToysDCMultiverse', 'prepOwner': 'SELLER', 'quantity': 6}, {'labelOwner': 'SELLER', 'msku': 'SMF~70604~Playmobil70596CityLifeF', 'prepOwner': 'SELLER', 'quantity': 24}], 'name': 'TEST', 'sourceAddress': {'addressLine1': 'Unit 2 49 Quarry Road', 'addressLine2': 'Ballydrain', 'city': 'Lisbane', 'companyName': 'Ardmillan Trading Limited', 'countryCode': 'GB', 'email': 'paul@email.co.uk', 'name': 'Paul Anderson', 'phoneNumber': '07841903333', 'postalCode': 'BT23 6QQ', 'stateOrProvinceCode': 'Co. Down'}}, 'path': '/inbound/fba//inboundPlans', 'method': 'POST'}

Он постоянно терпит неудачу со следующей ошибкой, которая, как я ожидаю, означает, что я передаю данные своего тела в неправильном формате, но я не понимаю, почему. Кто-нибудь может указать мне правильное направление или показать фрагмент рабочего кода?
sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': "9 validation errors detected: Value '[]' at 'request.destinationMarketplaces' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'request.sourceAddress.phoneNumber' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'request.sourceAddress.city' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'request.sourceAddress.countryCode' failed to satisfy constraint: Member must satisfy regular expression pattern: [A-Z]{2}; Value at 'request.sourceAddress.countryCode' failed to satisfy constraint: Member must have length greater than or equal to 2; Value at 'request.sourceAddress.postalCode' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'request.sourceAddress.name' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'request.sourceAddress.addressLine1' failed to satisfy constraint: Member must have length greater than or equal to 1; Value '[]' at 'request.items' failed to satisfy constraint: Member must have length greater than or equal to 1", 'details': ''}]


Подробнее здесь: https://stackoverflow.com/questions/792 ... zon-sp-api
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»