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 services_v1(...)
|
8
|
+
APIs::ServicesV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Services
|
8
14
|
#
|
9
15
|
# With the Services API, you can build applications that help service providers get and modify their service orders
|
@@ -11,78 +17,84 @@ module Peddler
|
|
11
17
|
class ServicesV1 < API
|
12
18
|
# Gets details of service job indicated by the provided `serviceJobID`.
|
13
19
|
#
|
14
|
-
# @
|
15
|
-
# @
|
16
|
-
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param service_job_id [String] A service job identifier.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
23
|
+
# @return [Peddler::Response] The API response
|
24
|
+
def get_service_job_by_service_job_id(service_job_id, rate_limit: 20.0)
|
17
25
|
path = "/service/v1/serviceJobs/#{service_job_id}"
|
18
26
|
|
19
|
-
rate_limit
|
27
|
+
meter(rate_limit).get(path)
|
20
28
|
end
|
21
29
|
|
22
30
|
# Cancels the service job indicated by the service job identifier specified.
|
23
31
|
#
|
24
|
-
# @
|
25
|
-
# @param [String]
|
32
|
+
# @note This operation can make a static sandbox call.
|
33
|
+
# @param service_job_id [String] An Amazon defined service job identifier.
|
34
|
+
# @param cancellation_reason_code [String] A cancel reason code that specifies the reason for cancelling a service
|
26
35
|
# job.
|
27
|
-
# @
|
28
|
-
|
36
|
+
# @param rate_limit [Float] Requests per second
|
37
|
+
# @return [Peddler::Response] The API response
|
38
|
+
def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code, rate_limit: 5.0)
|
29
39
|
path = "/service/v1/serviceJobs/#{service_job_id}/cancellations"
|
30
40
|
params = {
|
31
41
|
"cancellationReasonCode" => cancellation_reason_code,
|
32
42
|
}.compact
|
33
43
|
|
34
|
-
rate_limit
|
44
|
+
meter(rate_limit).put(path, params:)
|
35
45
|
end
|
36
46
|
|
37
47
|
# Completes the service job indicated by the service job identifier specified.
|
38
48
|
#
|
39
|
-
# @
|
40
|
-
# @
|
41
|
-
|
49
|
+
# @note This operation can make a static sandbox call.
|
50
|
+
# @param service_job_id [String] An Amazon defined service job identifier.
|
51
|
+
# @param rate_limit [Float] Requests per second
|
52
|
+
# @return [Peddler::Response] The API response
|
53
|
+
def complete_service_job_by_service_job_id(service_job_id, rate_limit: 5.0)
|
42
54
|
path = "/service/v1/serviceJobs/#{service_job_id}/completions"
|
43
55
|
|
44
|
-
rate_limit
|
56
|
+
meter(rate_limit).put(path)
|
45
57
|
end
|
46
58
|
|
47
59
|
# Gets service job details for the specified filter query.
|
48
60
|
#
|
49
|
-
# @
|
61
|
+
# @note This operation can make a static sandbox call.
|
62
|
+
# @param service_order_ids [Array<String>] List of service order ids for the query you want to perform.Max values
|
50
63
|
# supported 20.
|
51
|
-
# @param [Array<String>]
|
52
|
-
# @param [String]
|
53
|
-
# @param [Integer]
|
64
|
+
# @param service_job_status [Array<String>] A list of one or more job status by which to filter the list of jobs.
|
65
|
+
# @param page_token [String] String returned in the response of your previous request.
|
66
|
+
# @param page_size [Integer] A non-negative integer that indicates the maximum number of jobs to return in the
|
54
67
|
# list, Value must be 1 - 20. Default 20.
|
55
|
-
# @param [String]
|
56
|
-
# @param [String]
|
57
|
-
# @param [String]
|
68
|
+
# @param sort_field [String] Sort fields on which you want to sort the output.
|
69
|
+
# @param sort_order [String] Sort order for the query you want to perform.
|
70
|
+
# @param created_after [String] A date used for selecting jobs created at or after a specified time. Must be in
|
58
71
|
# ISO 8601 format. Required if `LastUpdatedAfter` is not specified. Specifying both `CreatedAfter` and
|
59
72
|
# `LastUpdatedAfter` returns an error.
|
60
|
-
# @param [String]
|
73
|
+
# @param created_before [String] A date used for selecting jobs created at or before a specified time. Must be in
|
61
74
|
# ISO 8601 format.
|
62
|
-
# @param [String]
|
75
|
+
# @param last_updated_after [String] A date used for selecting jobs updated at or after a specified time. Must be
|
63
76
|
# in ISO 8601 format. Required if `createdAfter` is not specified. Specifying both `CreatedAfter` and
|
64
77
|
# `LastUpdatedAfter` returns an error.
|
65
|
-
# @param [String]
|
78
|
+
# @param last_updated_before [String] A date used for selecting jobs updated at or before a specified time. Must
|
66
79
|
# be in ISO 8601 format.
|
67
|
-
# @param [String]
|
80
|
+
# @param schedule_start_date [String] A date used for filtering jobs schedules at or after a specified time. Must
|
68
81
|
# be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
|
69
|
-
# @param [String]
|
82
|
+
# @param schedule_end_date [String] A date used for filtering jobs schedules at or before a specified time. Must
|
70
83
|
# be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
|
71
|
-
# @param [Array<String>]
|
72
|
-
# @param [Array<String>]
|
84
|
+
# @param marketplace_ids [Array<String>] Used to select jobs that were placed in the specified marketplaces.
|
85
|
+
# @param asins [Array<String>] List of Amazon Standard Identification Numbers (ASIN) of the items. Max values
|
73
86
|
# supported is 20.
|
74
|
-
# @param [Array<String>]
|
87
|
+
# @param required_skills [Array<String>] A defined set of related knowledge, skills, experience, tools, materials,
|
75
88
|
# and work processes common to service delivery for a set of products and/or service scenarios. Max values
|
76
89
|
# supported is 20.
|
77
|
-
# @param [Array<String>]
|
90
|
+
# @param store_ids [Array<String>] List of Amazon-defined identifiers for the region scope. Max values supported
|
78
91
|
# is 50.
|
79
|
-
# @
|
80
|
-
|
81
|
-
|
82
|
-
sort_field: nil, sort_order: nil, created_after: nil, created_before: nil,
|
83
|
-
|
84
|
-
store_ids: nil
|
85
|
-
)
|
92
|
+
# @param rate_limit [Float] Requests per second
|
93
|
+
# @return [Peddler::Response] The API response
|
94
|
+
def get_service_jobs(marketplace_ids, service_order_ids: nil, service_job_status: nil, page_token: nil,
|
95
|
+
page_size: 20, sort_field: nil, sort_order: nil, created_after: nil, created_before: nil,
|
96
|
+
last_updated_after: nil, last_updated_before: nil, schedule_start_date: nil, schedule_end_date: nil, asins: nil,
|
97
|
+
required_skills: nil, store_ids: nil, rate_limit: 10.0)
|
86
98
|
path = "/service/v1/serviceJobs"
|
87
99
|
params = {
|
88
100
|
"serviceOrderIds" => service_order_ids,
|
@@ -103,162 +115,186 @@ module Peddler
|
|
103
115
|
"storeIds" => store_ids,
|
104
116
|
}.compact
|
105
117
|
|
106
|
-
rate_limit
|
118
|
+
meter(rate_limit).get(path, params:)
|
107
119
|
end
|
108
120
|
|
109
121
|
# Adds an appointment to the service job indicated by the service job identifier specified.
|
110
122
|
#
|
111
|
-
# @
|
112
|
-
# @param [
|
113
|
-
# @
|
114
|
-
|
123
|
+
# @note This operation can make a static sandbox call.
|
124
|
+
# @param service_job_id [String] An Amazon defined service job identifier.
|
125
|
+
# @param body [Hash] Add appointment operation input details.
|
126
|
+
# @param rate_limit [Float] Requests per second
|
127
|
+
# @return [Peddler::Response] The API response
|
128
|
+
def add_appointment_for_service_job_by_service_job_id(service_job_id, body, rate_limit: 5.0)
|
115
129
|
path = "/service/v1/serviceJobs/#{service_job_id}/appointments"
|
116
130
|
|
117
|
-
rate_limit
|
131
|
+
meter(rate_limit).post(path, body:)
|
118
132
|
end
|
119
133
|
|
120
134
|
# Reschedules an appointment for the service job indicated by the service job identifier specified.
|
121
135
|
#
|
122
|
-
# @
|
123
|
-
# @param [String]
|
124
|
-
# @param [
|
125
|
-
# @
|
126
|
-
|
136
|
+
# @note This operation can make a static sandbox call.
|
137
|
+
# @param service_job_id [String] An Amazon defined service job identifier.
|
138
|
+
# @param appointment_id [String] An existing appointment identifier for the Service Job.
|
139
|
+
# @param body [Hash] Reschedule appointment operation input details.
|
140
|
+
# @param rate_limit [Float] Requests per second
|
141
|
+
# @return [Peddler::Response] The API response
|
142
|
+
def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, appointment_id, body,
|
143
|
+
rate_limit: 5.0)
|
127
144
|
path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}"
|
128
145
|
|
129
|
-
rate_limit
|
146
|
+
meter(rate_limit).post(path, body:)
|
130
147
|
end
|
131
148
|
|
132
149
|
# Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment.
|
133
150
|
#
|
134
|
-
# @
|
151
|
+
# @note This operation can make a static sandbox call.
|
152
|
+
# @param service_job_id [String] An Amazon-defined service job identifier. Get this value by calling the
|
135
153
|
# `getServiceJobs` operation of the Services API.
|
136
|
-
# @param [String]
|
137
|
-
# @param [Hash]
|
138
|
-
# @
|
139
|
-
|
154
|
+
# @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
|
155
|
+
# @param body [Hash]
|
156
|
+
# @param rate_limit [Float] Requests per second
|
157
|
+
# @return [Peddler::Response] The API response
|
158
|
+
def assign_appointment_resources(service_job_id, appointment_id, body, rate_limit: 1.0)
|
140
159
|
path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/resources"
|
141
160
|
|
142
|
-
rate_limit
|
161
|
+
meter(rate_limit).put(path, body:)
|
143
162
|
end
|
144
163
|
|
145
164
|
# Updates the appointment fulfillment data related to a given `jobID` and `appointmentID`.
|
146
165
|
#
|
147
|
-
# @
|
166
|
+
# @note This operation can make a static sandbox call.
|
167
|
+
# @param service_job_id [String] An Amazon-defined service job identifier. Get this value by calling the
|
148
168
|
# `getServiceJobs` operation of the Services API.
|
149
|
-
# @param [String]
|
150
|
-
# @param [Hash]
|
151
|
-
# @
|
152
|
-
|
169
|
+
# @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
|
170
|
+
# @param body [Hash] Appointment fulfillment data collection details.
|
171
|
+
# @param rate_limit [Float] Requests per second
|
172
|
+
# @return [Peddler::Response] The API response
|
173
|
+
def set_appointment_fulfillment_data(service_job_id, appointment_id, body, rate_limit: 5.0)
|
153
174
|
path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/fulfillment"
|
154
175
|
|
155
|
-
rate_limit
|
176
|
+
meter(rate_limit).put(path, body:)
|
156
177
|
end
|
157
178
|
|
158
179
|
# Provides capacity slots in a format similar to availability records.
|
159
180
|
#
|
160
|
-
# @
|
161
|
-
# @param [
|
162
|
-
# @param [
|
163
|
-
# @param [String]
|
164
|
-
# @
|
165
|
-
|
181
|
+
# @note This operation can make a static sandbox call.
|
182
|
+
# @param resource_id [String] Resource Identifier.
|
183
|
+
# @param body [Hash] Request body.
|
184
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
185
|
+
# @param next_page_token [String] Next page token returned in the response of your previous request.
|
186
|
+
# @param rate_limit [Float] Requests per second
|
187
|
+
# @return [Peddler::Response] The API response
|
188
|
+
def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
|
166
189
|
path = "/service/v1/serviceResources/#{resource_id}/capacity/range"
|
167
190
|
params = {
|
168
191
|
"marketplaceIds" => marketplace_ids,
|
169
192
|
"nextPageToken" => next_page_token,
|
170
193
|
}.compact
|
171
194
|
|
172
|
-
rate_limit
|
195
|
+
meter(rate_limit).post(path, body:, params:)
|
173
196
|
end
|
174
197
|
|
175
198
|
# Provides capacity in fixed-size slots.
|
176
199
|
#
|
177
|
-
# @
|
178
|
-
# @param [
|
179
|
-
# @param [
|
180
|
-
# @param [String]
|
181
|
-
# @
|
182
|
-
|
200
|
+
# @note This operation can make a static sandbox call.
|
201
|
+
# @param resource_id [String] Resource Identifier.
|
202
|
+
# @param body [Hash] Request body.
|
203
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
204
|
+
# @param next_page_token [String] Next page token returned in the response of your previous request.
|
205
|
+
# @param rate_limit [Float] Requests per second
|
206
|
+
# @return [Peddler::Response] The API response
|
207
|
+
def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
|
183
208
|
path = "/service/v1/serviceResources/#{resource_id}/capacity/fixed"
|
184
209
|
params = {
|
185
210
|
"marketplaceIds" => marketplace_ids,
|
186
211
|
"nextPageToken" => next_page_token,
|
187
212
|
}.compact
|
188
213
|
|
189
|
-
rate_limit
|
214
|
+
meter(rate_limit).post(path, body:, params:)
|
190
215
|
end
|
191
216
|
|
192
217
|
# Update the schedule of the given resource.
|
193
218
|
#
|
194
|
-
# @
|
195
|
-
# @param [
|
196
|
-
# @param [
|
197
|
-
# @
|
198
|
-
|
219
|
+
# @note This operation can make a static sandbox call.
|
220
|
+
# @param resource_id [String] Resource (store) Identifier
|
221
|
+
# @param body [Hash] Schedule details
|
222
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
223
|
+
# @param rate_limit [Float] Requests per second
|
224
|
+
# @return [Peddler::Response] The API response
|
225
|
+
def update_schedule(resource_id, body, marketplace_ids, rate_limit: 5.0)
|
199
226
|
path = "/service/v1/serviceResources/#{resource_id}/schedules"
|
200
227
|
params = {
|
201
228
|
"marketplaceIds" => marketplace_ids,
|
202
229
|
}.compact
|
203
230
|
|
204
|
-
rate_limit
|
231
|
+
meter(rate_limit).put(path, body:, params:)
|
205
232
|
end
|
206
233
|
|
207
234
|
# Create a reservation.
|
208
235
|
#
|
209
|
-
# @
|
210
|
-
# @param [
|
211
|
-
# @
|
212
|
-
|
236
|
+
# @note This operation can make a static sandbox call.
|
237
|
+
# @param body [Hash] Reservation details
|
238
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
239
|
+
# @param rate_limit [Float] Requests per second
|
240
|
+
# @return [Peddler::Response] The API response
|
241
|
+
def create_reservation(body, marketplace_ids, rate_limit: 5.0)
|
213
242
|
path = "/service/v1/reservation"
|
214
243
|
params = {
|
215
244
|
"marketplaceIds" => marketplace_ids,
|
216
245
|
}.compact
|
217
246
|
|
218
|
-
rate_limit
|
247
|
+
meter(rate_limit).post(path, body:, params:)
|
219
248
|
end
|
220
249
|
|
221
250
|
# Update a reservation.
|
222
251
|
#
|
223
|
-
# @
|
224
|
-
# @param [
|
225
|
-
# @param [
|
226
|
-
# @
|
227
|
-
|
252
|
+
# @note This operation can make a static sandbox call.
|
253
|
+
# @param reservation_id [String] Reservation Identifier
|
254
|
+
# @param body [Hash] Reservation details
|
255
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
256
|
+
# @param rate_limit [Float] Requests per second
|
257
|
+
# @return [Peddler::Response] The API response
|
258
|
+
def update_reservation(reservation_id, body, marketplace_ids, rate_limit: 5.0)
|
228
259
|
path = "/service/v1/reservation/#{reservation_id}"
|
229
260
|
params = {
|
230
261
|
"marketplaceIds" => marketplace_ids,
|
231
262
|
}.compact
|
232
263
|
|
233
|
-
rate_limit
|
264
|
+
meter(rate_limit).put(path, body:, params:)
|
234
265
|
end
|
235
266
|
|
236
267
|
# Cancel a reservation.
|
237
268
|
#
|
238
|
-
# @
|
239
|
-
# @param [
|
240
|
-
# @
|
241
|
-
|
269
|
+
# @note This operation can make a static sandbox call.
|
270
|
+
# @param reservation_id [String] Reservation Identifier
|
271
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
272
|
+
# @param rate_limit [Float] Requests per second
|
273
|
+
# @return [Peddler::Response] The API response
|
274
|
+
def cancel_reservation(reservation_id, marketplace_ids, rate_limit: 5.0)
|
242
275
|
path = "/service/v1/reservation/#{reservation_id}"
|
243
276
|
params = {
|
244
277
|
"marketplaceIds" => marketplace_ids,
|
245
278
|
}.compact
|
246
279
|
|
247
|
-
rate_limit
|
280
|
+
meter(rate_limit).delete(path, params:)
|
248
281
|
end
|
249
282
|
|
250
283
|
# Gets appointment slots for the service associated with the service job id specified.
|
251
284
|
#
|
252
|
-
# @
|
253
|
-
# @param [
|
254
|
-
# @param [String]
|
285
|
+
# @note This operation can make a static sandbox call.
|
286
|
+
# @param service_job_id [String] A service job identifier to retrive appointment slots for associated service.
|
287
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
|
288
|
+
# @param start_time [String] A time from which the appointment slots will be retrieved. The specified time must be
|
255
289
|
# in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per
|
256
290
|
# business configuration.
|
257
|
-
# @param [String]
|
291
|
+
# @param end_time [String] A time up to which the appointment slots will be retrieved. The specified time must be
|
258
292
|
# in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
|
259
293
|
# business configuration. Maximum range of appointment slots can be 90 days.
|
260
|
-
# @
|
261
|
-
|
294
|
+
# @param rate_limit [Float] Requests per second
|
295
|
+
# @return [Peddler::Response] The API response
|
296
|
+
def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time: nil, end_time: nil,
|
297
|
+
rate_limit: 5.0)
|
262
298
|
path = "/service/v1/serviceJobs/#{service_job_id}/appointmentSlots"
|
263
299
|
params = {
|
264
300
|
"marketplaceIds" => marketplace_ids,
|
@@ -266,22 +302,24 @@ module Peddler
|
|
266
302
|
"endTime" => end_time,
|
267
303
|
}.compact
|
268
304
|
|
269
|
-
rate_limit
|
305
|
+
meter(rate_limit).get(path, params:)
|
270
306
|
end
|
271
307
|
|
272
308
|
# Gets appointment slots as per the service context specified.
|
273
309
|
#
|
274
|
-
# @
|
275
|
-
# @param [String]
|
276
|
-
# @param [
|
277
|
-
# @param [String]
|
310
|
+
# @note This operation can make a static sandbox call.
|
311
|
+
# @param asin [String] ASIN associated with the service.
|
312
|
+
# @param store_id [String] Store identifier defining the region scope to retrive appointment slots.
|
313
|
+
# @param marketplace_ids [Array<String>] An identifier for the marketplace for which appointment slots are queried
|
314
|
+
# @param start_time [String] A time from which the appointment slots will be retrieved. The specified time must be
|
278
315
|
# in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per
|
279
316
|
# business configuration.
|
280
|
-
# @param [String]
|
317
|
+
# @param end_time [String] A time up to which the appointment slots will be retrieved. The specified time must be
|
281
318
|
# in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
|
282
319
|
# business configuration. Maximum range of appointment slots can be 90 days.
|
283
|
-
# @
|
284
|
-
|
320
|
+
# @param rate_limit [Float] Requests per second
|
321
|
+
# @return [Peddler::Response] The API response
|
322
|
+
def get_appointment_slots(asin, store_id, marketplace_ids, start_time: nil, end_time: nil, rate_limit: 20.0)
|
285
323
|
path = "/service/v1/appointmentSlots"
|
286
324
|
params = {
|
287
325
|
"asin" => asin,
|
@@ -291,17 +329,19 @@ module Peddler
|
|
291
329
|
"endTime" => end_time,
|
292
330
|
}.compact
|
293
331
|
|
294
|
-
rate_limit
|
332
|
+
meter(rate_limit).get(path, params:)
|
295
333
|
end
|
296
334
|
|
297
335
|
# Creates an upload destination.
|
298
336
|
#
|
299
|
-
# @
|
300
|
-
# @
|
301
|
-
|
337
|
+
# @note This operation can make a static sandbox call.
|
338
|
+
# @param body [Hash] Upload document operation input details.
|
339
|
+
# @param rate_limit [Float] Requests per second
|
340
|
+
# @return [Peddler::Response] The API response
|
341
|
+
def create_service_document_upload_destination(body, rate_limit: 5.0)
|
302
342
|
path = "/service/v1/documents"
|
303
343
|
|
304
|
-
rate_limit
|
344
|
+
meter(rate_limit).post(path, body:)
|
305
345
|
end
|
306
346
|
end
|
307
347
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def shipment_invoicing_v0(...)
|
8
|
+
APIs::ShipmentInvoicingV0.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Selling Partner API for Shipment Invoicing
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Shipment Invoicing helps you programmatically retrieve shipment invoice information in
|
16
|
+
# the Brazil marketplace for a selling partner’s Fulfillment by Amazon (FBA) orders.
|
17
|
+
class ShipmentInvoicingV0 < API
|
18
|
+
# Returns the shipment details required to issue an invoice for the specified shipment.
|
19
|
+
#
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param shipment_id [String] The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus
|
22
|
+
# notification. For information about subscribing to notifications, see the
|
23
|
+
# {https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide Notifications API Use Case
|
24
|
+
# Guide}.
|
25
|
+
# @param rate_limit [Float] Requests per second
|
26
|
+
# @return [Peddler::Response] The API response
|
27
|
+
def get_shipment_details(shipment_id, rate_limit: 1.133)
|
28
|
+
path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}"
|
29
|
+
|
30
|
+
meter(rate_limit).get(path)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Submits a shipment invoice document for a given shipment.
|
34
|
+
#
|
35
|
+
# @note This operation can make a static sandbox call.
|
36
|
+
# @param shipment_id [String] The identifier for the shipment.
|
37
|
+
# @param body [Hash]
|
38
|
+
# @param rate_limit [Float] Requests per second
|
39
|
+
# @return [Peddler::Response] The API response
|
40
|
+
def submit_invoice(shipment_id, body, rate_limit: 1.133)
|
41
|
+
path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice"
|
42
|
+
|
43
|
+
meter(rate_limit).post(path, body:)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns the invoice status for the shipment you specify.
|
47
|
+
#
|
48
|
+
# @note This operation can make a static sandbox call.
|
49
|
+
# @param shipment_id [String] The shipment identifier for the shipment.
|
50
|
+
# @param rate_limit [Float] Requests per second
|
51
|
+
# @return [Peddler::Response] The API response
|
52
|
+
def get_invoice_status(shipment_id, rate_limit: 1.133)
|
53
|
+
path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice/status"
|
54
|
+
|
55
|
+
meter(rate_limit).get(path)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def shipping_v1(...)
|
8
|
+
APIs::ShippingV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Selling Partner API for Shipping
|
14
|
+
#
|
15
|
+
# Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer
|
16
|
+
# to the latest version of <a
|
17
|
+
# href="https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference">Amazon Shipping API
|
18
|
+
# (v2)</a> on the <a href="https://developer-docs.amazon.com/amazon-shipping/">Amazon Shipping Developer
|
19
|
+
# Documentation</a> site.
|
20
|
+
class ShippingV1 < API
|
21
|
+
# Create a new shipment.
|
22
|
+
#
|
23
|
+
# @note This operation can make a static sandbox call.
|
24
|
+
# @param body [Hash]
|
25
|
+
# @param rate_limit [Float] Requests per second
|
26
|
+
# @return [Peddler::Response] The API response
|
27
|
+
def create_shipment(body, rate_limit: 5.0)
|
28
|
+
path = "/shipping/v1/shipments"
|
29
|
+
|
30
|
+
meter(rate_limit).post(path, body:)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Return the entire shipment object for the shipmentId.
|
34
|
+
#
|
35
|
+
# @note This operation can make a static sandbox call.
|
36
|
+
# @param shipment_id [String]
|
37
|
+
# @param rate_limit [Float] Requests per second
|
38
|
+
# @return [Peddler::Response] The API response
|
39
|
+
def get_shipment(shipment_id, rate_limit: 5.0)
|
40
|
+
path = "/shipping/v1/shipments/#{shipment_id}"
|
41
|
+
|
42
|
+
meter(rate_limit).get(path)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Cancel a shipment by the given shipmentId.
|
46
|
+
#
|
47
|
+
# @note This operation can make a static sandbox call.
|
48
|
+
# @param shipment_id [String]
|
49
|
+
# @param rate_limit [Float] Requests per second
|
50
|
+
# @return [Peddler::Response] The API response
|
51
|
+
def cancel_shipment(shipment_id, rate_limit: 5.0)
|
52
|
+
path = "/shipping/v1/shipments/#{shipment_id}/cancel"
|
53
|
+
|
54
|
+
meter(rate_limit).post(path)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Purchase shipping labels based on a given rate.
|
58
|
+
#
|
59
|
+
# @note This operation can make a static sandbox call.
|
60
|
+
# @param shipment_id [String]
|
61
|
+
# @param body [Hash]
|
62
|
+
# @param rate_limit [Float] Requests per second
|
63
|
+
# @return [Peddler::Response] The API response
|
64
|
+
def purchase_labels(shipment_id, body, rate_limit: 5.0)
|
65
|
+
path = "/shipping/v1/shipments/#{shipment_id}/purchaseLabels"
|
66
|
+
|
67
|
+
meter(rate_limit).post(path, body:)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Retrieve shipping label based on the shipment id and tracking id.
|
71
|
+
#
|
72
|
+
# @note This operation can make a static sandbox call.
|
73
|
+
# @param shipment_id [String]
|
74
|
+
# @param tracking_id [String]
|
75
|
+
# @param body [Hash]
|
76
|
+
# @param rate_limit [Float] Requests per second
|
77
|
+
# @return [Peddler::Response] The API response
|
78
|
+
def retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0)
|
79
|
+
path = "/shipping/v1/shipments/#{shipment_id}/containers/#{tracking_id}/label"
|
80
|
+
|
81
|
+
meter(rate_limit).post(path, body:)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Purchase shipping labels.
|
85
|
+
#
|
86
|
+
# @note This operation can make a static sandbox call.
|
87
|
+
# @param body [Hash]
|
88
|
+
# @param rate_limit [Float] Requests per second
|
89
|
+
# @return [Peddler::Response] The API response
|
90
|
+
def purchase_shipment(body, rate_limit: 5.0)
|
91
|
+
path = "/shipping/v1/purchaseShipment"
|
92
|
+
|
93
|
+
meter(rate_limit).post(path, body:)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Get service rates.
|
97
|
+
#
|
98
|
+
# @note This operation can make a static sandbox call.
|
99
|
+
# @param body [Hash]
|
100
|
+
# @param rate_limit [Float] Requests per second
|
101
|
+
# @return [Peddler::Response] The API response
|
102
|
+
def get_rates(body, rate_limit: 5.0)
|
103
|
+
path = "/shipping/v1/rates"
|
104
|
+
|
105
|
+
meter(rate_limit).post(path, body:)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Verify if the current account is valid.
|
109
|
+
#
|
110
|
+
# @note This operation can make a static sandbox call.
|
111
|
+
# @param rate_limit [Float] Requests per second
|
112
|
+
# @return [Peddler::Response] The API response
|
113
|
+
def get_account(rate_limit: 5.0)
|
114
|
+
path = "/shipping/v1/account"
|
115
|
+
|
116
|
+
meter(rate_limit).get(path)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Return the tracking information of a shipment.
|
120
|
+
#
|
121
|
+
# @note This operation can make a static sandbox call.
|
122
|
+
# @param tracking_id [String]
|
123
|
+
# @param rate_limit [Float] Requests per second
|
124
|
+
# @return [Peddler::Response] The API response
|
125
|
+
def get_tracking_information(tracking_id, rate_limit: 1.0)
|
126
|
+
path = "/shipping/v1/tracking/#{tracking_id}"
|
127
|
+
|
128
|
+
meter(rate_limit).get(path)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|