Class: MWS::FulfillmentInboundShipment::Client

Inherits:
Peddler::Client show all
Defined in:
lib/mws/fulfillment_inbound_shipment/client.rb

Overview

With the Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also request lists of inbound shipments or inbound shipment items based on criteria that you specify.

Instance Attribute Summary

Attributes inherited from Peddler::Client

#auth_token, #body, #marketplace, #merchant_id, #path

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #headers, #initialize, #operation, #run

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

#confirm_preorder(shipment_id, need_by_date) ⇒ Peddler::XMLParser

Confirms a shipment for pre-order

Parameters:

  • shipment_id (String)
  • need_by_date (#iso8601)

Returns:

See Also:



118
119
120
121
122
123
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 118

def confirm_preorder(shipment_id, need_by_date)
  operation('ConfirmPreorder')
    .add('ShipmentId' => shipment_id, 'NeedByDate' => need_by_date)

  run
end

#confirm_transport_request(shipment_id) ⇒ Peddler::XMLParser

Confirms that you accept the Amazon-partnered shipping estimate and you request that the Amazon-partnered carrier ship your inbound shipment



207
208
209
210
211
212
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 207

def confirm_transport_request(shipment_id)
  operation('ConfirmTransportRequest')
    .add('ShipmentId' => shipment_id)

  run
end

#create_inbound_shipment(shipment_id, inbound_shipment_header, inbound_shipment_items) ⇒ Peddler::XMLParser

Creates an inbound shipment

Parameters:

  • shipment_id (String)
  • inbound_shipment_header (Struct, Hash)
  • :inbound_shipment_items (Array<Struct, Hash>)

Returns:

See Also:



75
76
77
78
79
80
81
82
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 75

def create_inbound_shipment(shipment_id, inbound_shipment_header,
                            inbound_shipment_items)
  build_inbound_shipment_operation('CreateInboundShipment', shipment_id,
                                   inbound_shipment_header,
                                   inbound_shipment_items)

  run
end

#create_inbound_shipment_plan(ship_from_address, inbound_shipment_plan_request_items, opts = {}) ⇒ Peddler::XMLParser

Returns the information required to create an inbound shipment

Parameters:

  • ship_from_address (Struct, Hash)
  • inbound_shipment_plan_request_items (Array<Struct, Hash>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :ship_to_country_code (String)
  • :ship_to_country_subdivision_code (String)
  • :label_prep_preference (String)

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 54

def create_inbound_shipment_plan(ship_from_address,
                                 inbound_shipment_plan_request_items,
                                 opts = {})
  operation('CreateInboundShipmentPlan')
    .add(opts)
    .add('ShipFromAddress' => ship_from_address,
         'InboundShipmentPlanRequestItems' =>
           inbound_shipment_plan_request_items)
    .structure!('InboundShipmentPlanRequestItems', 'member')
    .structure!('PrepDetailsList', 'member')

  run
end

#estimate_transport_request(shipment_id) ⇒ Peddler::XMLParser

Requests an estimate of the shipping cost for an inbound shipment



182
183
184
185
186
187
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 182

def estimate_transport_request(shipment_id)
  operation('EstimateTransportRequest')
    .add('ShipmentId' => shipment_id)

  run
end

#get_bill_of_lading(shipment_id) ⇒ Peddler::XMLParser

Returns PDF document data for printing a bill of lading for an inbound shipment



283
284
285
286
287
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 283

def get_bill_of_lading(shipment_id)
  operation('GetBillOfLading')
    .add('ShipmentId' => shipment_id)
  run
end

#get_inbound_guidance_for_asin(marketplace_id, *asin_list) ⇒ Peddler::XMLParser

Returns inbound guidance for a list of items by ASIN

Parameters:

  • marketplace_id (String)
  • asin_list (Array<String>)

Returns:

See Also:



36
37
38
39
40
41
42
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 36

def get_inbound_guidance_for_asin(marketplace_id, *asin_list)
  operation('GetInboundGuidanceForASIN')
    .add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
    .structure!('ASINList', 'Id')

  run
end

#get_inbound_guidance_for_sku(marketplace_id, *seller_sku_list) ⇒ Peddler::XMLParser

Returns inbound guidance for a list of items by Seller SKU

Parameters:

  • marketplace_id (String)
  • seller_sku_list (Array<String>)

Returns:

See Also:



21
22
23
24
25
26
27
28
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 21

def get_inbound_guidance_for_sku(marketplace_id, *seller_sku_list)
  operation('GetInboundGuidanceForSKU')
    .add('MarketplaceId' => marketplace_id,
         'SellerSKUList' => seller_sku_list)
    .structure!('SellerSKUList', 'Id')

  run
end

#get_package_labels(shipment_id, page_type, opts = {}) ⇒ Peddler::XMLParser

Returns PDF document data for printing package labels for an inbound shipment

Parameters:

  • shipment_id (String)
  • page_type (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :number_of_packages (Integer)

Returns:

See Also:



236
237
238
239
240
241
242
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 236

def get_package_labels(shipment_id, page_type, opts = {})
  operation('GetPackageLabels')
    .add(opts)
    .add('ShipmentId' => shipment_id, 'PageType' => page_type)

  run
end

#get_pallet_labels(shipment_id, page_type, number_of_pallets) ⇒ Peddler::XMLParser

Returns pallet labels

Parameters:

  • shipment_id (String)
  • page_type (String)
  • number_of_pallets (Integer)

Returns:

See Also:



269
270
271
272
273
274
275
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 269

def get_pallet_labels(shipment_id, page_type, number_of_pallets)
  operation('GetPalletLabels')
    .add('ShipmentId' => shipment_id, 'PageType' => page_type,
         'NumberOfPallets' => number_of_pallets)

  run
end

#get_preorder_info(shipment_id) ⇒ Peddler::XMLParser

Returns pre-order information, including dates



105
106
107
108
109
110
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 105

def get_preorder_info(shipment_id)
  operation('GetPreorderInfo')
    .add('ShipmentId' => shipment_id)

  run
end

#get_prep_instructions_for_asin(ship_to_country_code, *asin_list) ⇒ Peddler::XMLParser

Returns item preparation instructions to help with item sourcing decisions

Parameters:

  • ship_to_country_code (String)
  • asin_list (Array<String>)

Returns:

See Also:



148
149
150
151
152
153
154
155
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 148

def get_prep_instructions_for_asin(ship_to_country_code, *asin_list)
  operation('GetPrepInstructionsForASIN')
    .add('ASINList' => asin_list,
         'ShipToCountryCode' => ship_to_country_code)
    .structure!('ASINList', 'Id')

  run
end

#get_prep_instructions_for_sku(ship_to_country_code, *seller_sku_list) ⇒ Peddler::XMLParser

Returns labeling requirements and item preparation instructions to help you prepare items for an inbound shipment

Parameters:

  • ship_to_country_code (String)
  • seller_sku_list (Array<String>)

Returns:

See Also:



132
133
134
135
136
137
138
139
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 132

def get_prep_instructions_for_sku(ship_to_country_code, *seller_sku_list)
  operation('GetPrepInstructionsForSKU')
    .add('SellerSKUList' => seller_sku_list,
         'ShipToCountryCode' => ship_to_country_code)
    .structure!('SellerSKUList', 'Id')

  run
end

#get_service_statusPeddler::XMLParser

Gets the operational status of the API



351
352
353
354
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 351

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_transport_content(shipment_id) ⇒ Peddler::XMLParser

Returns current transportation information about an inbound shipment



194
195
196
197
198
199
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 194

def get_transport_content(shipment_id)
  operation('GetTransportContent')
    .add('ShipmentId' => shipment_id)

  run
end

#get_unique_package_labels(shipment_id, page_type, package_labels_to_print) ⇒ Peddler::XMLParser

Returns unique package labels for faster and more accurate shipment processing at the Amazon fulfillment centre

Parameters:

  • shipment_id (String)
  • page_type (String)
  • package_labels_to_print (Array<String>)

Returns:

See Also:



252
253
254
255
256
257
258
259
260
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 252

def get_unique_package_labels(shipment_id, page_type,
                              package_labels_to_print)
  operation('GetUniquePackageLabels')
    .add('ShipmentId' => shipment_id, 'PageType' => page_type,
         'PackageLabelsToPrint' => package_labels_to_print)
    .structure!('PackageLabelsToPrint', 'member')

  run
end

#list_inbound_shipment_items(opts = {}) ⇒ Peddler::XMLParser

Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :shipment_id (String)
  • :last_updated_after (String, #iso8601)
  • :last_updated_before (String, #iso8601)

Returns:

See Also:



328
329
330
331
332
333
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 328

def list_inbound_shipment_items(opts = {})
  operation('ListInboundShipmentItems')
    .add(opts)

  run
end

#list_inbound_shipment_items_by_next_token(next_token) ⇒ Peddler::XMLParser

Returns the next page of inbound shipment items



340
341
342
343
344
345
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 340

def list_inbound_shipment_items_by_next_token(next_token)
  operation('ListInboundShipmentItemsByNextToken')
    .add('NextToken' => next_token)

  run
end

#list_inbound_shipments(opts = {}) ⇒ Peddler::XMLParser

Returns a list of inbound shipments based on criteria that you specify

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :shipment_status_list (Array<String>)
  • :shipment_id_list (Array<String>)
  • :last_updated_after (String, #iso8601)
  • :last_updated_before (String, #iso8601)

Returns:

See Also:



298
299
300
301
302
303
304
305
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 298

def list_inbound_shipments(opts = {})
  operation('ListInboundShipments')
    .add(opts)
    .structure!('ShipmentStatusList', 'member')
    .structure!('ShipmentIdList', 'member')

  run
end

#list_inbound_shipments_by_next_token(next_token) ⇒ Peddler::XMLParser

Returns the next page of inbound shipments



312
313
314
315
316
317
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 312

def list_inbound_shipments_by_next_token(next_token)
  operation('ListInboundShipmentsByNextToken')
    .add('NextToken' => next_token)

  run
end

#put_transport_content(shipment_id, is_partnered, shipment_type, transport_details) ⇒ Peddler::XMLParser

Sends transportation information to Amazon about an inbound shipment

Parameters:

  • shipment_id (String)
  • is_partnered (Boolean)
  • shipment_type (String)
  • transport_details (Struct, Hash)

Returns:

See Also:



165
166
167
168
169
170
171
172
173
174
175
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 165

def put_transport_content(shipment_id, is_partnered, shipment_type,
                          transport_details)
  operation('PutTransportContent')
    .add('ShipmentId' => shipment_id, 'IsPartnered' => is_partnered,
         'ShipmentType' => shipment_type,
         'TransportDetails' => transport_details)
    .structure!('PackageList', 'member')
    .structure!('PalletList', 'member')

  run
end

#update_inbound_shipment(shipment_id, inbound_shipment_header, inbound_shipment_items) ⇒ Peddler::XMLParser

Updates an existing inbound shipment

Parameters:

  • shipment_id (String)
  • inbound_shipment_header (Struct, Hash)
  • :inbound_shipment_items (Array<Struct, Hash>)

Returns:

See Also:



91
92
93
94
95
96
97
98
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 91

def update_inbound_shipment(shipment_id, inbound_shipment_header,
                            inbound_shipment_items)
  build_inbound_shipment_operation('UpdateInboundShipment', shipment_id,
                                   inbound_shipment_header,
                                   inbound_shipment_items)

  run
end

#void_transport_request(shipment_id) ⇒ Peddler::XMLParser

Voids a previously-confirmed request to ship your inbound shipment using an Amazon-partnered carrier



220
221
222
223
224
225
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 220

def void_transport_request(shipment_id)
  operation('VoidTransportRequest')
    .add('ShipmentId' => shipment_id)

  run
end