Class: Peddler::APIs::SalesV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::SalesV1
- Defined in:
- lib/peddler/apis/sales_v1.rb,
lib/peddler/apis/sales_v1/error.rb,
lib/peddler/apis/sales_v1/error_list.rb,
lib/peddler/apis/sales_v1/order_metrics_list.rb,
lib/peddler/apis/sales_v1/order_metrics_interval.rb,
lib/peddler/apis/sales_v1/get_order_metrics_response.rb,
sig/peddler/apis/sales_v1.rbs
Overview
Selling Partner API for Sales
The Selling Partner API for Sales provides APIs related to sales performance.
Defined Under Namespace
Classes: Error, ErrorList, GetOrderMetricsResponse, OrderMetricsInterval, OrderMetricsList
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
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, amazon_program: nil, rate_limit: 0.5) ⇒ Peddler::Response
Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.
Methods inherited from Peddler::API
#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent
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, amazon_program: nil, rate_limit: 0.5) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/peddler/apis/sales_v1.rb', line 57 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, amazon_program: nil, rate_limit: 0.5) path = "/sales/v1/orderMetrics" params = { "marketplaceIds" => stringify_array(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, "amazonProgram" => amazon_program, }.compact parser = -> { GetOrderMetricsResponse } get(path, params:, rate_limit:, parser:) end |