InvalidInput $inputRoot.message
Closed this issue · 2 comments
blairanderson commented
I had a similar issue as amzn/selling-partner-api-models#153 trying to put_transport_details(...)
and continually getting a useless errors:
"errors": [
{
"code": "InvalidInput",
"message": "$inputRoot.message",
"details": ""
}
]
I kept going and finding more and more Objects
and models.
My code works and eventually looks something like this:
require 'fulfillment-inbound-api-model'
package_input_list = shipment.carton_package_list.map do |package|
weight = AmzSpApi::FulfillmentInboundApiModel::Weight.new(package.dig(:weight))
dimensions = AmzSpApi::FulfillmentInboundApiModel::Dimensions.new(package.dig(:dimensions))
AmzSpApi::FulfillmentInboundApiModel::PartneredSmallParcelPackageInput.new(weight: weight, dimensions: dimensions)
end
partnered_small_parcel_data = AmzSpApi::FulfillmentInboundApiModel::PartneredSmallParcelDataInput.new({
carrier_name: FulfillmentInboundShipment::UPS,
package_list: package_input_list
})
transport_details = AmzSpApi::FulfillmentInboundApiModel::TransportDetailInput.new({
partnered_small_parcel_data: partnered_small_parcel_data
})
body = AmzSpApi::FulfillmentInboundApiModel::PutTransportDetailsRequest.new({
is_partnered: true,
transport_details: transport_details,
shipment_type: AmzSpApi::FulfillmentInboundApiModel::ShipmentType::SP
})
api_instance = AmzSpApi::FulfillmentInboundApiModel::FbaInboundApi.new(api_client)
api_instance.put_transport_details(body, shipment.fba_shipment_id).payload
Honestly I wanted to say thanks for the Gem. wanted to leave the code sample in case anyone else had similar issues.
ericcj commented
do the useless errors come from sp-api itself or are they a bug in the generated code somehow?
blairanderson commented
sp-api itself!