Class: Peddler::APIs::Promotions20251201
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::Promotions20251201
- Defined in:
- lib/peddler/apis/promotions_2025_12_01.rb,
lib/peddler/apis/promotions_2025_12_01/item.rb,
lib/peddler/apis/promotions_2025_12_01/error.rb,
lib/peddler/apis/promotions_2025_12_01/issue.rb,
lib/peddler/apis/promotions_2025_12_01/budget.rb,
lib/peddler/apis/promotions_2025_12_01/discount.rb,
lib/peddler/apis/promotions_2025_12_01/schedule.rb,
lib/peddler/apis/promotions_2025_12_01/selection.rb,
lib/peddler/apis/promotions_2025_12_01/claim_code.rb,
lib/peddler/apis/promotions_2025_12_01/error_list.rb,
lib/peddler/apis/promotions_2025_12_01/item_issue.rb,
lib/peddler/apis/promotions_2025_12_01/pagination.rb,
lib/peddler/apis/promotions_2025_12_01/upfront_fee.rb,
lib/peddler/apis/promotions_2025_12_01/benefit_tier.rb,
lib/peddler/apis/promotions_2025_12_01/item_benefit.rb,
lib/peddler/apis/promotions_2025_12_01/variable_fee.rb,
lib/peddler/apis/promotions_2025_12_01/merchandising.rb,
lib/peddler/apis/promotions_2025_12_01/item_identifier.rb,
lib/peddler/apis/promotions_2025_12_01/latest_revision.rb,
lib/peddler/apis/promotions_2025_12_01/promotion_issue.rb,
lib/peddler/apis/promotions_2025_12_01/selection_rules.rb,
lib/peddler/apis/promotions_2025_12_01/amount_threshold.rb,
lib/peddler/apis/promotions_2025_12_01/customer_segment.rb,
lib/peddler/apis/promotions_2025_12_01/promotion_benefit.rb,
lib/peddler/apis/promotions_2025_12_01/promotion_summary.rb,
lib/peddler/apis/promotions_2025_12_01/selection_details.rb,
lib/peddler/apis/promotions_2025_12_01/purchase_condition.rb,
lib/peddler/apis/promotions_2025_12_01/quantity_threshold.rb,
lib/peddler/apis/promotions_2025_12_01/previewed_fee_rates.rb,
lib/peddler/apis/promotions_2025_12_01/brand_segment_details.rb,
lib/peddler/apis/promotions_2025_12_01/purchase_requirements.rb,
lib/peddler/apis/promotions_2025_12_01/get_promotion_response.rb,
lib/peddler/apis/promotions_2025_12_01/get_selection_response.rb,
lib/peddler/apis/promotions_2025_12_01/promotion_fee_snapshot.rb,
lib/peddler/apis/promotions_2025_12_01/customer_segment_details.rb,
lib/peddler/apis/promotions_2025_12_01/search_promotions_response.rb,
lib/peddler/apis/promotions_2025_12_01/promotion_revision_attributes.rb,
sig/peddler/apis/promotions_2025_12_01.rbs
Overview
The Selling Partner API for Promotions
The Selling Partner API for Promotions enables selling partners to create and manage promotions.
Defined Under Namespace
Classes: AmountThreshold, BenefitTier, BrandSegmentDetails, Budget, ClaimCode, CustomerSegment, CustomerSegmentDetails, Discount, Error, ErrorList, GetPromotionResponse, GetSelectionResponse, Issue, Item, ItemBenefit, ItemIdentifier, ItemIssue, LatestRevision, Merchandising, Pagination, PreviewedFeeRates, PromotionBenefit, PromotionFeeSnapshot, PromotionIssue, PromotionRevisionAttributes, PromotionSummary, PurchaseCondition, PurchaseRequirements, QuantityThreshold, Schedule, SearchPromotionsResponse, Selection, SelectionDetails, SelectionRules, UpfrontFee, VariableFee
Constant Summary
Constants inherited from Peddler::API
Peddler::API::TRANSIENT_STATUSES
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #base_url, #endpoint, #retries
Instance Method Summary collapse
-
#get_promotion(promotion_id, included_data: nil, locale: "en_US") ⇒ Peddler::Response
Retrieve details of a specified promotion.
-
#get_selection(promotion_id, selection_id, revision_id, locale: "en_US", pagination_token: nil, limit: 20, included_data: nil) ⇒ Peddler::Response
Retrieve up to 100 product items that are associated with a specified promotion.
-
#search_promotions(marketplace_ids, locale: "en_US", statuses: nil, asins: nil, skus: nil, promotion_types: nil, start_date_before: nil, start_date_after: nil, end_date_before: nil, end_date_after: nil, update_date_after: nil, update_date_before: nil, pagination_token: nil, revision: "PUBLISHED", limit: 20, included_data: nil) ⇒ Peddler::Response
Search and filter promotions based on various criteria.
Methods inherited from Peddler::API
#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #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_promotion(promotion_id, included_data: nil, locale: "en_US") ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve details of a specified promotion.
84 85 86 87 88 89 90 91 92 |
# File 'lib/peddler/apis/promotions_2025_12_01.rb', line 84 def get_promotion(promotion_id, included_data: nil, locale: "en_US") path = "/promotions/2025-12-01/promotions/#{percent_encode(promotion_id)}" params = { "includedData" => stringify_array(included_data), "locale" => locale, }.compact parser = -> { GetPromotionResponse } get(path, params:, parser:) end |
#get_selection(promotion_id, selection_id, revision_id, locale: "en_US", pagination_token: nil, limit: 20, included_data: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve up to 100 product items that are associated with a specified promotion. This operation only supports
items found in SelectionType.ITEMS. Items found in SelectionType.CATALOG are not supported. Selection
objects always include selectionDetails with item information.
114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/peddler/apis/promotions_2025_12_01.rb', line 114 def get_selection(promotion_id, selection_id, revision_id, locale: "en_US", pagination_token: nil, limit: 20, included_data: nil) path = "/promotions/2025-12-01/promotions/#{percent_encode(promotion_id)}/selections/#{percent_encode(selection_id)}" params = { "revisionId" => revision_id, "locale" => locale, "paginationToken" => pagination_token, "limit" => limit, "includedData" => stringify_array(included_data), }.compact parser = -> { GetSelectionResponse } get(path, params:, parser:) end |
#search_promotions(marketplace_ids, locale: "en_US", statuses: nil, asins: nil, skus: nil, promotion_types: nil, start_date_before: nil, start_date_after: nil, end_date_before: nil, end_date_after: nil, update_date_after: nil, update_date_before: nil, pagination_token: nil, revision: "PUBLISHED", limit: 20, included_data: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Search and filter promotions based on various criteria. Returns a paginated list of promotion summaries.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/peddler/apis/promotions_2025_12_01.rb', line 49 def search_promotions(marketplace_ids, locale: "en_US", statuses: nil, asins: nil, skus: nil, promotion_types: nil, start_date_before: nil, start_date_after: nil, end_date_before: nil, end_date_after: nil, update_date_after: nil, update_date_before: nil, pagination_token: nil, revision: "PUBLISHED", limit: 20, included_data: nil) path = "/promotions/2025-12-01/promotions" params = { "marketplaceIds" => stringify_array(marketplace_ids), "locale" => locale, "statuses" => stringify_array(statuses), "asins" => stringify_array(asins), "skus" => stringify_array(skus), "promotionTypes" => stringify_array(promotion_types), "startDateBefore" => start_date_before, "startDateAfter" => start_date_after, "endDateBefore" => end_date_before, "endDateAfter" => end_date_after, "updateDateAfter" => update_date_after, "updateDateBefore" => update_date_before, "paginationToken" => pagination_token, "revision" => revision, "limit" => limit, "includedData" => stringify_array(included_data), }.compact parser = -> { SearchPromotionsResponse } get(path, params:, parser:) end |