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,34 +3,42 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
7
|
-
|
6
|
+
class << self
|
7
|
+
def reports_2021_06_30(...)
|
8
|
+
APIs::Reports20210630.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Report v2021-06-30
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling
|
10
16
|
# partners manage their businesses.
|
11
17
|
class Reports20210630 < API
|
12
18
|
# Returns report details for the reports that match the filters that you specify.
|
13
19
|
#
|
14
|
-
# @
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param report_types [Array<String>] A list of report types used to filter reports. Refer to [Report Type
|
15
22
|
# Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When
|
16
23
|
# reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince,
|
17
24
|
# createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required.
|
18
|
-
# @param [Array<String>]
|
19
|
-
# @param [Array<String>]
|
25
|
+
# @param processing_statuses [Array<String>] A list of processing statuses used to filter reports.
|
26
|
+
# @param marketplace_ids [Array<String>] A list of marketplace identifiers used to filter reports. The reports
|
20
27
|
# returned will match at least one of the marketplaces that you specify.
|
21
|
-
# @param [Integer]
|
22
|
-
# @param [String]
|
23
|
-
# in
|
28
|
+
# @param page_size [Integer] The maximum number of reports to return in a single call.
|
29
|
+
# @param created_since [String] The earliest report creation date and time for reports to include in the response,
|
30
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date time format. The default is 90 days
|
24
31
|
# ago. Reports are retained for a maximum of 90 days.
|
25
|
-
# @param [String]
|
26
|
-
# in
|
27
|
-
# @param [String]
|
32
|
+
# @param created_until [String] The latest report creation date and time for reports to include in the response,
|
33
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date time format. The default is now.
|
34
|
+
# @param next_token [String] A string token returned in the response to your previous request. `nextToken` is
|
28
35
|
# returned when the number of results exceeds the specified `pageSize` value. To get the next page of results,
|
29
36
|
# call the `getReports` operation and include this token as the only parameter. Specifying `nextToken` with any
|
30
37
|
# other parameters will cause the request to fail.
|
31
|
-
# @
|
32
|
-
|
33
|
-
|
38
|
+
# @param rate_limit [Float] Requests per second
|
39
|
+
# @return [Peddler::Response] The API response
|
40
|
+
def get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: 10,
|
41
|
+
created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222)
|
34
42
|
path = "/reports/2021-06-30/reports"
|
35
43
|
params = {
|
36
44
|
"reportTypes" => report_types,
|
@@ -42,97 +50,113 @@ module Peddler
|
|
42
50
|
"nextToken" => next_token,
|
43
51
|
}.compact
|
44
52
|
|
45
|
-
rate_limit
|
53
|
+
meter(rate_limit).get(path, params:)
|
46
54
|
end
|
47
55
|
|
48
56
|
# Creates a report.
|
49
57
|
#
|
50
|
-
# @
|
51
|
-
# @
|
52
|
-
|
58
|
+
# @note This operation can make a static sandbox call.
|
59
|
+
# @param body [Hash] Information required to create the report.
|
60
|
+
# @param rate_limit [Float] Requests per second
|
61
|
+
# @return [Peddler::Response] The API response
|
62
|
+
def create_report(body, rate_limit: 0.0167)
|
53
63
|
path = "/reports/2021-06-30/reports"
|
54
64
|
|
55
|
-
rate_limit
|
65
|
+
meter(rate_limit).post(path, body:)
|
56
66
|
end
|
57
67
|
|
58
68
|
# Cancels the report that you specify. Only reports with `processingStatus=IN_QUEUE` can be cancelled. Cancelled
|
59
69
|
# reports are returned in subsequent calls to the `getReport` and `getReports` operations.
|
60
70
|
#
|
61
|
-
# @
|
71
|
+
# @note This operation can make a static sandbox call.
|
72
|
+
# @param report_id [String] The identifier for the report. This identifier is unique only in combination with a
|
62
73
|
# seller ID.
|
63
|
-
# @
|
64
|
-
|
74
|
+
# @param rate_limit [Float] Requests per second
|
75
|
+
# @return [Peddler::Response] The API response
|
76
|
+
def cancel_report(report_id, rate_limit: 0.0222)
|
65
77
|
path = "/reports/2021-06-30/reports/#{report_id}"
|
66
78
|
|
67
|
-
rate_limit
|
79
|
+
meter(rate_limit).delete(path)
|
68
80
|
end
|
69
81
|
|
70
82
|
# Returns report details (including the `reportDocumentId`, if available) for the report that you specify.
|
71
83
|
#
|
72
|
-
# @
|
84
|
+
# @note This operation can make a static sandbox call.
|
85
|
+
# @param report_id [String] The identifier for the report. This identifier is unique only in combination with a
|
73
86
|
# seller ID.
|
74
|
-
# @
|
75
|
-
|
87
|
+
# @param rate_limit [Float] Requests per second
|
88
|
+
# @return [Peddler::Response] The API response
|
89
|
+
def get_report(report_id, rate_limit: 2.0)
|
76
90
|
path = "/reports/2021-06-30/reports/#{report_id}"
|
77
91
|
|
78
|
-
rate_limit
|
92
|
+
meter(rate_limit).get(path)
|
79
93
|
end
|
80
94
|
|
81
95
|
# Returns report schedule details that match the filters that you specify.
|
82
96
|
#
|
83
|
-
# @
|
97
|
+
# @note This operation can make a static sandbox call.
|
98
|
+
# @param report_types [Array<String>] A list of report types used to filter report schedules. Refer to [Report
|
84
99
|
# Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information.
|
85
|
-
# @
|
86
|
-
|
100
|
+
# @param rate_limit [Float] Requests per second
|
101
|
+
# @return [Peddler::Response] The API response
|
102
|
+
def get_report_schedules(report_types, rate_limit: 0.0222)
|
87
103
|
path = "/reports/2021-06-30/schedules"
|
88
104
|
params = {
|
89
105
|
"reportTypes" => report_types,
|
90
106
|
}.compact
|
91
107
|
|
92
|
-
rate_limit
|
108
|
+
meter(rate_limit).get(path, params:)
|
93
109
|
end
|
94
110
|
|
95
111
|
# Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it
|
96
112
|
# will be cancelled and replaced with this one.
|
97
113
|
#
|
98
|
-
# @
|
99
|
-
# @
|
100
|
-
|
114
|
+
# @note This operation can make a static sandbox call.
|
115
|
+
# @param body [Hash] Information required to create the report schedule.
|
116
|
+
# @param rate_limit [Float] Requests per second
|
117
|
+
# @return [Peddler::Response] The API response
|
118
|
+
def create_report_schedule(body, rate_limit: 0.0222)
|
101
119
|
path = "/reports/2021-06-30/schedules"
|
102
120
|
|
103
|
-
rate_limit
|
121
|
+
meter(rate_limit).post(path, body:)
|
104
122
|
end
|
105
123
|
|
106
124
|
# Cancels the report schedule that you specify.
|
107
125
|
#
|
108
|
-
# @
|
126
|
+
# @note This operation can make a static sandbox call.
|
127
|
+
# @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in
|
109
128
|
# combination with a seller ID.
|
110
|
-
# @
|
111
|
-
|
129
|
+
# @param rate_limit [Float] Requests per second
|
130
|
+
# @return [Peddler::Response] The API response
|
131
|
+
def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222)
|
112
132
|
path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
|
113
133
|
|
114
|
-
rate_limit
|
134
|
+
meter(rate_limit).delete(path)
|
115
135
|
end
|
116
136
|
|
117
137
|
# Returns report schedule details for the report schedule that you specify.
|
118
138
|
#
|
119
|
-
# @
|
139
|
+
# @note This operation can make a static sandbox call.
|
140
|
+
# @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in
|
120
141
|
# combination with a seller ID.
|
121
|
-
# @
|
122
|
-
|
142
|
+
# @param rate_limit [Float] Requests per second
|
143
|
+
# @return [Peddler::Response] The API response
|
144
|
+
def get_report_schedule(report_schedule_id, rate_limit: 0.0222)
|
123
145
|
path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
|
124
146
|
|
125
|
-
rate_limit
|
147
|
+
meter(rate_limit).get(path)
|
126
148
|
end
|
127
149
|
|
128
150
|
# Returns the information required for retrieving a report document's contents.
|
129
151
|
#
|
130
|
-
# @
|
131
|
-
# @
|
132
|
-
|
152
|
+
# @note This operation can make a static sandbox call.
|
153
|
+
# @param report_document_id [String] The identifier for the report document.
|
154
|
+
# @param rate_limit [Float] Requests per second
|
155
|
+
# @return [Peddler::Response] The API response
|
156
|
+
def get_report_document(report_document_id, rate_limit: 0.0167)
|
133
157
|
path = "/reports/2021-06-30/documents/#{report_document_id}"
|
134
158
|
|
135
|
-
rate_limit
|
159
|
+
meter(rate_limit).get(path)
|
136
160
|
end
|
137
161
|
end
|
138
162
|
end
|
@@ -3,52 +3,60 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def sales_v1(...)
|
8
|
+
APIs::SalesV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Sales
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Sales provides APIs related to sales performance.
|
10
16
|
class SalesV1 < API
|
11
17
|
# Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.
|
12
18
|
#
|
13
|
-
# @
|
19
|
+
# @note This operation can make a static sandbox call.
|
20
|
+
# @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
|
14
21
|
# order was placed. Only one marketplace can be specified. For example, ATVPDKIKX0DER indicates the US
|
15
22
|
# marketplace.
|
16
|
-
# @param [String]
|
23
|
+
# @param interval [String] A time interval used for selecting order metrics. This takes the form of two dates
|
17
24
|
# separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and
|
18
25
|
# must represent absolute time (either Z notation or offset notation). Example:
|
19
26
|
# 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the
|
20
27
|
# -07:00 zone.
|
21
|
-
# @param [String]
|
28
|
+
# @param granularity_time_zone [String] An IANA-compatible time zone for determining the day boundary. Required
|
22
29
|
# when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the
|
23
30
|
# offset of the specified interval value. For example, if the interval value uses Z notation, then
|
24
31
|
# granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an
|
25
32
|
# IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting
|
26
33
|
# for daylight time savings, for US/Pacific zone.
|
27
|
-
# @param [String]
|
34
|
+
# @param granularity [String] The granularity of the grouping of order metrics, based on a unit of time.
|
28
35
|
# Specifying granularity=Hour results in a successful request only if the interval specified is less than or
|
29
36
|
# equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2
|
30
37
|
# years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire
|
31
38
|
# interval that you specify. If the interval start and end date don’t align with the specified granularity, the
|
32
39
|
# head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of
|
33
40
|
# the request interval, where the day boundary is defined by the granularityTimeZone.
|
34
|
-
# @param [String]
|
41
|
+
# @param buyer_type [String] Filters the results by the buyer type that you specify, B2B (business to business) or
|
35
42
|
# B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B
|
36
43
|
# buyers.
|
37
|
-
# @param [String]
|
44
|
+
# @param fulfillment_network [String] Filters the results by the fulfillment network that you specify, MFN
|
38
45
|
# (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the
|
39
46
|
# response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to
|
40
47
|
# include order metrics for only Amazon fulfillment network.
|
41
|
-
# @param [String]
|
48
|
+
# @param first_day_of_week [String] Specifies the day that the week starts on when granularity=Week, either Monday
|
42
49
|
# or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday.
|
43
|
-
# @param [String]
|
50
|
+
# @param asin [String] Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an
|
44
51
|
# error. Do not include this filter if you want the response to include order metrics for all ASINs. Example:
|
45
52
|
# B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN.
|
46
|
-
# @param [String]
|
53
|
+
# @param sku [String] Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an
|
47
54
|
# error. Do not include this filter if you want the response to include order metrics for all SKUs. Example:
|
48
55
|
# TestSKU, if you want the response to include order metrics for only SKU TestSKU.
|
49
|
-
# @
|
50
|
-
|
51
|
-
|
56
|
+
# @param rate_limit [Float] Requests per second
|
57
|
+
# @return [Peddler::Response] The API response
|
58
|
+
def get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All",
|
59
|
+
fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5)
|
52
60
|
path = "/sales/v1/orderMetrics"
|
53
61
|
params = {
|
54
62
|
"marketplaceIds" => marketplace_ids,
|
@@ -62,7 +70,7 @@ module Peddler
|
|
62
70
|
"sku" => sku,
|
63
71
|
}.compact
|
64
72
|
|
65
|
-
rate_limit
|
73
|
+
meter(rate_limit).get(path, params:)
|
66
74
|
end
|
67
75
|
end
|
68
76
|
end
|
@@ -3,7 +3,13 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def sellers_v1(...)
|
8
|
+
APIs::SellersV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Sellers
|
8
14
|
#
|
9
15
|
# The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference)
|
@@ -14,19 +20,25 @@ module Peddler
|
|
14
20
|
class SellersV1 < API
|
15
21
|
# Returns a list of marketplaces where the seller can list items and information about the seller's participation
|
16
22
|
# in those marketplaces.
|
17
|
-
#
|
18
|
-
|
23
|
+
#
|
24
|
+
# @note This operation can make a static sandbox call.
|
25
|
+
# @param rate_limit [Float] Requests per second
|
26
|
+
# @return [Peddler::Response] The API response
|
27
|
+
def get_marketplace_participations(rate_limit: 0.016)
|
19
28
|
path = "/sellers/v1/marketplaceParticipations"
|
20
29
|
|
21
|
-
rate_limit
|
30
|
+
meter(rate_limit).get(path)
|
22
31
|
end
|
23
32
|
|
24
33
|
# Returns information about a seller account and its marketplaces.
|
25
|
-
#
|
26
|
-
|
34
|
+
#
|
35
|
+
# @note This operation can make a static sandbox call.
|
36
|
+
# @param rate_limit [Float] Requests per second
|
37
|
+
# @return [Peddler::Response] The API response
|
38
|
+
def get_account(rate_limit: 0.016)
|
27
39
|
path = "/sellers/v1/account"
|
28
40
|
|
29
|
-
rate_limit
|
41
|
+
meter(rate_limit).get(path)
|
30
42
|
end
|
31
43
|
end
|
32
44
|
end
|