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
@@ -0,0 +1,189 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_shipping_v1(...)
|
8
|
+
APIs::VendorDirectFulfillmentShippingV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Selling Partner API for Direct Fulfillment Shipping
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment
|
16
|
+
# vendor's shipping data.
|
17
|
+
class VendorDirectFulfillmentShippingV1 < API
|
18
|
+
# Returns a list of shipping labels created during the time frame that you specify. You define that time frame
|
19
|
+
# using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
|
20
|
+
# search must not be more than 7 days.
|
21
|
+
#
|
22
|
+
# @note This operation can make a static sandbox call.
|
23
|
+
# @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified, the result
|
24
|
+
# will contain orders for all warehouses.
|
25
|
+
# @param limit [Integer] The limit to the number of records returned.
|
26
|
+
# @param created_after [String] Shipping labels that became available after this date and time will be included in
|
27
|
+
# the result. Must be in ISO-8601 date/time format.
|
28
|
+
# @param created_before [String] Shipping labels that became available before this date and time will be included
|
29
|
+
# in the result. Must be in ISO-8601 date/time format.
|
30
|
+
# @param sort_order [String] Sort ASC or DESC by order creation date.
|
31
|
+
# @param next_token [String] Used for pagination when there are more ship labels than the specified result size
|
32
|
+
# limit. The token value is returned in the previous API call.
|
33
|
+
# @param rate_limit [Float] Requests per second
|
34
|
+
# @return [Peddler::Response] The API response
|
35
|
+
def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
|
36
|
+
next_token: nil, rate_limit: 10.0)
|
37
|
+
path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
|
38
|
+
params = {
|
39
|
+
"shipFromPartyId" => ship_from_party_id,
|
40
|
+
"limit" => limit,
|
41
|
+
"createdAfter" => created_after,
|
42
|
+
"createdBefore" => created_before,
|
43
|
+
"sortOrder" => sort_order,
|
44
|
+
"nextToken" => next_token,
|
45
|
+
}.compact
|
46
|
+
|
47
|
+
meter(rate_limit).get(path, params:)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Creates a shipping label for a purchase order and returns a transactionId for reference.
|
51
|
+
#
|
52
|
+
# @note This operation can make a static sandbox call.
|
53
|
+
# @param body [Hash] Request body containing one or more shipping labels data.
|
54
|
+
# @param rate_limit [Float] Requests per second
|
55
|
+
# @return [Peddler::Response] The API response
|
56
|
+
def submit_shipping_label_request(body, rate_limit: 10.0)
|
57
|
+
path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
|
58
|
+
|
59
|
+
meter(rate_limit).post(path, body:)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns a shipping label for the purchaseOrderNumber that you specify.
|
63
|
+
#
|
64
|
+
# @note This operation can make a static sandbox call.
|
65
|
+
# @param purchase_order_number [String] The purchase order number for which you want to return the shipping label.
|
66
|
+
# It should be the same purchaseOrderNumber as received in the order.
|
67
|
+
# @param rate_limit [Float] Requests per second
|
68
|
+
# @return [Peddler::Response] The API response
|
69
|
+
def get_shipping_label(purchase_order_number, rate_limit: 10.0)
|
70
|
+
path = "/vendor/directFulfillment/shipping/v1/shippingLabels/#{purchase_order_number}"
|
71
|
+
|
72
|
+
meter(rate_limit).get(path)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Submits one or more shipment confirmations for vendor orders.
|
76
|
+
#
|
77
|
+
# @note This operation can make a static sandbox call.
|
78
|
+
# @param body [Hash] Request body containing the shipment confirmations data.
|
79
|
+
# @param rate_limit [Float] Requests per second
|
80
|
+
# @return [Peddler::Response] The API response
|
81
|
+
def submit_shipment_confirmations(body, rate_limit: 10.0)
|
82
|
+
path = "/vendor/directFulfillment/shipping/v1/shipmentConfirmations"
|
83
|
+
|
84
|
+
meter(rate_limit).post(path, body:)
|
85
|
+
end
|
86
|
+
|
87
|
+
# This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment
|
88
|
+
# status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their
|
89
|
+
# order, when the package is outside of Amazon Network visibility.
|
90
|
+
#
|
91
|
+
# @note This operation can make a static sandbox call.
|
92
|
+
# @param body [Hash] Request body containing the shipment status update data.
|
93
|
+
# @param rate_limit [Float] Requests per second
|
94
|
+
# @return [Peddler::Response] The API response
|
95
|
+
def submit_shipment_status_updates(body, rate_limit: 10.0)
|
96
|
+
path = "/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates"
|
97
|
+
|
98
|
+
meter(rate_limit).post(path, body:)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Returns a list of customer invoices created during a time frame that you specify. You define the time frame
|
102
|
+
# using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
|
103
|
+
# search must be no more than 7 days.
|
104
|
+
#
|
105
|
+
# @note This operation can make a static sandbox call.
|
106
|
+
# @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified, the result
|
107
|
+
# will contain orders for all warehouses.
|
108
|
+
# @param limit [Integer] The limit to the number of records returned
|
109
|
+
# @param created_after [String] Orders that became available after this date and time will be included in the
|
110
|
+
# result. Must be in ISO-8601 date/time format.
|
111
|
+
# @param created_before [String] Orders that became available before this date and time will be included in the
|
112
|
+
# result. Must be in ISO-8601 date/time format.
|
113
|
+
# @param sort_order [String] Sort ASC or DESC by order creation date.
|
114
|
+
# @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
|
115
|
+
# The token value is returned in the previous API call.
|
116
|
+
# @param rate_limit [Float] Requests per second
|
117
|
+
# @return [Peddler::Response] The API response
|
118
|
+
def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
|
119
|
+
next_token: nil, rate_limit: 10.0)
|
120
|
+
path = "/vendor/directFulfillment/shipping/v1/customerInvoices"
|
121
|
+
params = {
|
122
|
+
"shipFromPartyId" => ship_from_party_id,
|
123
|
+
"limit" => limit,
|
124
|
+
"createdAfter" => created_after,
|
125
|
+
"createdBefore" => created_before,
|
126
|
+
"sortOrder" => sort_order,
|
127
|
+
"nextToken" => next_token,
|
128
|
+
}.compact
|
129
|
+
|
130
|
+
meter(rate_limit).get(path, params:)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Returns a customer invoice based on the purchaseOrderNumber that you specify.
|
134
|
+
#
|
135
|
+
# @note This operation can make a static sandbox call.
|
136
|
+
# @param purchase_order_number [String] Purchase order number of the shipment for which to return the invoice.
|
137
|
+
# @param rate_limit [Float] Requests per second
|
138
|
+
# @return [Peddler::Response] The API response
|
139
|
+
def get_customer_invoice(purchase_order_number, rate_limit: 10.0)
|
140
|
+
path = "/vendor/directFulfillment/shipping/v1/customerInvoices/#{purchase_order_number}"
|
141
|
+
|
142
|
+
meter(rate_limit).get(path)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search
|
146
|
+
# must not be more than 7 days.
|
147
|
+
#
|
148
|
+
# @note This operation can make a static sandbox call.
|
149
|
+
# @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified the result
|
150
|
+
# will contain orders for all warehouses.
|
151
|
+
# @param limit [Integer] The limit to the number of records returned
|
152
|
+
# @param created_after [String] Packing slips that became available after this date and time will be included in
|
153
|
+
# the result. Must be in ISO-8601 date/time format.
|
154
|
+
# @param created_before [String] Packing slips that became available before this date and time will be included in
|
155
|
+
# the result. Must be in ISO-8601 date/time format.
|
156
|
+
# @param sort_order [String] Sort ASC or DESC by packing slip creation date.
|
157
|
+
# @param next_token [String] Used for pagination when there are more packing slips than the specified result size
|
158
|
+
# limit. The token value is returned in the previous API call.
|
159
|
+
# @param rate_limit [Float] Requests per second
|
160
|
+
# @return [Peddler::Response] The API response
|
161
|
+
def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
|
162
|
+
next_token: nil, rate_limit: 10.0)
|
163
|
+
path = "/vendor/directFulfillment/shipping/v1/packingSlips"
|
164
|
+
params = {
|
165
|
+
"shipFromPartyId" => ship_from_party_id,
|
166
|
+
"limit" => limit,
|
167
|
+
"createdAfter" => created_after,
|
168
|
+
"createdBefore" => created_before,
|
169
|
+
"sortOrder" => sort_order,
|
170
|
+
"nextToken" => next_token,
|
171
|
+
}.compact
|
172
|
+
|
173
|
+
meter(rate_limit).get(path, params:)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns a packing slip based on the purchaseOrderNumber that you specify.
|
177
|
+
#
|
178
|
+
# @note This operation can make a static sandbox call.
|
179
|
+
# @param purchase_order_number [String] The purchaseOrderNumber for the packing slip you want.
|
180
|
+
# @param rate_limit [Float] Requests per second
|
181
|
+
# @return [Peddler::Response] The API response
|
182
|
+
def get_packing_slip(purchase_order_number, rate_limit: 10.0)
|
183
|
+
path = "/vendor/directFulfillment/shipping/v1/packingSlips/#{purchase_order_number}"
|
184
|
+
|
185
|
+
meter(rate_limit).get(path)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
@@ -3,21 +3,29 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_transactions_2021_12_28(...)
|
8
|
+
APIs::VendorDirectFulfillmentTransactions20211228.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Direct Fulfillment Transaction Status
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct
|
10
16
|
# fulfillment vendor's transaction status.
|
11
17
|
class VendorDirectFulfillmentTransactions20211228 < API
|
12
|
-
# Returns the status of the transaction indicated by the specified
|
18
|
+
# Returns the status of the transaction indicated by the specified transactionId.
|
13
19
|
#
|
14
|
-
# @
|
20
|
+
# @note This operation can make a dynamic sandbox call.
|
21
|
+
# @param transaction_id [String] Previously returned in the response to the POST request of a specific
|
15
22
|
# transaction.
|
16
|
-
# @
|
17
|
-
|
23
|
+
# @param rate_limit [Float] Requests per second
|
24
|
+
# @return [Peddler::Response] The API response
|
25
|
+
def get_transaction_status(transaction_id, rate_limit: 10.0)
|
18
26
|
path = "/vendor/directFulfillment/transactions/2021-12-28/transactions/#{transaction_id}"
|
19
27
|
|
20
|
-
rate_limit
|
28
|
+
meter(rate_limit).get(path)
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -3,21 +3,29 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_transactions_v1(...)
|
8
|
+
APIs::VendorDirectFulfillmentTransactionsV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Direct Fulfillment Transaction Status
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct
|
10
16
|
# fulfillment vendor's transaction status.
|
11
17
|
class VendorDirectFulfillmentTransactionsV1 < API
|
12
|
-
# Returns the status of the transaction indicated by the specified
|
18
|
+
# Returns the status of the transaction indicated by the specified transactionId.
|
13
19
|
#
|
14
|
-
# @
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param transaction_id [String] Previously returned in the response to the POST request of a specific
|
15
22
|
# transaction.
|
16
|
-
# @
|
17
|
-
|
23
|
+
# @param rate_limit [Float] Requests per second
|
24
|
+
# @return [Peddler::Response] The API response
|
25
|
+
def get_transaction_status(transaction_id, rate_limit: 10.0)
|
18
26
|
path = "/vendor/directFulfillment/transactions/v1/transactions/#{transaction_id}"
|
19
27
|
|
20
|
-
rate_limit
|
28
|
+
meter(rate_limit).get(path)
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_invoices_v1(...)
|
8
|
+
APIs::VendorInvoicesV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Vendor Invoices v1
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.
|
16
|
+
class VendorInvoicesV1 < API
|
17
|
+
# Submit new invoices to Amazon.
|
18
|
+
#
|
19
|
+
# @note This operation can make a static sandbox call.
|
20
|
+
# @param body [Hash] The request body containing the invoice data to submit.
|
21
|
+
# @param rate_limit [Float] Requests per second
|
22
|
+
# @return [Peddler::Response] The API response
|
23
|
+
def submit_invoices(body, rate_limit: 10.0)
|
24
|
+
path = "/vendor/payments/v1/invoices"
|
25
|
+
|
26
|
+
meter(rate_limit).post(path, body:)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -3,7 +3,13 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def vendor_orders_v1(...)
|
8
|
+
APIs::VendorOrdersV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Retail Procurement Orders
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
|
@@ -14,37 +20,37 @@ module Peddler
|
|
14
20
|
# `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific
|
15
21
|
# purchase order.
|
16
22
|
#
|
17
|
-
# @
|
18
|
-
# @param [
|
23
|
+
# @note This operation can make a static sandbox call.
|
24
|
+
# @param limit [Integer] The limit to the number of records returned. Default value is 100 records.
|
25
|
+
# @param created_after [String] Purchase orders that became available after this time will be included in the
|
19
26
|
# result. Must be in ISO-8601 date/time format.
|
20
|
-
# @param [String]
|
27
|
+
# @param created_before [String] Purchase orders that became available before this time will be included in the
|
21
28
|
# result. Must be in ISO-8601 date/time format.
|
22
|
-
# @param [String]
|
23
|
-
# @param [String]
|
29
|
+
# @param sort_order [String] Sort in ascending or descending order by purchase order creation date.
|
30
|
+
# @param next_token [String] Used for pagination when there is more purchase orders than the specified result size
|
24
31
|
# limit. The token value is returned in the previous API call
|
25
|
-
# @param [String]
|
32
|
+
# @param include_details [String] When true, returns purchase orders with complete details. Otherwise, only
|
26
33
|
# purchase order numbers are returned. Default value is true.
|
27
|
-
# @param [String]
|
34
|
+
# @param changed_after [String] Purchase orders that changed after this timestamp will be included in the result.
|
28
35
|
# Must be in ISO-8601 date/time format.
|
29
|
-
# @param [String]
|
36
|
+
# @param changed_before [String] Purchase orders that changed before this timestamp will be included in the
|
30
37
|
# result. Must be in ISO-8601 date/time format.
|
31
|
-
# @param [String]
|
38
|
+
# @param po_item_state [String] Current state of the purchase order item. If this value is Cancelled, this API
|
32
39
|
# will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as
|
33
40
|
# zero.
|
34
|
-
# @param [String]
|
41
|
+
# @param is_po_changed [String] When true, returns purchase orders which were modified after the order was placed.
|
35
42
|
# Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the
|
36
43
|
# original one. Default value is false.
|
37
|
-
# @param [String]
|
38
|
-
# @param [String]
|
44
|
+
# @param purchase_order_state [String] Filters purchase orders based on the purchase order state.
|
45
|
+
# @param ordering_vendor_code [String] Filters purchase orders based on the specified ordering vendor code. This
|
39
46
|
# value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all
|
40
47
|
# purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client
|
41
48
|
# application are returned.
|
42
|
-
# @
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
ordering_vendor_code: nil
|
47
|
-
)
|
49
|
+
# @param rate_limit [Float] Requests per second
|
50
|
+
# @return [Peddler::Response] The API response
|
51
|
+
def get_purchase_orders(limit: nil, created_after: nil, created_before: nil, sort_order: nil, next_token: nil,
|
52
|
+
include_details: nil, changed_after: nil, changed_before: nil, po_item_state: nil, is_po_changed: nil,
|
53
|
+
purchase_order_state: nil, ordering_vendor_code: nil, rate_limit: 10.0)
|
48
54
|
path = "/vendor/orders/v1/purchaseOrders"
|
49
55
|
params = {
|
50
56
|
"limit" => limit,
|
@@ -61,69 +67,74 @@ module Peddler
|
|
61
67
|
"orderingVendorCode" => ordering_vendor_code,
|
62
68
|
}.compact
|
63
69
|
|
64
|
-
rate_limit
|
70
|
+
meter(rate_limit).get(path, params:)
|
65
71
|
end
|
66
72
|
|
67
73
|
# Returns a purchase order based on the `purchaseOrderNumber` value that you specify.
|
68
74
|
#
|
69
|
-
# @
|
75
|
+
# @note This operation can make a static sandbox call.
|
76
|
+
# @param purchase_order_number [String] The purchase order identifier for the order that you want. Formatting
|
70
77
|
# Notes: 8-character alpha-numeric code.
|
71
|
-
# @
|
72
|
-
|
78
|
+
# @param rate_limit [Float] Requests per second
|
79
|
+
# @return [Peddler::Response] The API response
|
80
|
+
def get_purchase_order(purchase_order_number, rate_limit: 10.0)
|
73
81
|
path = "/vendor/orders/v1/purchaseOrders/#{purchase_order_number}"
|
74
82
|
|
75
|
-
rate_limit
|
83
|
+
meter(rate_limit).get(path)
|
76
84
|
end
|
77
85
|
|
78
86
|
# Submits acknowledgements for one or more purchase orders.
|
79
87
|
#
|
80
|
-
# @
|
81
|
-
# @
|
82
|
-
|
88
|
+
# @note This operation can make a static sandbox call.
|
89
|
+
# @param body [Hash] Submits acknowledgements for one or more purchase orders from a vendor.
|
90
|
+
# @param rate_limit [Float] Requests per second
|
91
|
+
# @return [Peddler::Response] The API response
|
92
|
+
def submit_acknowledgement(body, rate_limit: 10.0)
|
83
93
|
path = "/vendor/orders/v1/acknowledgements"
|
84
94
|
|
85
|
-
rate_limit
|
95
|
+
meter(rate_limit).post(path, body:)
|
86
96
|
end
|
87
97
|
|
88
98
|
# Returns purchase order statuses based on the filters that you specify. Date range to search must not be more
|
89
99
|
# than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase
|
90
100
|
# order status by providing the purchase order number.
|
91
101
|
#
|
92
|
-
# @
|
93
|
-
# @param [
|
94
|
-
# @param [String]
|
102
|
+
# @note This operation can make a static sandbox call.
|
103
|
+
# @param limit [Integer] The limit to the number of records returned. Default value is 100 records.
|
104
|
+
# @param sort_order [String] Sort in ascending or descending order by purchase order creation date.
|
105
|
+
# @param next_token [String] Used for pagination when there are more purchase orders than the specified result
|
95
106
|
# size limit.
|
96
|
-
# @param [String]
|
107
|
+
# @param created_after [String] Purchase orders that became available after this timestamp will be included in the
|
97
108
|
# result. Must be in ISO-8601 date/time format.
|
98
|
-
# @param [String]
|
109
|
+
# @param created_before [String] Purchase orders that became available before this timestamp will be included in
|
99
110
|
# the result. Must be in ISO-8601 date/time format.
|
100
|
-
# @param [String]
|
111
|
+
# @param updated_after [String] Purchase orders for which the last purchase order update happened after this
|
101
112
|
# timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
102
|
-
# @param [String]
|
113
|
+
# @param updated_before [String] Purchase orders for which the last purchase order update happened before this
|
103
114
|
# timestamp will be included in the result. Must be in ISO-8601 date/time format.
|
104
|
-
# @param [String]
|
105
|
-
# @param [String]
|
115
|
+
# @param purchase_order_number [String] Provides purchase order status for the specified purchase order number.
|
116
|
+
# @param purchase_order_status [String] Filters purchase orders based on the specified purchase order status. If
|
106
117
|
# not included in filter, this will return purchase orders for all statuses.
|
107
|
-
# @param [String]
|
118
|
+
# @param item_confirmation_status [String] Filters purchase orders based on their item confirmation status. If the
|
108
119
|
# item confirmation status is not included in the filter, purchase orders for all confirmation statuses are
|
109
120
|
# included.
|
110
|
-
# @param [String]
|
121
|
+
# @param item_receive_status [String] Filters purchase orders based on the purchase order's item receive status.
|
111
122
|
# If the item receive status is not included in the filter, purchase orders for all receive statuses are
|
112
123
|
# included.
|
113
|
-
# @param [String]
|
124
|
+
# @param ordering_vendor_code [String] Filters purchase orders based on the specified ordering vendor code. This
|
114
125
|
# value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase
|
115
126
|
# orders for all the vendor codes that exist in the vendor group used to authorize API client application are
|
116
127
|
# returned.
|
117
|
-
# @param [String]
|
128
|
+
# @param ship_to_party_id [String] Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by
|
118
129
|
# providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order.
|
119
130
|
# If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor
|
120
131
|
# group purchase orders.
|
121
|
-
# @
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
132
|
+
# @param rate_limit [Float] Requests per second
|
133
|
+
# @return [Peddler::Response] The API response
|
134
|
+
def get_purchase_orders_status(limit: nil, sort_order: nil, next_token: nil, created_after: nil,
|
135
|
+
created_before: nil, updated_after: nil, updated_before: nil, purchase_order_number: nil,
|
136
|
+
purchase_order_status: nil, item_confirmation_status: nil, item_receive_status: nil, ordering_vendor_code: nil,
|
137
|
+
ship_to_party_id: nil, rate_limit: 10.0)
|
127
138
|
path = "/vendor/orders/v1/purchaseOrdersStatus"
|
128
139
|
params = {
|
129
140
|
"limit" => limit,
|
@@ -141,7 +152,7 @@ module Peddler
|
|
141
152
|
"shipToPartyId" => ship_to_party_id,
|
142
153
|
}.compact
|
143
154
|
|
144
|
-
rate_limit
|
155
|
+
meter(rate_limit).get(path, params:)
|
145
156
|
end
|
146
157
|
end
|
147
158
|
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_shipments_v1(...)
|
8
|
+
APIs::VendorShipmentsV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
13
|
+
# Vendor Shipments v1
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for
|
16
|
+
# vendors.
|
17
|
+
class VendorShipmentsV1 < API
|
18
|
+
# Submits one or more shipment confirmations for vendor orders.
|
19
|
+
#
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param body [Hash] A request to submit shipment confirmation.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
23
|
+
# @return [Peddler::Response] The API response
|
24
|
+
def submit_shipment_confirmations(body, rate_limit: 10.0)
|
25
|
+
path = "/vendor/shipping/v1/shipmentConfirmations"
|
26
|
+
|
27
|
+
meter(rate_limit).post(path, body:)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Submits one or more shipment request for vendor Orders.
|
31
|
+
#
|
32
|
+
# @param body [Hash] A request to submit shipment request.
|
33
|
+
# @param rate_limit [Float] Requests per second
|
34
|
+
# @return [Peddler::Response] The API response
|
35
|
+
def submit_shipments(body, rate_limit: 10.0)
|
36
|
+
cannot_sandbox!
|
37
|
+
|
38
|
+
path = "/vendor/shipping/v1/shipments"
|
39
|
+
|
40
|
+
meter(rate_limit).post(path, body:)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns the Details about Shipment, Carrier Details, status of the shipment, container details and other details
|
44
|
+
# related to shipment based on the filter parameters value that you specify.
|
45
|
+
#
|
46
|
+
# @param limit [Integer] The limit to the number of records returned. Default value is 50 records.
|
47
|
+
# @param sort_order [String] Sort in ascending or descending order by purchase order creation date.
|
48
|
+
# @param next_token [String] Used for pagination when there are more shipments than the specified result size
|
49
|
+
# limit.
|
50
|
+
# @param created_after [String] Get Shipment Details that became available after this timestamp will be included
|
51
|
+
# in the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
52
|
+
# @param created_before [String] Get Shipment Details that became available before this timestamp will be included
|
53
|
+
# in the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
54
|
+
# @param shipment_confirmed_before [String] Get Shipment Details by passing Shipment confirmed create Date Before.
|
55
|
+
# Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
56
|
+
# @param shipment_confirmed_after [String] Get Shipment Details by passing Shipment confirmed create Date After.
|
57
|
+
# Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
58
|
+
# @param package_label_created_before [String] Get Shipment Details by passing Package label create Date by buyer.
|
59
|
+
# Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
60
|
+
# @param package_label_created_after [String] Get Shipment Details by passing Package label create Date After by
|
61
|
+
# buyer. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
62
|
+
# @param shipped_before [String] Get Shipment Details by passing Shipped Date Before. Must be in
|
63
|
+
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
64
|
+
# @param shipped_after [String] Get Shipment Details by passing Shipped Date After. Must be in
|
65
|
+
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
66
|
+
# @param estimated_delivery_before [String] Get Shipment Details by passing Estimated Delivery Date Before. Must
|
67
|
+
# be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
68
|
+
# @param estimated_delivery_after [String] Get Shipment Details by passing Estimated Delivery Date Before. Must be
|
69
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
70
|
+
# @param shipment_delivery_before [String] Get Shipment Details by passing Shipment Delivery Date Before. Must be
|
71
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
72
|
+
# @param shipment_delivery_after [String] Get Shipment Details by passing Shipment Delivery Date After. Must be in
|
73
|
+
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
74
|
+
# @param requested_pick_up_before [String] Get Shipment Details by passing Before Requested pickup date. Must be
|
75
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
76
|
+
# @param requested_pick_up_after [String] Get Shipment Details by passing After Requested pickup date. Must be in
|
77
|
+
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
78
|
+
# @param scheduled_pick_up_before [String] Get Shipment Details by passing Before scheduled pickup date. Must be
|
79
|
+
# in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
80
|
+
# @param scheduled_pick_up_after [String] Get Shipment Details by passing After Scheduled pickup date. Must be in
|
81
|
+
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
82
|
+
# @param current_shipment_status [String] Get Shipment Details by passing Current shipment status.
|
83
|
+
# @param vendor_shipment_identifier [String] Get Shipment Details by passing Vendor Shipment ID
|
84
|
+
# @param buyer_reference_number [String] Get Shipment Details by passing buyer Reference ID
|
85
|
+
# @param buyer_warehouse_code [String] Get Shipping Details based on buyer warehouse code. This value should be
|
86
|
+
# same as 'shipToParty.partyId' in the Shipment.
|
87
|
+
# @param seller_warehouse_code [String] Get Shipping Details based on vendor warehouse code. This value should be
|
88
|
+
# same as 'sellingParty.partyId' in the Shipment.
|
89
|
+
# @param rate_limit [Float] Requests per second
|
90
|
+
# @return [Peddler::Response] The API response
|
91
|
+
def get_shipment_details(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil,
|
92
|
+
shipment_confirmed_before: nil, shipment_confirmed_after: nil, package_label_created_before: nil,
|
93
|
+
package_label_created_after: nil, shipped_before: nil, shipped_after: nil, estimated_delivery_before: nil,
|
94
|
+
estimated_delivery_after: nil, shipment_delivery_before: nil, shipment_delivery_after: nil,
|
95
|
+
requested_pick_up_before: nil, requested_pick_up_after: nil, scheduled_pick_up_before: nil,
|
96
|
+
scheduled_pick_up_after: nil, current_shipment_status: nil, vendor_shipment_identifier: nil,
|
97
|
+
buyer_reference_number: nil, buyer_warehouse_code: nil, seller_warehouse_code: nil, rate_limit: 10.0)
|
98
|
+
cannot_sandbox!
|
99
|
+
|
100
|
+
path = "/vendor/shipping/v1/shipments"
|
101
|
+
params = {
|
102
|
+
"limit" => limit,
|
103
|
+
"sortOrder" => sort_order,
|
104
|
+
"nextToken" => next_token,
|
105
|
+
"createdAfter" => created_after,
|
106
|
+
"createdBefore" => created_before,
|
107
|
+
"shipmentConfirmedBefore" => shipment_confirmed_before,
|
108
|
+
"shipmentConfirmedAfter" => shipment_confirmed_after,
|
109
|
+
"packageLabelCreatedBefore" => package_label_created_before,
|
110
|
+
"packageLabelCreatedAfter" => package_label_created_after,
|
111
|
+
"shippedBefore" => shipped_before,
|
112
|
+
"shippedAfter" => shipped_after,
|
113
|
+
"estimatedDeliveryBefore" => estimated_delivery_before,
|
114
|
+
"estimatedDeliveryAfter" => estimated_delivery_after,
|
115
|
+
"shipmentDeliveryBefore" => shipment_delivery_before,
|
116
|
+
"shipmentDeliveryAfter" => shipment_delivery_after,
|
117
|
+
"requestedPickUpBefore" => requested_pick_up_before,
|
118
|
+
"requestedPickUpAfter" => requested_pick_up_after,
|
119
|
+
"scheduledPickUpBefore" => scheduled_pick_up_before,
|
120
|
+
"scheduledPickUpAfter" => scheduled_pick_up_after,
|
121
|
+
"currentShipmentStatus" => current_shipment_status,
|
122
|
+
"vendorShipmentIdentifier" => vendor_shipment_identifier,
|
123
|
+
"buyerReferenceNumber" => buyer_reference_number,
|
124
|
+
"buyerWarehouseCode" => buyer_warehouse_code,
|
125
|
+
"sellerWarehouseCode" => seller_warehouse_code,
|
126
|
+
}.compact
|
127
|
+
|
128
|
+
meter(rate_limit).get(path, params:)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -3,7 +3,13 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
-
class
|
6
|
+
class << self
|
7
|
+
def vendor_transaction_status_v1(...)
|
8
|
+
APIs::VendorTransactionStatusV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module APIs
|
7
13
|
# Selling Partner API for Retail Procurement Transaction Status
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status
|
@@ -11,13 +17,16 @@ module Peddler
|
|
11
17
|
class VendorTransactionStatusV1 < API
|
12
18
|
# Returns the status of the transaction that you specify.
|
13
19
|
#
|
14
|
-
# @param [String]
|
20
|
+
# @param transaction_id [String] The GUID provided by Amazon in the 'transactionId' field in response to the post
|
15
21
|
# request of a specific transaction.
|
16
|
-
# @
|
17
|
-
|
22
|
+
# @param rate_limit [Float] Requests per second
|
23
|
+
# @return [Peddler::Response] The API response
|
24
|
+
def get_transaction(transaction_id, rate_limit: 10.0)
|
25
|
+
cannot_sandbox!
|
26
|
+
|
18
27
|
path = "/vendor/transactions/v1/transactions/#{transaction_id}"
|
19
28
|
|
20
|
-
rate_limit
|
29
|
+
meter(rate_limit).get(path)
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|