0

I tried to create InboundShipment.

client.create_inbound_shipment(id, inbound_shipment_header, inbound_shipment_items)

id is shipplan id created by Shipplan.

inbound_shipment_header = {:shipment_name=>"kum_03_01_2019_AVP1", :ship_from_address=>{:name=>"xxxx", :address_line1=>"xxxx", :address_line2=>"", :city=>"xxxx", :state_or_province_code=>"XX", :postal_code=>"xxxx", :country_code=>"xxxx"}, :destination_fulfillment_center_id=>"AVP1", :label_prep_preference=>"SELLER_LABEL", :are_cases_required=>false, :shipment_status=>"WORKING", :intended_box_contents_source=>"2D_BARCODE"}

inbound_shipment_items = [{:seller_sku=>"SKU", :quantity=>25, :prep_details=>[{:prep_instruction=>"Labeling", :prep_owner=>"SELLER"}]}]

But it return error following as.

#<Peddler::Errors::InvalidRequestException: Error: You must include a valid ShipmentId with a call to the CreateInboundShipment operation. Get ShipmentId values by calling the CreateInboundShipmentPlan operation. The request to CreateInboundShipment must include only items and quantities that have been previously planned through CreateInboundShipmentPlan. If a ShipmentId is not used to create a shipment within 48 hours it will expire.>

When I tried this on MWS scratch pad, it's working normally.

What's the solution to create the Inbound Shipment on RubyOnRails?

hobbydev
  • 1,513
  • 19
  • 31
  • What I would do is look at the HTTP POST that scratchpad creates and compare with the HTTP POST that your app is generating. Compare the differences. I don't know ROR at all, but it doesn't look like you're sending through a valid ShipmentId based on the error message. – ScottG Mar 01 '19 at 20:00

1 Answers1

0

I just solved the issue.

There was an mistake when write the inbound_shipment_item.

inbound_shipment_item should be following as.

inbound_shipment_items = [{:seller_sku=>"SKU", :quantity_shipped=>25, :prep_details=>[{:prep_instruction=>"Labeling", :prep_owner=>"SELLER"}]}]
hobbydev
  • 1,513
  • 19
  • 31