peddler 3.0.0.beta1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +108 -110
- data/lib/peddler/api.rb +56 -18
- data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +38 -26
- data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +97 -59
- data/lib/peddler/apis/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +14 -4
- data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +34 -23
- data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +39 -29
- data/lib/peddler/{api → apis}/catalog_items_v0.rb +43 -30
- data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +47 -31
- data/lib/peddler/apis/easy_ship_2022_03_23.rb +126 -0
- data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +15 -7
- data/lib/peddler/{api → apis}/fba_inventory_v1.rb +45 -29
- data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +54 -33
- data/lib/peddler/apis/finances_2024_06_19.rb +50 -0
- data/lib/peddler/{api → apis}/finances_v0.rb +50 -36
- data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +384 -255
- data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +138 -93
- data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +105 -68
- data/lib/peddler/apis/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/apis/listings_items_2020_09_01.rb +95 -0
- data/lib/peddler/apis/listings_items_2021_08_01.rb +136 -0
- data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +21 -11
- data/lib/peddler/apis/merchant_fulfillment_v0.rb +80 -0
- data/lib/peddler/{api → apis}/messaging_v1.rb +107 -75
- data/lib/peddler/{api → apis}/notifications_v1.rb +63 -32
- data/lib/peddler/{api → apis}/orders_v0.rb +99 -84
- data/lib/peddler/apis/product_fees_v0.rb +77 -0
- data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +24 -13
- data/lib/peddler/{api → apis}/product_pricing_v0.rb +70 -52
- data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +32 -21
- data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +25 -13
- data/lib/peddler/{api → apis}/reports_2021_06_30.rb +71 -47
- data/lib/peddler/{api → apis}/sales_v1.rb +22 -14
- data/lib/peddler/{api → apis}/sellers_v1.rb +19 -7
- data/lib/peddler/{api → apis}/services_v1.rb +156 -116
- data/lib/peddler/apis/shipment_invoicing_v0.rb +59 -0
- data/lib/peddler/apis/shipping_v1.rb +132 -0
- data/lib/peddler/{api → apis}/shipping_v2.rb +150 -98
- data/lib/peddler/{api → apis}/solicitations_v1.rb +21 -11
- data/lib/peddler/apis/supply_sources_2020_07_01.rb +100 -0
- data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +15 -7
- data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +18 -8
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +14 -6
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +33 -21
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +33 -21
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +13 -5
- data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +86 -60
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +189 -0
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +14 -6
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +14 -6
- data/lib/peddler/apis/vendor_invoices_v1.rb +30 -0
- data/lib/peddler/{api → apis}/vendor_orders_v1.rb +59 -48
- data/lib/peddler/apis/vendor_shipments_v1.rb +132 -0
- data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +14 -5
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +21 -11
- data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
- data/lib/peddler/json_feed_document.rb +31 -0
- data/lib/peddler/marketplace.rb +93 -0
- data/lib/peddler/response.rb +46 -0
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +55 -52
- metadata +64 -57
- data/lib/peddler/access_token.rb +0 -76
- data/lib/peddler/api/easy_ship_2022_03_23.rb +0 -108
- data/lib/peddler/api/listings_items_2020_09_01.rb +0 -84
- data/lib/peddler/api/listings_items_2021_08_01.rb +0 -154
- data/lib/peddler/api/merchant_fulfillment_v0.rb +0 -64
- data/lib/peddler/api/product_fees_v0.rb +0 -69
- data/lib/peddler/api/shipment_invoicing_v0.rb +0 -46
- data/lib/peddler/api/shipping_v1.rb +0 -107
- data/lib/peddler/api/supply_sources_2020_07_01.rb +0 -82
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +0 -35
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +0 -165
- data/lib/peddler/api/vendor_invoices_v1.rb +0 -22
- data/lib/peddler/api/vendor_shipments_v1.rb +0 -120
- data/lib/peddler/region.rb +0 -30
@@ -3,7 +3,13 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def product_pricing_2022_05_01(...)
|
8
|
+
APIs::ProductPricing20220501.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Pricing
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing
|
@@ -13,30 +19,35 @@ module Peddler
|
|
13
19
|
# Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request
|
14
20
|
# body. The response for each successful (HTTP status code 200) request in the set includes the computed listing
|
15
21
|
# price at or below which a seller can expect to become the featured offer (before applicable promotions). This is
|
16
|
-
# called the featured offer expected price (FOEP). Featured offer is not guaranteed
|
17
|
-
# change
|
18
|
-
#
|
22
|
+
# called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might
|
23
|
+
# change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer.
|
24
|
+
# The response to an unsuccessful request includes the available error text.
|
19
25
|
#
|
20
|
-
# @
|
26
|
+
# @note This operation can make a static sandbox call.
|
27
|
+
# @param get_featured_offer_expected_price_batch_request_body [Hash] The batch of `getFeaturedOfferExpectedPrice`
|
21
28
|
# requests.
|
22
|
-
# @
|
23
|
-
|
29
|
+
# @param rate_limit [Float] Requests per second
|
30
|
+
# @return [Peddler::Response] The API response
|
31
|
+
def get_featured_offer_expected_price_batch(get_featured_offer_expected_price_batch_request_body,
|
32
|
+
rate_limit: 0.033)
|
24
33
|
path = "/batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice"
|
25
34
|
body = get_featured_offer_expected_price_batch_request_body
|
26
35
|
|
27
|
-
rate_limit
|
36
|
+
meter(rate_limit).post(path, body:)
|
28
37
|
end
|
29
38
|
|
30
|
-
# Returns the competitive summary response including featured buying options for the ASIN and `marketplaceId`
|
39
|
+
# Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId`
|
31
40
|
# combination.
|
32
41
|
#
|
33
|
-
# @
|
34
|
-
# @
|
35
|
-
|
42
|
+
# @note This operation can make a static sandbox call.
|
43
|
+
# @param requests [Hash] The batch of `getCompetitiveSummary` requests.
|
44
|
+
# @param rate_limit [Float] Requests per second
|
45
|
+
# @return [Peddler::Response] The API response
|
46
|
+
def get_competitive_summary(requests, rate_limit: 0.033)
|
36
47
|
path = "/batches/products/pricing/2022-05-01/items/competitiveSummary"
|
37
48
|
body = requests
|
38
49
|
|
39
|
-
rate_limit
|
50
|
+
meter(rate_limit).post(path, body:)
|
40
51
|
end
|
41
52
|
end
|
42
53
|
end
|
@@ -3,33 +3,42 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def product_pricing_v0(...)
|
8
|
+
APIs::ProductPricingV0.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Pricing
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for
|
10
16
|
# Amazon Marketplace products.
|
11
17
|
class ProductPricingV0 < API
|
12
|
-
# Returns pricing information for a seller's offer listings based on seller SKU or ASIN.
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
18
|
+
# Returns pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The parameters
|
19
|
+
# associated with this operation may contain special characters that require URL encoding to call the API. To
|
20
|
+
# avoid errors with SKUs when encoding URLs, refer to [URL
|
21
|
+
# Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
16
22
|
#
|
17
|
-
# @
|
23
|
+
# @note This operation can make a static sandbox call.
|
24
|
+
# @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for which prices are
|
18
25
|
# returned.
|
19
|
-
# @param [Array<String>]
|
26
|
+
# @param asins [Array<String>] A list of up to twenty Amazon Standard Identification Number (ASIN) values used to
|
20
27
|
# identify items in the given marketplace.
|
21
|
-
# @param [Array<String>]
|
28
|
+
# @param skus [Array<String>] A list of up to twenty seller SKU values used to identify items in the given
|
22
29
|
# marketplace.
|
23
|
-
# @param [String]
|
30
|
+
# @param item_type [String] Indicates whether ASIN values or seller SKU values are used to identify items. If you
|
24
31
|
# specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins
|
25
32
|
# parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you
|
26
33
|
# provide in the Skus parameter.
|
27
|
-
# @param [String]
|
34
|
+
# @param item_condition [String] Filters the offer listings based on item condition. Possible values: New, Used,
|
28
35
|
# Collectible, Refurbished, Club.
|
29
|
-
# @param [String]
|
36
|
+
# @param offer_type [String] Indicates whether to request pricing information for the seller's B2C or B2B offers.
|
30
37
|
# Default is B2C.
|
31
|
-
# @
|
32
|
-
|
38
|
+
# @param rate_limit [Float] Requests per second
|
39
|
+
# @return [Peddler::Response] The API response
|
40
|
+
def get_pricing(marketplace_id, item_type, asins: nil, skus: nil, item_condition: nil, offer_type: nil,
|
41
|
+
rate_limit: 0.5)
|
33
42
|
path = "/products/pricing/v0/price"
|
34
43
|
params = {
|
35
44
|
"MarketplaceId" => marketplace_id,
|
@@ -40,28 +49,30 @@ module Peddler
|
|
40
49
|
"OfferType" => offer_type,
|
41
50
|
}.compact
|
42
51
|
|
43
|
-
rate_limit
|
52
|
+
meter(rate_limit).get(path, params:)
|
44
53
|
end
|
45
54
|
|
46
|
-
# Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN.
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
55
|
+
# Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN. **Note:** The
|
56
|
+
# parameters associated with this operation may contain special characters that require URL encoding to call the
|
57
|
+
# API. To avoid errors with SKUs when encoding URLs, refer to [URL
|
58
|
+
# Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
50
59
|
#
|
51
|
-
# @
|
60
|
+
# @note This operation can make a static sandbox call.
|
61
|
+
# @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for which prices are
|
52
62
|
# returned.
|
53
|
-
# @param [Array<String>]
|
63
|
+
# @param asins [Array<String>] A list of up to twenty Amazon Standard Identification Number (ASIN) values used to
|
54
64
|
# identify items in the given marketplace.
|
55
|
-
# @param [Array<String>]
|
65
|
+
# @param skus [Array<String>] A list of up to twenty seller SKU values used to identify items in the given
|
56
66
|
# marketplace.
|
57
|
-
# @param [String]
|
67
|
+
# @param item_type [String] Indicates whether ASIN values or seller SKU values are used to identify items. If you
|
58
68
|
# specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins
|
59
69
|
# parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you
|
60
70
|
# provide in the Skus parameter. Possible values: Asin, Sku.
|
61
|
-
# @param [String]
|
71
|
+
# @param customer_type [String] Indicates whether to request pricing information from the point of view of
|
62
72
|
# Consumer or Business buyers. Default is Consumer.
|
63
|
-
# @
|
64
|
-
|
73
|
+
# @param rate_limit [Float] Requests per second
|
74
|
+
# @return [Peddler::Response] The API response
|
75
|
+
def get_competitive_pricing(marketplace_id, item_type, asins: nil, skus: nil, customer_type: nil, rate_limit: 0.5)
|
65
76
|
path = "/products/pricing/v0/competitivePrice"
|
66
77
|
params = {
|
67
78
|
"MarketplaceId" => marketplace_id,
|
@@ -71,23 +82,24 @@ module Peddler
|
|
71
82
|
"CustomerType" => customer_type,
|
72
83
|
}.compact
|
73
84
|
|
74
|
-
rate_limit
|
85
|
+
meter(rate_limit).get(path, params:)
|
75
86
|
end
|
76
87
|
|
77
|
-
# Returns the lowest priced offers for a single SKU listing.
|
78
|
-
#
|
79
|
-
#
|
80
|
-
# Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
88
|
+
# Returns the lowest priced offers for a single SKU listing. **Note:** The parameters associated with this
|
89
|
+
# operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs
|
90
|
+
# when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
81
91
|
#
|
82
|
-
# @
|
92
|
+
# @note This operation can make a static sandbox call.
|
93
|
+
# @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for which prices are
|
83
94
|
# returned.
|
84
|
-
# @param [String]
|
95
|
+
# @param item_condition [String] Filters the offer listings based on item condition. Possible values: New, Used,
|
85
96
|
# Collectible, Refurbished, Club.
|
86
|
-
# @param [String]
|
97
|
+
# @param seller_sku [String] Identifies an item in the given marketplace. SellerSKU is qualified by the seller's
|
87
98
|
# SellerId, which is included with every operation that you submit.
|
88
|
-
# @param [String]
|
89
|
-
# @
|
90
|
-
|
99
|
+
# @param customer_type [String] Indicates whether to request Consumer or Business offers. Default is Consumer.
|
100
|
+
# @param rate_limit [Float] Requests per second
|
101
|
+
# @return [Peddler::Response] The API response
|
102
|
+
def get_listing_offers(marketplace_id, item_condition, seller_sku, customer_type: nil, rate_limit: 1.0)
|
91
103
|
path = "/products/pricing/v0/listings/#{seller_sku}/offers"
|
92
104
|
params = {
|
93
105
|
"MarketplaceId" => marketplace_id,
|
@@ -95,19 +107,21 @@ module Peddler
|
|
95
107
|
"CustomerType" => customer_type,
|
96
108
|
}.compact
|
97
109
|
|
98
|
-
rate_limit
|
110
|
+
meter(rate_limit).get(path, params:)
|
99
111
|
end
|
100
112
|
|
101
113
|
# Returns the lowest priced offers for a single item based on ASIN.
|
102
114
|
#
|
103
|
-
# @
|
115
|
+
# @note This operation can make a static sandbox call.
|
116
|
+
# @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for which prices are
|
104
117
|
# returned.
|
105
|
-
# @param [String]
|
118
|
+
# @param item_condition [String] Filters the offer listings to be considered based on item condition. Possible
|
106
119
|
# values: New, Used, Collectible, Refurbished, Club.
|
107
|
-
# @param [String]
|
108
|
-
# @param [String]
|
109
|
-
# @
|
110
|
-
|
120
|
+
# @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
|
121
|
+
# @param customer_type [String] Indicates whether to request Consumer or Business offers. Default is Consumer.
|
122
|
+
# @param rate_limit [Float] Requests per second
|
123
|
+
# @return [Peddler::Response] The API response
|
124
|
+
def get_item_offers(marketplace_id, item_condition, asin, customer_type: nil, rate_limit: 0.5)
|
111
125
|
path = "/products/pricing/v0/items/#{asin}/offers"
|
112
126
|
params = {
|
113
127
|
"MarketplaceId" => marketplace_id,
|
@@ -115,29 +129,33 @@ module Peddler
|
|
115
129
|
"CustomerType" => customer_type,
|
116
130
|
}.compact
|
117
131
|
|
118
|
-
rate_limit
|
132
|
+
meter(rate_limit).get(path, params:)
|
119
133
|
end
|
120
134
|
|
121
135
|
# Returns the lowest priced offers for a batch of items based on ASIN.
|
122
136
|
#
|
123
|
-
# @
|
124
|
-
# @
|
125
|
-
|
137
|
+
# @note This operation can make a static sandbox call.
|
138
|
+
# @param get_item_offers_batch_request_body [Hash]
|
139
|
+
# @param rate_limit [Float] Requests per second
|
140
|
+
# @return [Peddler::Response] The API response
|
141
|
+
def get_item_offers_batch(get_item_offers_batch_request_body, rate_limit: 0.1)
|
126
142
|
path = "/batches/products/pricing/v0/itemOffers"
|
127
143
|
body = get_item_offers_batch_request_body
|
128
144
|
|
129
|
-
rate_limit
|
145
|
+
meter(rate_limit).post(path, body:)
|
130
146
|
end
|
131
147
|
|
132
148
|
# Returns the lowest priced offers for a batch of listings by SKU.
|
133
149
|
#
|
134
|
-
# @
|
135
|
-
# @
|
136
|
-
|
150
|
+
# @note This operation can make a static sandbox call.
|
151
|
+
# @param get_listing_offers_batch_request_body [Hash]
|
152
|
+
# @param rate_limit [Float] Requests per second
|
153
|
+
# @return [Peddler::Response] The API response
|
154
|
+
def get_listing_offers_batch(get_listing_offers_batch_request_body, rate_limit: 0.5)
|
137
155
|
path = "/batches/products/pricing/v0/listingOffers"
|
138
156
|
body = get_listing_offers_batch_request_body
|
139
157
|
|
140
|
-
rate_limit
|
158
|
+
meter(rate_limit).post(path, body:)
|
141
159
|
end
|
142
160
|
end
|
143
161
|
end
|
@@ -3,29 +3,38 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def product_type_definitions_2020_09_01(...)
|
8
|
+
APIs::ProductTypeDefinitions20200901.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Product Type Definitions
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data
|
10
16
|
# requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type
|
11
17
|
# that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the
|
12
18
|
# Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds). For
|
13
|
-
# more information, see the
|
19
|
+
# more information, see the {https://developer-docs.amazon.com/sp-api/docs/product-type-api-use-case-guide Product
|
20
|
+
# Type Definitions API Use Case Guide}.
|
14
21
|
class ProductTypeDefinitions20200901 < API
|
15
22
|
# Search for and return a list of Amazon product types that have definitions available.
|
16
23
|
#
|
17
|
-
# @
|
24
|
+
# @note This operation can make a static sandbox call.
|
25
|
+
# @param keywords [Array<String>] A comma-delimited list of keywords to search product types. **Note:** Cannot be
|
18
26
|
# used with `itemName`.
|
19
|
-
# @param [Array<String>]
|
20
|
-
# @param [String]
|
27
|
+
# @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
|
28
|
+
# @param item_name [String] The title of the ASIN to get the product type recommendation. **Note:** Cannot be used
|
21
29
|
# with `keywords`.
|
22
|
-
# @param [String]
|
30
|
+
# @param locale [String] The locale for the display names in the response. Defaults to the primary locale of the
|
23
31
|
# marketplace.
|
24
|
-
# @param [String]
|
32
|
+
# @param search_locale [String] The locale used for the `keywords` and `itemName` parameters. Defaults to the
|
25
33
|
# primary locale of the marketplace.
|
26
|
-
# @
|
34
|
+
# @param rate_limit [Float] Requests per second
|
35
|
+
# @return [Peddler::Response] The API response
|
27
36
|
def search_definitions_product_types(marketplace_ids, keywords: nil, item_name: nil, locale: nil,
|
28
|
-
search_locale: nil)
|
37
|
+
search_locale: nil, rate_limit: 5.0)
|
29
38
|
path = "/definitions/2020-09-01/productTypes"
|
30
39
|
params = {
|
31
40
|
"keywords" => keywords,
|
@@ -35,29 +44,31 @@ module Peddler
|
|
35
44
|
"searchLocale" => search_locale,
|
36
45
|
}.compact
|
37
46
|
|
38
|
-
rate_limit
|
47
|
+
meter(rate_limit).get(path, params:)
|
39
48
|
end
|
40
49
|
|
41
50
|
# Retrieve an Amazon product type definition.
|
42
51
|
#
|
43
|
-
# @
|
44
|
-
# @param [String]
|
52
|
+
# @note This operation can make a static sandbox call.
|
53
|
+
# @param product_type [String] The Amazon product type name.
|
54
|
+
# @param seller_id [String] A selling partner identifier. When provided, seller-specific requirements and values
|
45
55
|
# are populated within the product type definition schema, such as brand names associated with the selling
|
46
56
|
# partner.
|
47
|
-
# @param [Array<String>]
|
57
|
+
# @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
|
48
58
|
# Note: This parameter is limited to one marketplaceId at this time.
|
49
|
-
# @param [String]
|
59
|
+
# @param product_type_version [String] The version of the Amazon product type to retrieve. Defaults to "LATEST",.
|
50
60
|
# Prerelease versions of product type definitions may be retrieved with "RELEASE_CANDIDATE". If no prerelease
|
51
61
|
# version is currently available, the "LATEST" live version will be provided.
|
52
|
-
# @param [String]
|
53
|
-
# @param [String]
|
62
|
+
# @param requirements [String] The name of the requirements set to retrieve requirements for.
|
63
|
+
# @param requirements_enforced [String] Identifies if the required attributes for a requirements set are enforced
|
54
64
|
# by the product type definition schema. Non-enforced requirements enable structural validation of individual
|
55
65
|
# attributes without all the required attributes being present (such as for partial updates).
|
56
|
-
# @param [String]
|
66
|
+
# @param locale [String] Locale for retrieving display labels and other presentation details. Defaults to the
|
57
67
|
# default language of the first marketplace in the request.
|
58
|
-
# @
|
59
|
-
|
60
|
-
|
68
|
+
# @param rate_limit [Float] Requests per second
|
69
|
+
# @return [Peddler::Response] The API response
|
70
|
+
def get_definitions_product_type(product_type, marketplace_ids, seller_id: nil, product_type_version: "LATEST",
|
71
|
+
requirements: "LISTING", requirements_enforced: "ENFORCED", locale: "DEFAULT", rate_limit: 5.0)
|
61
72
|
path = "/definitions/2020-09-01/productTypes/#{product_type}"
|
62
73
|
params = {
|
63
74
|
"sellerId" => seller_id,
|
@@ -68,7 +79,7 @@ module Peddler
|
|
68
79
|
"locale" => locale,
|
69
80
|
}.compact
|
70
81
|
|
71
|
-
rate_limit
|
82
|
+
meter(rate_limit).get(path, params:)
|
72
83
|
end
|
73
84
|
end
|
74
85
|
end
|
@@ -3,7 +3,13 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def replenishment_2022_11_07(...)
|
8
|
+
APIs::Replenishment20221107.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Replenishment
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Replenishment (Replenishment API) provides programmatic access to replenishment
|
@@ -13,32 +19,38 @@ module Peddler
|
|
13
19
|
class Replenishment20221107 < API
|
14
20
|
# Returns aggregated replenishment program metrics for a selling partner.
|
15
21
|
#
|
16
|
-
# @
|
17
|
-
# @
|
18
|
-
|
22
|
+
# @note This operation can make a static sandbox call.
|
23
|
+
# @param body [Hash] The request body for the `getSellingPartnerMetrics` operation.
|
24
|
+
# @param rate_limit [Float] Requests per second
|
25
|
+
# @return [Peddler::Response] The API response
|
26
|
+
def get_selling_partner_metrics(body: nil, rate_limit: 1.0)
|
19
27
|
path = "/replenishment/2022-11-07/sellingPartners/metrics/search"
|
20
28
|
|
21
|
-
rate_limit
|
29
|
+
meter(rate_limit).post(path, body:)
|
22
30
|
end
|
23
31
|
|
24
32
|
# Returns aggregated replenishment program metrics for a selling partner's offers.
|
25
33
|
#
|
26
|
-
# @
|
27
|
-
# @
|
28
|
-
|
34
|
+
# @note This operation can make a static sandbox call.
|
35
|
+
# @param body [Hash] The request body for the `listOfferMetrics` operation.
|
36
|
+
# @param rate_limit [Float] Requests per second
|
37
|
+
# @return [Peddler::Response] The API response
|
38
|
+
def list_offer_metrics(body: nil, rate_limit: 1.0)
|
29
39
|
path = "/replenishment/2022-11-07/offers/metrics/search"
|
30
40
|
|
31
|
-
rate_limit
|
41
|
+
meter(rate_limit).post(path, body:)
|
32
42
|
end
|
33
43
|
|
34
44
|
# Returns the details of a selling partner's replenishment program offers.
|
35
45
|
#
|
36
|
-
# @
|
37
|
-
# @
|
38
|
-
|
46
|
+
# @note This operation can make a static sandbox call.
|
47
|
+
# @param body [Hash] The request body for the `listOffers` operation.
|
48
|
+
# @param rate_limit [Float] Requests per second
|
49
|
+
# @return [Peddler::Response] The API response
|
50
|
+
def list_offers(body: nil, rate_limit: 1.0)
|
39
51
|
path = "/replenishment/2022-11-07/offers/search"
|
40
52
|
|
41
|
-
rate_limit
|
53
|
+
meter(rate_limit).post(path, body:)
|
42
54
|
end
|
43
55
|
end
|
44
56
|
end
|