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, #merchant_id, #path, #primary_marketplace_id, #version

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #error_handler, #headers, #initialize, #marketplace, #marketplace_id, #marketplace_id=, on_error, #on_error, #operation, path, #run, version

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:



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

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



228
229
230
231
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 228

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

#create_inbound_shipment(shipment_id, inbound_shipment_header, opts = {}) ⇒ Peddler::XMLParser

Creates an inbound shipment

Parameters:

  • shipment_id (String)
  • inbound_shipment_header (Struct, Hash)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :inbound_shipment_items (Array<Struct, Hash>)

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 81

def create_inbound_shipment(shipment_id, inbound_shipment_header,
                            opts = {})
  build_inbound_shipment_operation(
    'CreateInboundShipment',
    shipment_id,
    inbound_shipment_header,
    opts
  )

  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):

  • :label_prep_preference (String)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 57

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

  run
end

#estimate_transport_request(shipment_id) ⇒ Peddler::XMLParser

Requests an estimate of the shipping cost for an inbound shipment



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

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



308
309
310
311
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 308

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

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

Returns inbound guidance for a list of items by ASIN

Parameters:

  • marketplace_id (String)
  • one (String)

    or more asins

Returns:

See Also:



38
39
40
41
42
43
44
45
46
47
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 38

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

  run
end

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

Returns inbound guidance for a list of items by Seller SKU

Parameters:

  • marketplace_id (String)
  • one (String)

    or more seller_skus

Returns:

See Also:



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

def get_inbound_guidance_for_sku(marketplace_id, *seller_skus)
  operation('GetInboundGuidanceForSKU')
    .add(
      'MarketplaceId' => marketplace_id,
      'SellerSKUList' => seller_skus
    )
    .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:



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

def get_package_labels(shipment_id, page_type, opts = {})
  operation('GetPackageLabels')
    .add(opts.update(
           '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:



291
292
293
294
295
296
297
298
299
300
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 291

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



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

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

  run
end

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

Returns item preparation instructions to help with item sourcing decisions

Parameters:

  • ship_to_country_code (String)
  • one (String)

    or more asins

Returns:

See Also:



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

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

  run
end

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

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

Parameters:

  • ship_to_country_code (String)
  • one (String)

    or more seller_skus

Returns:

See Also:



150
151
152
153
154
155
156
157
158
159
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 150

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

  run
end

#get_service_statusPeddler::XMLParser

Gets the operational status of the API



373
374
375
376
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 373

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_transport_content(shipment_id) ⇒ Peddler::XMLParser

Returns current transportation information about an inbound shipment



217
218
219
220
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 217

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:



271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 271

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:



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

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



362
363
364
365
366
367
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 362

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:



322
323
324
325
326
327
328
329
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 322

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



336
337
338
339
340
341
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 336

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:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 187

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, opts = {}) ⇒ Peddler::XMLParser

Updates an existing inbound shipment

Parameters:

  • shipment_id (String)
  • inbound_shipment_header (Struct, Hash)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :inbound_shipment_items (Array<Struct, Hash>)

Returns:

See Also:



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 101

def update_inbound_shipment(shipment_id, inbound_shipment_header,
                            opts = {})
  build_inbound_shipment_operation(
    'UpdateInboundShipment',
    shipment_id,
    inbound_shipment_header,
    opts
  )

  run
end

#void_transport_request(shipment_id) ⇒ Peddler::XMLParser

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



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

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