Class: Peddler::API::SalesV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::API::SalesV1
- Defined in:
- lib/peddler/api/sales_v1.rb
Overview
Selling Partner API for Sales
The Selling Partner API for Sales provides APIs related to sales performance.
Instance Attribute Summary
Attributes inherited from Peddler::API
Instance Method Summary collapse
-
#get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All", fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5) ⇒ Hash
Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.
Methods inherited from Peddler::API
#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All", fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5) ⇒ Hash
Note:
This operation can make a static sandbox call.
Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/peddler/api/sales_v1.rb', line 58 def get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All", fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5) path = "/sales/v1/orderMetrics" params = { "marketplaceIds" => marketplace_ids, "interval" => interval, "granularityTimeZone" => granularity_time_zone, "granularity" => granularity, "buyerType" => buyer_type, "fulfillmentNetwork" => fulfillment_network, "firstDayOfWeek" => first_day_of_week, "asin" => asin, "sku" => sku, }.compact meter(rate_limit).get(path, params:) end |