Class: MWS::MerchantFulfillment::Client

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

Overview

The Merchant Fulfillment API provides programmatic access to Amazon’s Shipping Services for sellers, including competitive rates from Amazon-partnered carriers. Sellers can find out what shipping service offers are available by submitting information about a proposed shipment, such as package size and weight, shipment origin, and delivery date requirements. Sellers can choose from the shipping service offers returned by Amazon, and then purchase shipping labels for fulfilling their orders.

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_shipment(shipment_id) ⇒ Peddler::XMLParser

Cancels an existing shipment and requests a refund for the ShipmentId value that you specify



71
72
73
74
75
76
77
78
# File 'lib/mws/merchant_fulfillment/client.rb', line 71

def cancel_shipment(shipment_id)
  operation('CancelShipment')
    .add(
      'ShipmentId' => shipment_id
    )

  run
end

#create_shipment(shipment_request_details, shipping_service_id, opts = {}) ⇒ Peddler::XMLParser

Purchases shipping and returns PNG or PDF document data for a shipping label

Parameters:

  • shipment_request_details (Struct, Hash)
  • shipping_service_id (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :shipping_service_offer_id (String)

Returns:

See Also:



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

def create_shipment(shipment_request_details, shipping_service_id, opts = {})
  operation('CreateShipment')
    .add(
      'ShipmentRequestDetails' => shipment_request_details,
      'ShippingServiceId' => shipping_service_id
    )
    .add(opts)
    .structure!('ItemList', 'Item')

  run
end

#get_eligible_shipping_services(shipment_request_details) ⇒ Peddler::XMLParser

Returns a list of shipping service offers that satisfy the shipment request details that you specify



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

def get_eligible_shipping_services(shipment_request_details)
  operation('GetEligibleShippingServices')
    .add('ShipmentRequestDetails' => shipment_request_details)
    .structure!('ItemList', 'Item')

  run
end

#get_service_statusPeddler::XMLParser

Gets the operational status of the API



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

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_shipment(shipment_id) ⇒ Peddler::XMLParser

Returns an existing shipment for the ShipmentId value that you specify



56
57
58
59
60
61
62
63
# File 'lib/mws/merchant_fulfillment/client.rb', line 56

def get_shipment(shipment_id)
  operation('GetShipment')
    .add(
      'ShipmentId' => shipment_id
    )

  run
end