create inboundshipment using peddler in rails

168 views Asked by At

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?

1

There are 1 answers

0
hobbydev On

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"}]}]