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



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

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
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 40

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:



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



84
85
86
87
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 84

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



146
147
148
149
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 146

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:



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

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



211
212
213
214
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 211

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_transport_content(shipment_id) ⇒ Peddler::XMLParser

Returns current transportation information about an inbound shipment



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

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:



190
191
192
193
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 190

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



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

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:



160
161
162
163
164
165
166
167
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 160

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



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

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:



66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 66

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:



53
54
55
56
# File 'lib/mws/fulfillment_inbound_shipment/client.rb', line 53

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



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

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