Class: MWS::Orders::Client
- Inherits:
-
Peddler::Client
- Object
- Peddler::Client
- MWS::Orders::Client
- Defined in:
- lib/mws/orders/client.rb
Overview
With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
Instance Attribute Summary
Attributes inherited from Peddler::Client
#auth_token, #body, #merchant_id, #path, #primary_marketplace_id, #version
Instance Method Summary collapse
-
#get_order(*amazon_order_ids) ⇒ Peddler::XMLParser
Gets one or more orders.
-
#get_service_status ⇒ Peddler::XMLParser
Gets the service status of the API.
-
#list_order_items(amazon_order_id) ⇒ Peddler::XMLParser
Lists order items for an order.
-
#list_order_items_by_next_token(next_token) ⇒ Peddler::XMLParser
Lists the next page of order items for an order.
-
#list_orders(opts = {}) ⇒ Peddler::XMLParser
Lists orders.
-
#list_orders_by_next_token(next_token) ⇒ Peddler::XMLParser
Lists the next page of orders.
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
#get_order(*amazon_order_ids) ⇒ Peddler::XMLParser
Gets one or more orders
62 63 64 65 66 67 68 |
# File 'lib/mws/orders/client.rb', line 62 def get_order(*amazon_order_ids) operation('GetOrder') .add('AmazonOrderId' => amazon_order_ids) .structure!('AmazonOrderId', 'Id') run end |
#get_service_status ⇒ Peddler::XMLParser
Gets the service status of the API
98 99 100 101 |
# File 'lib/mws/orders/client.rb', line 98 def get_service_status operation('GetServiceStatus') run end |
#list_order_items(amazon_order_id) ⇒ Peddler::XMLParser
Lists order items for an order
75 76 77 78 79 80 |
# File 'lib/mws/orders/client.rb', line 75 def list_order_items(amazon_order_id) operation('ListOrderItems') .add('AmazonOrderId' => amazon_order_id) run end |
#list_order_items_by_next_token(next_token) ⇒ Peddler::XMLParser
Lists the next page of order items for an order
87 88 89 90 91 92 |
# File 'lib/mws/orders/client.rb', line 87 def list_order_items_by_next_token(next_token) operation('ListOrderItemsByNextToken') .add('NextToken' => next_token) run end |
#list_orders(opts = {}) ⇒ Peddler::XMLParser
Lists orders
rubocop:disable MethodLength
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mws/orders/client.rb', line 29 def list_orders(opts = {}) opts[:marketplace_id] ||= primary_marketplace_id if opts.key?(:tfm_shipment_status) opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status) end operation('ListOrders') .add(opts) .structure!('OrderStatus', 'Status') .structure!('MarketplaceId', 'Id') .structure!('PaymentMethod') .structure!('TFMShipmentStatus', 'Status') run end |
#list_orders_by_next_token(next_token) ⇒ Peddler::XMLParser
Lists the next page of orders
50 51 52 53 54 55 |
# File 'lib/mws/orders/client.rb', line 50 def list_orders_by_next_token(next_token) operation('ListOrdersByNextToken') .add('NextToken' => next_token) run end |