Module: Peddler::Reports::VendorCoupon
- Defined in:
- lib/peddler/reports/vendor_coupon.rb,
lib/peddler/reports/vendor_coupon/report.rb,
lib/peddler/reports/vendor_coupon/asin_details.rb,
lib/peddler/reports/vendor_coupon/coupon_details.rb,
lib/peddler/reports/vendor_coupon/report_options.rb,
lib/peddler/reports/vendor_coupon/details_by_campaign.rb,
lib/peddler/reports/vendor_coupon/report_specification.rb
Overview
This report contains data to help vendors optimize their coupons and adjust their advertising strategies. This report supports start dates up to two years before the current date.
Constant Summary collapse
- Report =
This report contains data to help vendors optimize their coupons and adjust their advertising strategies. This report supports start dates up to two years before the current date.
Structure.new do # @return [Array<DetailsByCampaign>] List of included campaigns. attribute(:campaigns, [DetailsByCampaign]) # @return [Hash] Summarizes the original report request. attribute(:report_specification, ReportSpecification, from: "reportSpecification") end
- ASINDetails =
Contains details about an asin.
Structure.new do # @return [String] Asin of the product. attribute(:asin, String) # @return [Float] Discount amount the customer receives on the product. Reflects a percentage when discountType # is PERCENT_OFF_LIST_PRICE and a currency value when discountType is AMOUNT_OFF_LIST_PRICE. attribute(:discount_amount, Float, from: "discountAmount") # @return [String] Whether the discount is given as a fixed amount or a percentage off the list price. attribute(:discount_type, String, from: "discountType") end
- CouponDetails =
Contains details about a coupon.
Structure.new do # @return [Array<AsinDetails>] Discount details of the products associated with the coupon. attribute(:asins, [ASINDetails]) # @return [Float] Percentage of the allocated budget that has been spent, equal to the budgetSpent divided by # budget or campaign totalBudget as appropriate. attribute(:budget_percentage_used, Float, from: "budgetPercentageUsed") # @return [Float] Total amount spent by the vendor on the coupon, including clip fees and redemption fees. # Currency value. Represents a gross value, including purchases that were returned or cancelled. attribute(:budget_spent, Float, from: "budgetSpent") # @return [Integer] Number of times the coupon has been applied on the product page. attribute(:clips, Integer) # @return [String] Unique identifier of the coupon. attribute(:coupon_id, String, from: "couponId") # @return [String] The customer segment that the coupon is available to. attribute(:customer_segment, String, from: "customerSegment") # @return [Time] Coupon end date-time in UTC. attribute(:end_date_time, Time, from: "endDateTime") # @return [:boolean] Whether or not the coupon can only be redeemed once per customer account. attribute(:once_per_customer, :boolean, from: "isOncePerCustomer") # @return [Integer] Number of times the coupon has been used for a purchase. Represents a gross value, including # purchases that were returned or cancelled. attribute(:redemptions, Integer) # @return [Time] Coupon start date-time in UTC. attribute(:start_date_time, Time, from: "startDateTime") # @return [Float] Total amount saved by customers redeeming the coupon. Currency value. Represents a gross # value, including purchases that were returned or cancelled. attribute(:total_discount, Float, from: "totalDiscount") # @return [Float] Budget allocated to the coupon. Currency value. Only present when campaign budgetType is # PER_INDIVIDUAL_COUPON. attribute?(:budget, Float) # @return [Float] Budget remaining for the coupon, equal to budget minus budgetSpent. Currency value. Only # present when campaign budgetType is PER_INDIVIDUAL_COUPON. Represents a gross value, including purchases that # were returned or cancelled. attribute?(:budget_remaining, Float, from: "budgetRemaining") # @return [String] The name given to the coupon. attribute?(:name, String) # @return [String] Message displayed with the coupon on the product page. attribute?(:website_message, String, from: "websiteMessage") end
- ReportOptions =
Report options specifying parameters campaignStartDateFrom and campaignStartDateTo.
Structure.new do # @return [Time] The start of a date-time range in UTC used for selecting coupons to report on. All coupons with # a start date-time that falls within the range will be included. attribute(:campaign_start_date_from, Time, from: "campaignStartDateFrom") # @return [Time] The end of a date-time range in UTC used for selecting coupons to report on. All coupons with a # start date-time that falls within the range will be included. attribute(:campaign_start_date_to, Time, from: "campaignStartDateTo") end
- DetailsByCampaign =
Contains details about a campaign and every included coupon.
Structure.new do # @return [String] Whether the budget is allocated independently for each coupon or shared among all coupons. attribute(:budget_type, String, from: "budgetType") # @return [String] Unique identifier of the campaign. attribute(:campaign_id, String, from: "campaignId") # @return [String] Name given to the campaign. attribute(:campaign_name, String, from: "campaignName") # @return [Array<CouponDetails>] A list of included coupons and their details. attribute(:coupons, [CouponDetails]) # @return [Time] Campaign creation date-time in UTC. attribute(:creation_date_time, Time, from: "creationDateTime") # @return [:boolean] Whether or not the campaign is a Subscribe and Save offer. attribute(:subscribe_and_save, :boolean, from: "isSubscribeAndSave") # @return [Time] The latest date-time the campaign data in this report was updated. May be up to 24 hours before # the current date-time. attribute(:last_updated_date_time, Time, from: "lastUpdatedDateTime") # @return [String] The marketplace the campaign is running in. attribute(:marketplace_id, String, from: "marketplaceId") # @return [Integer] Total number of times a coupon in the campaign has been applied on the product page, equal # to the sum of all coupon clips. attribute(:total_clips, Integer, from: "totalClips") # @return [Integer] Total number of times a coupon in the campaign has been used for a purchase, equal to the # sum of all coupon redemptions. attribute(:total_redemptions, Integer, from: "totalRedemptions") # @return [String] The vendor code associated with the campaign. attribute(:vendor_code, String, from: "vendorCode") # @return [String] ISO 4217 currency code of all currency values in the campaign. attribute?(:currency_code, String, from: "currencyCode") # @return [Float] Total budget allocated to the campaign. Currency value. Only present when budgetType is # SHARED_BUDGET. attribute?(:total_budget, Float, from: "totalBudget") # @return [Float] The budget remaining for the campaign, equal to totalBudget minus totalBudgetSpent. Currency # value. Only present when budgetType is SHARED_BUDGET. attribute?(:total_budget_remaining, Float, from: "totalBudgetRemaining") # @return [Float] Total amount spent by the vendor on the campaign, including clip fees and redemption fees, # equal to the sum of all coupon budgetSpent. Currency value. Only present when budgetType is SHARED_BUDGET. attribute?(:total_budget_spent, Float, from: "totalBudgetSpent") end
- ReportSpecification =
Summarizes the original report request.
Structure.new do # @return [Array<String>] Marketplace IDs as specified in the report request. attribute(:marketplace_ids, [String], from: "marketplaceIds") # @return [ReportOptions] Report options specifying parameters campaignStartDateFrom and campaignStartDateTo. attribute(:report_options, ReportOptions, from: "reportOptions") # @return [String] The report type. attribute(:report_type, String, from: "reportType") end
Class Method Summary collapse
Class Method Details
.parse(hash) ⇒ Object
13 14 15 |
# File 'lib/peddler/reports/vendor_coupon.rb', line 13 def parse(hash) Report.parse(hash) end |