peddler 4.3.1 → 4.4.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +328 -109
  3. data/lib/peddler/api.rb +11 -0
  4. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +7 -7
  5. data/lib/peddler/apis/aplus_content_2020_11_01.rb +10 -10
  6. data/lib/peddler/apis/application_integrations_2024_04_01.rb +1 -1
  7. data/lib/peddler/apis/catalog_items_2020_12_01.rb +8 -8
  8. data/lib/peddler/apis/catalog_items_2022_04_01.rb +9 -9
  9. data/lib/peddler/apis/data_kiosk_2023_11_15.rb +4 -4
  10. data/lib/peddler/apis/fba_inbound_eligibility_v1.rb +1 -1
  11. data/lib/peddler/apis/fba_inventory_v1.rb +3 -3
  12. data/lib/peddler/apis/feeds_2021_06_30.rb +6 -6
  13. data/lib/peddler/apis/finances_2024_06_01.rb +1 -1
  14. data/lib/peddler/apis/finances_v0.rb +2 -2
  15. data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +40 -40
  16. data/lib/peddler/apis/fulfillment_inbound_v0.rb +8 -8
  17. data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +7 -7
  18. data/lib/peddler/apis/invoices_2024_06_19.rb +4 -4
  19. data/lib/peddler/apis/listings_items_2020_09_01.rb +6 -6
  20. data/lib/peddler/apis/listings_items_2021_08_01.rb +20 -26
  21. data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +1 -1
  22. data/lib/peddler/apis/merchant_fulfillment_v0.rb +2 -2
  23. data/lib/peddler/apis/messaging_v1.rb +26 -26
  24. data/lib/peddler/apis/notifications_v1.rb +6 -6
  25. data/lib/peddler/apis/orders_v0.rb +16 -16
  26. data/lib/peddler/apis/product_fees_v0.rb +2 -2
  27. data/lib/peddler/apis/product_pricing_v0.rb +6 -6
  28. data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +4 -4
  29. data/lib/peddler/apis/reports_2021_06_30.rb +9 -9
  30. data/lib/peddler/apis/sales_v1.rb +7 -2
  31. data/lib/peddler/apis/seller_wallet_2024_03_01.rb +5 -5
  32. data/lib/peddler/apis/services_v1.rb +27 -27
  33. data/lib/peddler/apis/shipment_invoicing_v0.rb +3 -3
  34. data/lib/peddler/apis/shipping_v1.rb +5 -5
  35. data/lib/peddler/apis/shipping_v2.rb +6 -6
  36. data/lib/peddler/apis/solicitations_v1.rb +4 -4
  37. data/lib/peddler/apis/supply_sources_2020_07_01.rb +4 -4
  38. data/lib/peddler/apis/uploads_2020_11_01.rb +2 -2
  39. data/lib/peddler/apis/vendor_direct_fulfillment_inventory_v1.rb +1 -1
  40. data/lib/peddler/apis/vendor_direct_fulfillment_orders_2021_12_28.rb +1 -1
  41. data/lib/peddler/apis/vendor_direct_fulfillment_orders_v1.rb +1 -1
  42. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +1 -1
  43. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +4 -4
  44. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +3 -3
  45. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_2021_12_28.rb +1 -1
  46. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_v1.rb +1 -1
  47. data/lib/peddler/apis/vendor_orders_v1.rb +1 -1
  48. data/lib/peddler/apis/vendor_transaction_status_v1.rb +1 -1
  49. data/lib/peddler/error.rb +16 -4
  50. data/lib/peddler/token.rb +6 -11
  51. data/lib/peddler/version.rb +1 -1
  52. data/lib/peddler.rb +51 -0
  53. metadata +1 -3
  54. data/lib/peddler/parsers/openapi_parser_generator.rb +0 -550
  55. data/lib/peddler/parsers/smart_parser.rb +0 -199
@@ -39,8 +39,8 @@ module Peddler
39
39
  path = "/fba/inbound/v0/prepInstructions"
40
40
  params = {
41
41
  "ShipToCountryCode" => ship_to_country_code,
42
- "SellerSKUList" => seller_sku_list,
43
- "ASINList" => asin_list,
42
+ "SellerSKUList" => stringify_array(seller_sku_list),
43
+ "ASINList" => stringify_array(asin_list),
44
44
  }.compact
45
45
 
46
46
  meter(rate_limit).get(path, params:)
@@ -75,12 +75,12 @@ module Peddler
75
75
  # @return [Peddler::Response] The API response
76
76
  def get_labels(shipment_id, page_type, label_type, number_of_packages: nil, package_labels_to_print: nil,
77
77
  number_of_pallets: nil, page_size: nil, page_start_index: nil, rate_limit: 2.0)
78
- path = "/fba/inbound/v0/shipments/#{shipment_id}/labels"
78
+ path = "/fba/inbound/v0/shipments/#{percent_encode(shipment_id)}/labels"
79
79
  params = {
80
80
  "PageType" => page_type,
81
81
  "LabelType" => label_type,
82
82
  "NumberOfPackages" => number_of_packages,
83
- "PackageLabelsToPrint" => package_labels_to_print,
83
+ "PackageLabelsToPrint" => stringify_array(package_labels_to_print),
84
84
  "NumberOfPallets" => number_of_pallets,
85
85
  "PageSize" => page_size,
86
86
  "PageStartIndex" => page_start_index,
@@ -99,7 +99,7 @@ module Peddler
99
99
  # @param rate_limit [Float] Requests per second
100
100
  # @return [Peddler::Response] The API response
101
101
  def get_bill_of_lading(shipment_id, rate_limit: 2.0)
102
- path = "/fba/inbound/v0/shipments/#{shipment_id}/billOfLading"
102
+ path = "/fba/inbound/v0/shipments/#{percent_encode(shipment_id)}/billOfLading"
103
103
 
104
104
  meter(rate_limit).get(path)
105
105
  end
@@ -129,8 +129,8 @@ module Peddler
129
129
  last_updated_after: nil, last_updated_before: nil, next_token: nil, rate_limit: 2.0)
130
130
  path = "/fba/inbound/v0/shipments"
131
131
  params = {
132
- "ShipmentStatusList" => shipment_status_list,
133
- "ShipmentIdList" => shipment_id_list,
132
+ "ShipmentStatusList" => stringify_array(shipment_status_list),
133
+ "ShipmentIdList" => stringify_array(shipment_id_list),
134
134
  "LastUpdatedAfter" => last_updated_after,
135
135
  "LastUpdatedBefore" => last_updated_before,
136
136
  "QueryType" => query_type,
@@ -149,7 +149,7 @@ module Peddler
149
149
  # @param rate_limit [Float] Requests per second
150
150
  # @return [Peddler::Response] The API response
151
151
  def get_shipment_items_by_shipment_id(shipment_id, marketplace_id: nil, rate_limit: 2.0)
152
- path = "/fba/inbound/v0/shipments/#{shipment_id}/items"
152
+ path = "/fba/inbound/v0/shipments/#{percent_encode(shipment_id)}/items"
153
153
  params = {
154
154
  "MarketplaceId" => marketplace_id,
155
155
  }.compact
@@ -128,7 +128,7 @@ module Peddler
128
128
  # @param rate_limit [Float] Requests per second
129
129
  # @return [Peddler::Response] The API response
130
130
  def create_fulfillment_return(body, seller_fulfillment_order_id, rate_limit: 2.0)
131
- path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/return"
131
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{percent_encode(seller_fulfillment_order_id)}/return"
132
132
 
133
133
  meter(rate_limit).put(path, body:)
134
134
  end
@@ -141,7 +141,7 @@ module Peddler
141
141
  # @param rate_limit [Float] Requests per second
142
142
  # @return [Peddler::Response] The API response
143
143
  def get_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
144
- path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
144
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{percent_encode(seller_fulfillment_order_id)}"
145
145
 
146
146
  meter(rate_limit).get(path)
147
147
  end
@@ -155,7 +155,7 @@ module Peddler
155
155
  # @param rate_limit [Float] Requests per second
156
156
  # @return [Peddler::Response] The API response
157
157
  def update_fulfillment_order(body, seller_fulfillment_order_id, rate_limit: 2.0)
158
- path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
158
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{percent_encode(seller_fulfillment_order_id)}"
159
159
 
160
160
  meter(rate_limit).put(path, body:)
161
161
  end
@@ -169,7 +169,7 @@ module Peddler
169
169
  # @param rate_limit [Float] Requests per second
170
170
  # @return [Peddler::Response] The API response
171
171
  def cancel_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
172
- path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/cancel"
172
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{percent_encode(seller_fulfillment_order_id)}/cancel"
173
173
 
174
174
  meter(rate_limit).put(path)
175
175
  end
@@ -188,7 +188,7 @@ module Peddler
188
188
  def submit_fulfillment_order_status_update(seller_fulfillment_order_id, body)
189
189
  must_sandbox!
190
190
 
191
- path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/status"
191
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{percent_encode(seller_fulfillment_order_id)}/status"
192
192
 
193
193
  put(path, body:)
194
194
  end
@@ -223,7 +223,7 @@ module Peddler
223
223
  # @param rate_limit [Float] Requests per second
224
224
  # @return [Peddler::Response] The API response
225
225
  def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil, rate_limit: 2.0)
226
- path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}"
226
+ path = "/fba/outbound/2020-07-01/features/inventory/#{percent_encode(feature_name)}"
227
227
  params = {
228
228
  "marketplaceId" => marketplace_id,
229
229
  "nextToken" => next_token,
@@ -246,7 +246,7 @@ module Peddler
246
246
  # @param rate_limit [Float] Requests per second
247
247
  # @return [Peddler::Response] The API response
248
248
  def get_feature_sku(marketplace_id, feature_name, seller_sku, rate_limit: 2.0)
249
- path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}/#{seller_sku}"
249
+ path = "/fba/outbound/2020-07-01/features/inventory/#{percent_encode(feature_name)}/#{percent_encode(seller_sku)}"
250
250
  params = {
251
251
  "marketplaceId" => marketplace_id,
252
252
  }.compact
@@ -38,7 +38,7 @@ module Peddler
38
38
  # @param rate_limit [Float] Requests per second
39
39
  # @return [Peddler::Response] The API response
40
40
  def get_invoices_document(invoices_document_id, rate_limit: 0.0167)
41
- path = "/tax/invoices/2024-06-19/documents/#{invoices_document_id}"
41
+ path = "/tax/invoices/2024-06-19/documents/#{percent_encode(invoices_document_id)}"
42
42
 
43
43
  meter(rate_limit).get(path)
44
44
  end
@@ -95,7 +95,7 @@ module Peddler
95
95
  # @param rate_limit [Float] Requests per second
96
96
  # @return [Peddler::Response] The API response
97
97
  def get_invoices_export(export_id, rate_limit: 2.0)
98
- path = "/tax/invoices/2024-06-19/exports/#{export_id}"
98
+ path = "/tax/invoices/2024-06-19/exports/#{percent_encode(export_id)}"
99
99
 
100
100
  meter(rate_limit).get(path)
101
101
  end
@@ -150,7 +150,7 @@ module Peddler
150
150
  "nextToken" => next_token,
151
151
  "sortOrder" => sort_order,
152
152
  "invoiceType" => invoice_type,
153
- "statuses" => statuses,
153
+ "statuses" => stringify_array(statuses),
154
154
  "externalInvoiceId" => external_invoice_id,
155
155
  "sortBy" => sort_by,
156
156
  }.compact
@@ -168,7 +168,7 @@ module Peddler
168
168
  # @param rate_limit [Float] Requests per second
169
169
  # @return [Peddler::Response] The API response
170
170
  def get_invoice(marketplace_id, invoice_id, rate_limit: 2.0)
171
- path = "/tax/invoices/2024-06-19/invoices/#{invoice_id}"
171
+ path = "/tax/invoices/2024-06-19/invoices/#{percent_encode(invoice_id)}"
172
172
  params = {
173
173
  "marketplaceId" => marketplace_id,
174
174
  }.compact
@@ -32,9 +32,9 @@ module Peddler
32
32
  # @param rate_limit [Float] Requests per second
33
33
  # @return [Peddler::Response] The API response
34
34
  def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0)
35
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
35
+ path = "/listings/2020-09-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
36
36
  params = {
37
- "marketplaceIds" => marketplace_ids,
37
+ "marketplaceIds" => stringify_array(marketplace_ids),
38
38
  "issueLocale" => issue_locale,
39
39
  }.compact
40
40
 
@@ -57,9 +57,9 @@ module Peddler
57
57
  # @param rate_limit [Float] Requests per second
58
58
  # @return [Peddler::Response] The API response
59
59
  def patch_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil, rate_limit: 5.0)
60
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
60
+ path = "/listings/2020-09-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
61
61
  params = {
62
- "marketplaceIds" => marketplace_ids,
62
+ "marketplaceIds" => stringify_array(marketplace_ids),
63
63
  "issueLocale" => issue_locale,
64
64
  }.compact
65
65
 
@@ -82,9 +82,9 @@ module Peddler
82
82
  # @param rate_limit [Float] Requests per second
83
83
  # @return [Peddler::Response] The API response
84
84
  def put_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil, rate_limit: 5.0)
85
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
85
+ path = "/listings/2020-09-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
86
86
  params = {
87
- "marketplaceIds" => marketplace_ids,
87
+ "marketplaceIds" => stringify_array(marketplace_ids),
88
88
  "issueLocale" => issue_locale,
89
89
  }.compact
90
90
 
@@ -32,18 +32,16 @@ module Peddler
32
32
  # @param rate_limit [Float] Requests per second
33
33
  # @return [Peddler::Response] The API response
34
34
  def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0)
35
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
35
+ path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
36
36
  params = {
37
- "marketplaceIds" => marketplace_ids,
37
+ "marketplaceIds" => stringify_array(marketplace_ids),
38
38
  "issueLocale" => issue_locale,
39
39
  }.compact
40
40
 
41
41
  meter(rate_limit).delete(path, params:)
42
42
  end
43
43
 
44
- # Returns details about a listings item for a selling partner. **Note:** The parameters associated with this
45
- # operation may contain special characters that must be encoded to successfully call the API. To avoid errors with
46
- # SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
44
+ # Returns details about a listings item for a selling partner.
47
45
  #
48
46
  # @note This operation can make a static sandbox call.
49
47
  # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
@@ -58,11 +56,11 @@ module Peddler
58
56
  # @return [Peddler::Response] The API response
59
57
  def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: ["summaries"],
60
58
  rate_limit: 5.0)
61
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
59
+ path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
62
60
  params = {
63
- "marketplaceIds" => marketplace_ids,
61
+ "marketplaceIds" => stringify_array(marketplace_ids),
64
62
  "issueLocale" => issue_locale,
65
- "includedData" => included_data,
63
+ "includedData" => stringify_array(included_data),
66
64
  }.compact
67
65
 
68
66
  meter(rate_limit).get(path, params:)
@@ -86,10 +84,10 @@ module Peddler
86
84
  # @return [Peddler::Response] The API response
87
85
  def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
88
86
  issue_locale: nil, rate_limit: 5.0)
89
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
87
+ path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
90
88
  params = {
91
- "marketplaceIds" => marketplace_ids,
92
- "includedData" => included_data,
89
+ "marketplaceIds" => stringify_array(marketplace_ids),
90
+ "includedData" => stringify_array(included_data),
93
91
  "mode" => mode,
94
92
  "issueLocale" => issue_locale,
95
93
  }.compact
@@ -97,11 +95,7 @@ module Peddler
97
95
  meter(rate_limit).patch(path, body:, params:)
98
96
  end
99
97
 
100
- # Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a
101
- # throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters
102
- # associated with this operation may contain special characters that must be encoded to successfully call the API.
103
- # To avoid errors with SKUs when encoding URLs, refer to [URL
104
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
98
+ # Creates a new or fully-updates an existing listings item for a selling partner.
105
99
  #
106
100
  # @note This operation can make a static sandbox call.
107
101
  # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
@@ -118,10 +112,10 @@ module Peddler
118
112
  # @return [Peddler::Response] The API response
119
113
  def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
120
114
  issue_locale: nil, rate_limit: 5.0)
121
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
115
+ path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
122
116
  params = {
123
- "marketplaceIds" => marketplace_ids,
124
- "includedData" => included_data,
117
+ "marketplaceIds" => stringify_array(marketplace_ids),
118
+ "includedData" => stringify_array(included_data),
125
119
  "mode" => mode,
126
120
  "issueLocale" => issue_locale,
127
121
  }.compact
@@ -179,12 +173,12 @@ module Peddler
179
173
  created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil,
180
174
  with_issue_severity: nil, with_status: nil, without_status: nil, sort_by: "lastUpdatedDate", sort_order: "DESC",
181
175
  page_size: 10, page_token: nil, rate_limit: 5.0)
182
- path = "/listings/2021-08-01/items/#{seller_id}"
176
+ path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}"
183
177
  params = {
184
- "marketplaceIds" => marketplace_ids,
178
+ "marketplaceIds" => stringify_array(marketplace_ids),
185
179
  "issueLocale" => issue_locale,
186
- "includedData" => included_data,
187
- "identifiers" => identifiers,
180
+ "includedData" => stringify_array(included_data),
181
+ "identifiers" => stringify_array(identifiers),
188
182
  "identifiersType" => identifiers_type,
189
183
  "variationParentSku" => variation_parent_sku,
190
184
  "packageHierarchySku" => package_hierarchy_sku,
@@ -192,9 +186,9 @@ module Peddler
192
186
  "createdBefore" => created_before,
193
187
  "lastUpdatedAfter" => last_updated_after,
194
188
  "lastUpdatedBefore" => last_updated_before,
195
- "withIssueSeverity" => with_issue_severity,
196
- "withStatus" => with_status,
197
- "withoutStatus" => without_status,
189
+ "withIssueSeverity" => stringify_array(with_issue_severity),
190
+ "withStatus" => stringify_array(with_status),
191
+ "withoutStatus" => stringify_array(without_status),
198
192
  "sortBy" => sort_by,
199
193
  "sortOrder" => sort_order,
200
194
  "pageSize" => page_size,
@@ -36,7 +36,7 @@ module Peddler
36
36
  "asin" => asin,
37
37
  "conditionType" => condition_type,
38
38
  "sellerId" => seller_id,
39
- "marketplaceIds" => marketplace_ids,
39
+ "marketplaceIds" => stringify_array(marketplace_ids),
40
40
  "reasonLocale" => reason_locale,
41
41
  }.compact
42
42
 
@@ -34,7 +34,7 @@ module Peddler
34
34
  # @param rate_limit [Float] Requests per second
35
35
  # @return [Peddler::Response] The API response
36
36
  def get_shipment(shipment_id, rate_limit: 1.0)
37
- path = "/mfn/v0/shipments/#{shipment_id}"
37
+ path = "/mfn/v0/shipments/#{percent_encode(shipment_id)}"
38
38
 
39
39
  meter(rate_limit).get(path)
40
40
  end
@@ -46,7 +46,7 @@ module Peddler
46
46
  # @param rate_limit [Float] Requests per second
47
47
  # @return [Peddler::Response] The API response
48
48
  def cancel_shipment(shipment_id, rate_limit: 1.0)
49
- path = "/mfn/v0/shipments/#{shipment_id}"
49
+ path = "/mfn/v0/shipments/#{percent_encode(shipment_id)}"
50
50
 
51
51
  meter(rate_limit).delete(path)
52
52
  end
@@ -29,9 +29,9 @@ module Peddler
29
29
  # @param rate_limit [Float] Requests per second
30
30
  # @return [Peddler::Response] The API response
31
31
  def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
32
- path = "/messaging/v1/orders/#{amazon_order_id}"
32
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}"
33
33
  params = {
34
- "marketplaceIds" => marketplace_ids,
34
+ "marketplaceIds" => stringify_array(marketplace_ids),
35
35
  }.compact
36
36
 
37
37
  meter(rate_limit).get(path, params:)
@@ -49,9 +49,9 @@ module Peddler
49
49
  # @param rate_limit [Float] Requests per second
50
50
  # @return [Peddler::Response] The API response
51
51
  def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
52
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmCustomizationDetails"
52
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmCustomizationDetails"
53
53
  params = {
54
- "marketplaceIds" => marketplace_ids,
54
+ "marketplaceIds" => stringify_array(marketplace_ids),
55
55
  }.compact
56
56
 
57
57
  meter(rate_limit).post(path, body:, params:)
@@ -68,9 +68,9 @@ module Peddler
68
68
  # @param rate_limit [Float] Requests per second
69
69
  # @return [Peddler::Response] The API response
70
70
  def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
71
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmDeliveryDetails"
71
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmDeliveryDetails"
72
72
  params = {
73
- "marketplaceIds" => marketplace_ids,
73
+ "marketplaceIds" => stringify_array(marketplace_ids),
74
74
  }.compact
75
75
 
76
76
  meter(rate_limit).post(path, body:, params:)
@@ -88,9 +88,9 @@ module Peddler
88
88
  # @param rate_limit [Float] Requests per second
89
89
  # @return [Peddler::Response] The API response
90
90
  def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
91
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/legalDisclosure"
91
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/legalDisclosure"
92
92
  params = {
93
- "marketplaceIds" => marketplace_ids,
93
+ "marketplaceIds" => stringify_array(marketplace_ids),
94
94
  }.compact
95
95
 
96
96
  meter(rate_limit).post(path, body:, params:)
@@ -107,9 +107,9 @@ module Peddler
107
107
  # @param rate_limit [Float] Requests per second
108
108
  # @return [Peddler::Response] The API response
109
109
  def create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0)
110
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/negativeFeedbackRemoval"
110
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/negativeFeedbackRemoval"
111
111
  params = {
112
- "marketplaceIds" => marketplace_ids,
112
+ "marketplaceIds" => stringify_array(marketplace_ids),
113
113
  }.compact
114
114
 
115
115
  meter(rate_limit).post(path, params:)
@@ -126,9 +126,9 @@ module Peddler
126
126
  # @param rate_limit [Float] Requests per second
127
127
  # @return [Peddler::Response] The API response
128
128
  def create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
129
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmOrderDetails"
129
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmOrderDetails"
130
130
  params = {
131
- "marketplaceIds" => marketplace_ids,
131
+ "marketplaceIds" => stringify_array(marketplace_ids),
132
132
  }.compact
133
133
 
134
134
  meter(rate_limit).post(path, body:, params:)
@@ -146,9 +146,9 @@ module Peddler
146
146
  # @param rate_limit [Float] Requests per second
147
147
  # @return [Peddler::Response] The API response
148
148
  def create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
149
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmServiceDetails"
149
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmServiceDetails"
150
150
  params = {
151
- "marketplaceIds" => marketplace_ids,
151
+ "marketplaceIds" => stringify_array(marketplace_ids),
152
152
  }.compact
153
153
 
154
154
  meter(rate_limit).post(path, body:, params:)
@@ -166,9 +166,9 @@ module Peddler
166
166
  # @param rate_limit [Float] Requests per second
167
167
  # @return [Peddler::Response] The API response
168
168
  def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
169
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/amazonMotors"
169
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/amazonMotors"
170
170
  params = {
171
- "marketplaceIds" => marketplace_ids,
171
+ "marketplaceIds" => stringify_array(marketplace_ids),
172
172
  }.compact
173
173
 
174
174
  meter(rate_limit).post(path, body:, params:)
@@ -185,9 +185,9 @@ module Peddler
185
185
  # @param rate_limit [Float] Requests per second
186
186
  # @return [Peddler::Response] The API response
187
187
  def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
188
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/warranty"
188
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/warranty"
189
189
  params = {
190
- "marketplaceIds" => marketplace_ids,
190
+ "marketplaceIds" => stringify_array(marketplace_ids),
191
191
  }.compact
192
192
 
193
193
  meter(rate_limit).post(path, body:, params:)
@@ -203,9 +203,9 @@ module Peddler
203
203
  # @param rate_limit [Float] Requests per second
204
204
  # @return [Peddler::Response] The API response
205
205
  def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0)
206
- path = "/messaging/v1/orders/#{amazon_order_id}/attributes"
206
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/attributes"
207
207
  params = {
208
- "marketplaceIds" => marketplace_ids,
208
+ "marketplaceIds" => stringify_array(marketplace_ids),
209
209
  }.compact
210
210
 
211
211
  meter(rate_limit).get(path, params:)
@@ -223,9 +223,9 @@ module Peddler
223
223
  # @param rate_limit [Float] Requests per second
224
224
  # @return [Peddler::Response] The API response
225
225
  def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
226
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/digitalAccessKey"
226
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/digitalAccessKey"
227
227
  params = {
228
- "marketplaceIds" => marketplace_ids,
228
+ "marketplaceIds" => stringify_array(marketplace_ids),
229
229
  }.compact
230
230
 
231
231
  meter(rate_limit).post(path, body:, params:)
@@ -243,9 +243,9 @@ module Peddler
243
243
  # @param rate_limit [Float] Requests per second
244
244
  # @return [Peddler::Response] The API response
245
245
  def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
246
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/unexpectedProblem"
246
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/unexpectedProblem"
247
247
  params = {
248
- "marketplaceIds" => marketplace_ids,
248
+ "marketplaceIds" => stringify_array(marketplace_ids),
249
249
  }.compact
250
250
 
251
251
  meter(rate_limit).post(path, body:, params:)
@@ -261,9 +261,9 @@ module Peddler
261
261
  # @param body [Hash] This contains the message body for a message.
262
262
  # @return [Peddler::Response] The API response
263
263
  def send_invoice(amazon_order_id, marketplace_ids, body)
264
- path = "/messaging/v1/orders/#{amazon_order_id}/messages/invoice"
264
+ path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/invoice"
265
265
  params = {
266
- "marketplaceIds" => marketplace_ids,
266
+ "marketplaceIds" => stringify_array(marketplace_ids),
267
267
  }.compact
268
268
 
269
269
  post(path, body:, params:)
@@ -29,7 +29,7 @@ module Peddler
29
29
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
30
30
  # @return [Peddler::Response] The API response
31
31
  def get_subscription(notification_type, payload_version: nil, rate_limit: 1.0)
32
- path = "/notifications/v1/subscriptions/#{notification_type}"
32
+ path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}"
33
33
  params = {
34
34
  "payloadVersion" => payload_version,
35
35
  }.compact
@@ -49,7 +49,7 @@ module Peddler
49
49
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
50
50
  # @return [Peddler::Response] The API response
51
51
  def create_subscription(body, notification_type, rate_limit: 1.0)
52
- path = "/notifications/v1/subscriptions/#{notification_type}"
52
+ path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}"
53
53
 
54
54
  meter(rate_limit).post(path, body:)
55
55
  end
@@ -65,7 +65,7 @@ module Peddler
65
65
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
66
66
  # @return [Peddler::Response] The API response
67
67
  def get_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
68
- path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
68
+ path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}/#{percent_encode(subscription_id)}"
69
69
 
70
70
  meter(rate_limit).get(path)
71
71
  end
@@ -83,7 +83,7 @@ module Peddler
83
83
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
84
84
  # @return [Peddler::Response] The API response
85
85
  def delete_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
86
- path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
86
+ path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}/#{percent_encode(subscription_id)}"
87
87
 
88
88
  meter(rate_limit).delete(path)
89
89
  end
@@ -123,7 +123,7 @@ module Peddler
123
123
  # @param rate_limit [Float] Requests per second
124
124
  # @return [Peddler::Response] The API response
125
125
  def get_destination(destination_id, rate_limit: 1.0)
126
- path = "/notifications/v1/destinations/#{destination_id}"
126
+ path = "/notifications/v1/destinations/#{percent_encode(destination_id)}"
127
127
 
128
128
  meter(rate_limit).get(path)
129
129
  end
@@ -136,7 +136,7 @@ module Peddler
136
136
  # @param rate_limit [Float] Requests per second
137
137
  # @return [Peddler::Response] The API response
138
138
  def delete_destination(destination_id, rate_limit: 1.0)
139
- path = "/notifications/v1/destinations/#{destination_id}"
139
+ path = "/notifications/v1/destinations/#{percent_encode(destination_id)}"
140
140
 
141
141
  meter(rate_limit).delete(path)
142
142
  end
@@ -124,17 +124,17 @@ module Peddler
124
124
  "CreatedBefore" => created_before,
125
125
  "LastUpdatedAfter" => last_updated_after,
126
126
  "LastUpdatedBefore" => last_updated_before,
127
- "OrderStatuses" => order_statuses,
128
- "MarketplaceIds" => marketplace_ids,
129
- "FulfillmentChannels" => fulfillment_channels,
130
- "PaymentMethods" => payment_methods,
127
+ "OrderStatuses" => stringify_array(order_statuses),
128
+ "MarketplaceIds" => stringify_array(marketplace_ids),
129
+ "FulfillmentChannels" => stringify_array(fulfillment_channels),
130
+ "PaymentMethods" => stringify_array(payment_methods),
131
131
  "BuyerEmail" => buyer_email,
132
132
  "SellerOrderId" => seller_order_id,
133
133
  "MaxResultsPerPage" => max_results_per_page,
134
- "EasyShipShipmentStatuses" => easy_ship_shipment_statuses,
135
- "ElectronicInvoiceStatuses" => electronic_invoice_statuses,
134
+ "EasyShipShipmentStatuses" => stringify_array(easy_ship_shipment_statuses),
135
+ "ElectronicInvoiceStatuses" => stringify_array(electronic_invoice_statuses),
136
136
  "NextToken" => next_token,
137
- "AmazonOrderIds" => amazon_order_ids,
137
+ "AmazonOrderIds" => stringify_array(amazon_order_ids),
138
138
  "ActualFulfillmentSupplySourceId" => actual_fulfillment_supply_source_id,
139
139
  "IsISPU" => is_ispu,
140
140
  "StoreChainStoreId" => store_chain_store_id,
@@ -154,7 +154,7 @@ module Peddler
154
154
  # @param rate_limit [Float] Requests per second
155
155
  # @return [Peddler::Response] The API response
156
156
  def get_order(order_id, rate_limit: 0.5)
157
- path = "/orders/v0/orders/#{order_id}"
157
+ path = "/orders/v0/orders/#{percent_encode(order_id)}"
158
158
 
159
159
  meter(rate_limit).get(path)
160
160
  end
@@ -166,7 +166,7 @@ module Peddler
166
166
  # @param rate_limit [Float] Requests per second
167
167
  # @return [Peddler::Response] The API response
168
168
  def get_order_buyer_info(order_id, rate_limit: 0.5)
169
- path = "/orders/v0/orders/#{order_id}/buyerInfo"
169
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/buyerInfo"
170
170
 
171
171
  meter(rate_limit).get(path)
172
172
  end
@@ -178,7 +178,7 @@ module Peddler
178
178
  # @param rate_limit [Float] Requests per second
179
179
  # @return [Peddler::Response] The API response
180
180
  def get_order_address(order_id, rate_limit: 0.5)
181
- path = "/orders/v0/orders/#{order_id}/address"
181
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/address"
182
182
 
183
183
  meter(rate_limit).get(path)
184
184
  end
@@ -197,7 +197,7 @@ module Peddler
197
197
  # @param rate_limit [Float] Requests per second
198
198
  # @return [Peddler::Response] The API response
199
199
  def get_order_items(order_id, next_token: nil, rate_limit: 0.5)
200
- path = "/orders/v0/orders/#{order_id}/orderItems"
200
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems"
201
201
  params = {
202
202
  "NextToken" => next_token,
203
203
  }.compact
@@ -213,7 +213,7 @@ module Peddler
213
213
  # @param rate_limit [Float] Requests per second
214
214
  # @return [Peddler::Response] The API response
215
215
  def get_order_items_buyer_info(order_id, next_token: nil, rate_limit: 0.5)
216
- path = "/orders/v0/orders/#{order_id}/orderItems/buyerInfo"
216
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems/buyerInfo"
217
217
  params = {
218
218
  "NextToken" => next_token,
219
219
  }.compact
@@ -229,7 +229,7 @@ module Peddler
229
229
  # @param rate_limit [Float] Requests per second
230
230
  # @return [Peddler::Response] The API response
231
231
  def update_shipment_status(order_id, payload, rate_limit: 5.0)
232
- path = "/orders/v0/orders/#{order_id}/shipment"
232
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/shipment"
233
233
  body = payload
234
234
 
235
235
  meter(rate_limit).post(path, body:)
@@ -242,7 +242,7 @@ module Peddler
242
242
  # @param rate_limit [Float] Requests per second
243
243
  # @return [Peddler::Response] The API response
244
244
  def get_order_regulated_info(order_id, rate_limit: 0.5)
245
- path = "/orders/v0/orders/#{order_id}/regulatedInfo"
245
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo"
246
246
 
247
247
  meter(rate_limit).get(path)
248
248
  end
@@ -255,7 +255,7 @@ module Peddler
255
255
  # @param rate_limit [Float] Requests per second
256
256
  # @return [Peddler::Response] The API response
257
257
  def update_verification_status(order_id, payload, rate_limit: 0.5)
258
- path = "/orders/v0/orders/#{order_id}/regulatedInfo"
258
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo"
259
259
  body = payload
260
260
 
261
261
  meter(rate_limit).patch(path, body:)
@@ -269,7 +269,7 @@ module Peddler
269
269
  # @param rate_limit [Float] Requests per second
270
270
  # @return [Peddler::Response] The API response
271
271
  def confirm_shipment(order_id, payload, rate_limit: 2.0)
272
- path = "/orders/v0/orders/#{order_id}/shipmentConfirmation"
272
+ path = "/orders/v0/orders/#{percent_encode(order_id)}/shipmentConfirmation"
273
273
  body = payload
274
274
 
275
275
  meter(rate_limit).post(path, body:)