Class: MWS::FulfillmentOutboundShipment::Client

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

Overview

The Fulfillment Outbound Shipment API enables you to fulfill orders placed through channels other than Amazon’s retail web site, using your inventory in the Amazon Fulfillment Network. You can request previews of potential fulfillment orders that return estimated shipping fees and shipping dates based on shipping speed. You can get detailed item-level, shipment-level, and order-level information for any existing fulfillment order that you specify. You can also request lists of existing fulfillment orders based on when they were fulfilled and by the fulfillment method associated with them.

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

#cancel_fulfillment_order(seller_fulfillment_order_id) ⇒ Peddler::XMLParser

Requests that Amazon stop attempting to fulfill an existing fulfillment order



155
156
157
158
159
160
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 155

def cancel_fulfillment_order(seller_fulfillment_order_id)
  operation('CancelFulfillmentOrder')
    .add('SellerFulfillmentOrderId' => seller_fulfillment_order_id)

  run
end

#create_fulfillment_order(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time, displayable_order_comment, shipping_speed_category, destination_address, items, opts = {}) ⇒ Peddler::XMLParser

Requests that Amazon ship items from the seller’s Amazon Fulfillment Network inventory to a destination address

rubocop:disable MethodLength, ParameterLists

Parameters:

  • seller_fulfillment_order_id (String)
  • displayable_order_id (String)
  • displayable_order_date_time (String, #iso8601)
  • displayable_order_comment (String)
  • shipping_speed_category (String)
  • destination_address (Struct, Hash)
  • items (Array<Struct, Hash>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :fulfillment_action (String)
  • :fulfillment_policy (String)
  • :notification_email_list (Array<String>)
  • :cod_settings (Struct, Hash)

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 59

def create_fulfillment_order(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time, displayable_order_comment, shipping_speed_category, destination_address, items, opts = {})
  if opts.key?(:cod_settings)
    opts['CODSettings'] = opts.delete(:cod_settings)
  end

  operation('CreateFulfillmentOrder')
    .add(opts
      .merge(
        'SellerFulfillmentOrderId' => seller_fulfillment_order_id,
        'DisplayableOrderId' => displayable_order_id,
        'DisplayableOrderDateTime' => displayable_order_date_time,
        'DisplayableOrderComment' => displayable_order_comment,
        'ShippingSpeedCategory' => shipping_speed_category,
        'DestinationAddress' => destination_address,
        'Items' => items
      )
        )
    .structure!('Items', 'member')
    .structure!('NotificationEmailList', 'member')

  run
end

#get_fulfillment_order(seller_fulfillment_order_id) ⇒ Peddler::XMLParser

Gets a fulfillment order



112
113
114
115
116
117
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 112

def get_fulfillment_order(seller_fulfillment_order_id)
  operation('GetFulfillmentOrder')
    .add('SellerFulfillmentOrderId' => seller_fulfillment_order_id)

  run
end

#get_fulfillment_preview(address, items, opts = {}) ⇒ Peddler::XMLParser

Lists fulfillment order previews

Parameters:

  • address (Struct, Hash)
  • items (Array<Struct, Hash>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • Array (String)

    :shipping_speed_categories

  • :include_cod_fulfillment_preview (Boolean)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 28

def get_fulfillment_preview(address, items, opts = {})
  if opts.key?(:include_cod_fulfillment_preview)
    opts['IncludeCODFulfillmentPreview'] = opts.delete(:include_cod_fulfillment_preview)
  end

  operation('GetFulfillmentPreview')
    .add(opts.update('Address' => address, 'Items' => items))
    .structure!('Items', 'member')
    .structure!('ShippingSpeedCategories')

  run
end

#get_package_tracking_detailsObject

Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment order



145
146
147
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 145

def get_package_tracking_details
  fail NotImplementedError
end

#get_service_statusPeddler::XMLParser

Gets the operational status of the API



166
167
168
169
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 166

def get_service_status
  operation('GetServiceStatus')
  run
end

#list_all_fulfillment_orders(query_start_date_time = nil) ⇒ Peddler::XMLParser

Returns a list of fulfillment orders fulfilled on or after a date

Parameters:

  • query_start_date_time (String, #iso8601) (defaults to: nil)

Returns:

See Also:



124
125
126
127
128
129
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 124

def list_all_fulfillment_orders(query_start_date_time = nil)
  opts = query_start_date_time ? { 'QueryStartDateTime' => query_start_date_time } : {}
  operation('ListAllFulfillmentOrders').add(opts)

  run
end

#list_all_fulfillment_orders_by_next_token(next_token) ⇒ Peddler::XMLParser

Returns the next page of fulfillment orders



136
137
138
139
140
141
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 136

def list_all_fulfillment_orders_by_next_token(next_token)
  operation('ListAllFulfillmentOrdersByNextToken')
    .add('NextToken' => next_token)

  run
end

#update_fulfillment_order(seller_fulfillment_order_id, opts = {}) ⇒ Peddler::XMLParser

Updates and/or requests shipment for a fulfillment order with an order hold on it

Parameters:

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

Options Hash (opts):

  • :fulfillment_action (String)
  • :displayable_order_id (String)
  • :displayable_order_date_time (String, #iso8601)
  • :displayable_order_comment (String)
  • :shipping_speed_category (String)
  • :destination_address (Struct, Hash)
  • :fulfillment_policy (String)
  • :notification_email_list (Array<String>)
  • :items (Array<Struct, Hash>)

Returns:

See Also:



98
99
100
101
102
103
104
105
# File 'lib/mws/fulfillment_outbound_shipment/client.rb', line 98

def update_fulfillment_order(seller_fulfillment_order_id, opts = {})
  operation('UpdateFulfillmentOrder')
    .add(opts.update('SellerFulfillmentOrderId' => seller_fulfillment_order_id))
    .structure!('NotificationEmailList', 'member')
    .structure!('Items', 'member')

  run
end