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_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



117
118
119
120
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 117

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:



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

def create_inbound_shipment(shipment_id, inbound_shipment_header, opts = {})
  operation('CreateInboundShipment')
    .add(opts.update(
           'ShipmentId' => shipment_id,
           'InboundShipmentHeader' => inbound_shipment_header
    ))
    .structure!('InboundShipmentItems', 'member')

  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:



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

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



96
97
98
99
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 96

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



158
159
160
161
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 158

def get_bill_of_lading(shipment_id)
  operation('GetBillOfLading').add('ShipmentId' => shipment_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:



142
143
144
145
146
147
148
149
150
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 142

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

  run
end

#get_service_statusPeddler::XMLParser

Gets the operational status of the API



223
224
225
226
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 223

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_transport_content(shipment_id) ⇒ Peddler::XMLParser

Returns current transportation information about an inbound shipment



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

def get_transport_content(shipment_id)
  operation('GetTransportContent').add('ShipmentId' => shipment_id)
  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:



202
203
204
205
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 202

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



212
213
214
215
216
217
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 212

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:



172
173
174
175
176
177
178
179
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 172

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



186
187
188
189
190
191
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 186

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:



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

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

  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:



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

def update_inbound_shipment(shipment_id, inbound_shipment_header, opts = {})
  operation('UpdateInboundShipment')
    .add(opts.update(
           'ShipmentId' => shipment_id,
           'InboundShipmentHeader' => inbound_shipment_header
    ))
    .structure!('InboundShipmentItems', 'member')

  run
end

#void_transport_request(shipment_id) ⇒ Peddler::XMLParser

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



128
129
130
131
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 128

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