Module: Peddler::Reports::SellingPartnerMarketBasketAnalysis

Defined in:
lib/peddler/reports/selling_partner_market_basket_analysis.rb,
lib/peddler/reports/selling_partner_market_basket_analysis/report.rb,
lib/peddler/reports/selling_partner_market_basket_analysis/report_options.rb,
lib/peddler/reports/selling_partner_market_basket_analysis/details_by_asin.rb,
lib/peddler/reports/selling_partner_market_basket_analysis/report_specification.rb

Overview

The Market Basket report contains data on the items that are most commonly purchased in combination with the items in the customer's basket (cart) at checkout. The data is available across different reporting periods: DAY, WEEK, MONTH, and QUARTER. Requests can span multiple reporting periods. In this report, "asin" is an ASIN in the selling partner's catalog and "purchasedWithAsin" might or might not be an ASIN in the selling partner's catalog.

Constant Summary collapse

Report =

The Market Basket report contains data on the items that are most commonly purchased in combination with the items in the customer's basket (cart) at checkout. The data is available across different reporting periods: DAY, WEEK, MONTH, and QUARTER. Requests can span multiple reporting periods. In this report, "asin" is an ASIN in the selling partner's catalog and "purchasedWithAsin" might or might not be an ASIN in the selling partner's catalog.

Structure.new do
  # @return [Array<DetailsByAsin>]
  attribute(:data_by_asin, [DetailsByASIN], from: "dataByAsin")

  # @return [Hash] Summarizes the original report request.
  attribute(:report_specification, ReportSpecification, from: "reportSpecification")
end
ReportOptions =

Report options specifying parameters such as reportPeriod.

Structure.new do
  # @return [String] The granularity of the data in the report. Valid values are: DAY, WEEK, MONTH, QUARTER.
  attribute(:report_period, String, from: "reportPeriod")
end
DetailsByASIN =

Contains market basket analysis data for each ASIN in the selling partner's catalog.

Structure.new do
  # @return [String] Amazon Standard Identification Number.
  attribute(:asin, String)

  # @return [Float] Percentage of customer orders that contain both the selling partner's product and the
  # purchasedWithAsin in comparison to the total number of customer orders that contained at least two different
  # items including the selling partner's product.
  attribute(:combination_pct, Float, from: "combinationPct")

  # @return [Date] The end date of the data for the ASIN specified in the asin property.
  attribute(:end_date, Date, from: "endDate")

  # @return [String] The Amazon Standard Identifier Number of a product that was purchased in the same customer
  # order as the asin.
  attribute(:purchased_with_asin, String, from: "purchasedWithAsin")

  # @return [Integer] The relative frequency of the purchasedWithAsin and the asin having been purchased together.
  # Rank=1 means purchasedWithAsin is the most common product purchased in the same customer order as asin.
  attribute(:purchased_with_rank, Integer, from: "purchasedWithRank")

  # @return [Date] The start date of the data for the ASIN specified in the asin property. If the request spans
  # multiple reportPeriods, byAsin data will be shared for each of these reportPeriods.
  attribute(:start_date, Date, from: "startDate")
end
ReportSpecification =

Summarizes the original report request.

Structure.new do
  # @return [Date] The end date of the report (any time component is ignored). For WEEK, MONTH and QUARTER
  # reportPeriods, this value must correspond to the last day in the specified reportPeriod or else a fatal error
  # is returned. For example, dataEndTime must be a Saturday for the WEEK reportPeriod.
  attribute(:data_end_time, Date, from: "dataEndTime")

  # @return [Date] The start date of the report (any time component is ignored). For WEEK, MONTH and QUARTER
  # reportPeriods, this value must correspond to the first day in the specified reportPeriod or else a fatal error
  # is returned. For example, dataStartTime must be a Sunday for the WEEK reportPeriod.
  attribute(:data_start_time, Date, from: "dataStartTime")

  # @return [Array] This parameter must match the marketplaceId of the selling partner account. This report type
  # supports only one marketplaceId per report. Specifying multiple marketplaces will result in a fatal error and
  # fail to generate the report.
  attribute(:marketplace_ids, Array, from: "marketplaceIds")

  # @return [ReportOptions] Report options specifying parameters such as reportPeriod.
  attribute(:report_options, ReportOptions, from: "reportOptions")

  # @return [String] Type of the report.
  attribute(:report_type, String, from: "reportType")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



15
16
17
# File 'lib/peddler/reports/selling_partner_market_basket_analysis.rb', line 15

def parse(hash)
  Report.parse(hash)
end