peddler 4.3.0 → 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
@@ -35,7 +35,7 @@ module Peddler
35
35
  # @param rate_limit [Float] Requests per second
36
36
  # @return [Peddler::Response] The API response
37
37
  def get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0)
38
- path = "/products/fees/v0/listings/#{seller_sku}/feesEstimate"
38
+ path = "/products/fees/v0/listings/#{percent_encode(seller_sku)}/feesEstimate"
39
39
 
40
40
  meter(rate_limit).post(path, body:)
41
41
  end
@@ -56,7 +56,7 @@ module Peddler
56
56
  # @param rate_limit [Float] Requests per second
57
57
  # @return [Peddler::Response] The API response
58
58
  def get_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0)
59
- path = "/products/fees/v0/items/#{asin}/feesEstimate"
59
+ path = "/products/fees/v0/items/#{percent_encode(asin)}/feesEstimate"
60
60
 
61
61
  meter(rate_limit).post(path, body:)
62
62
  end
@@ -42,8 +42,8 @@ module Peddler
42
42
  path = "/products/pricing/v0/price"
43
43
  params = {
44
44
  "MarketplaceId" => marketplace_id,
45
- "Asins" => asins,
46
- "Skus" => skus,
45
+ "Asins" => stringify_array(asins),
46
+ "Skus" => stringify_array(skus),
47
47
  "ItemType" => item_type,
48
48
  "ItemCondition" => item_condition,
49
49
  "OfferType" => offer_type,
@@ -76,8 +76,8 @@ module Peddler
76
76
  path = "/products/pricing/v0/competitivePrice"
77
77
  params = {
78
78
  "MarketplaceId" => marketplace_id,
79
- "Asins" => asins,
80
- "Skus" => skus,
79
+ "Asins" => stringify_array(asins),
80
+ "Skus" => stringify_array(skus),
81
81
  "ItemType" => item_type,
82
82
  "CustomerType" => customer_type,
83
83
  }.compact
@@ -100,7 +100,7 @@ module Peddler
100
100
  # @param rate_limit [Float] Requests per second
101
101
  # @return [Peddler::Response] The API response
102
102
  def get_listing_offers(marketplace_id, item_condition, seller_sku, customer_type: nil, rate_limit: 1.0)
103
- path = "/products/pricing/v0/listings/#{seller_sku}/offers"
103
+ path = "/products/pricing/v0/listings/#{percent_encode(seller_sku)}/offers"
104
104
  params = {
105
105
  "MarketplaceId" => marketplace_id,
106
106
  "ItemCondition" => item_condition,
@@ -122,7 +122,7 @@ module Peddler
122
122
  # @param rate_limit [Float] Requests per second
123
123
  # @return [Peddler::Response] The API response
124
124
  def get_item_offers(marketplace_id, item_condition, asin, customer_type: nil, rate_limit: 0.5)
125
- path = "/products/pricing/v0/items/#{asin}/offers"
125
+ path = "/products/pricing/v0/items/#{percent_encode(asin)}/offers"
126
126
  params = {
127
127
  "MarketplaceId" => marketplace_id,
128
128
  "ItemCondition" => item_condition,
@@ -37,8 +37,8 @@ module Peddler
37
37
  search_locale: nil, rate_limit: 5.0)
38
38
  path = "/definitions/2020-09-01/productTypes"
39
39
  params = {
40
- "keywords" => keywords,
41
- "marketplaceIds" => marketplace_ids,
40
+ "keywords" => stringify_array(keywords),
41
+ "marketplaceIds" => stringify_array(marketplace_ids),
42
42
  "itemName" => item_name,
43
43
  "locale" => locale,
44
44
  "searchLocale" => search_locale,
@@ -69,10 +69,10 @@ module Peddler
69
69
  # @return [Peddler::Response] The API response
70
70
  def get_definitions_product_type(product_type, marketplace_ids, seller_id: nil, product_type_version: "LATEST",
71
71
  requirements: "LISTING", requirements_enforced: "ENFORCED", locale: "DEFAULT", rate_limit: 5.0)
72
- path = "/definitions/2020-09-01/productTypes/#{product_type}"
72
+ path = "/definitions/2020-09-01/productTypes/#{percent_encode(product_type)}"
73
73
  params = {
74
74
  "sellerId" => seller_id,
75
- "marketplaceIds" => marketplace_ids,
75
+ "marketplaceIds" => stringify_array(marketplace_ids),
76
76
  "productTypeVersion" => product_type_version,
77
77
  "requirements" => requirements,
78
78
  "requirementsEnforced" => requirements_enforced,
@@ -41,9 +41,9 @@ module Peddler
41
41
  created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222)
42
42
  path = "/reports/2021-06-30/reports"
43
43
  params = {
44
- "reportTypes" => report_types,
45
- "processingStatuses" => processing_statuses,
46
- "marketplaceIds" => marketplace_ids,
44
+ "reportTypes" => stringify_array(report_types),
45
+ "processingStatuses" => stringify_array(processing_statuses),
46
+ "marketplaceIds" => stringify_array(marketplace_ids),
47
47
  "pageSize" => page_size,
48
48
  "createdSince" => created_since,
49
49
  "createdUntil" => created_until,
@@ -74,7 +74,7 @@ module Peddler
74
74
  # @param rate_limit [Float] Requests per second
75
75
  # @return [Peddler::Response] The API response
76
76
  def cancel_report(report_id, rate_limit: 0.0222)
77
- path = "/reports/2021-06-30/reports/#{report_id}"
77
+ path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}"
78
78
 
79
79
  meter(rate_limit).delete(path)
80
80
  end
@@ -87,7 +87,7 @@ module Peddler
87
87
  # @param rate_limit [Float] Requests per second
88
88
  # @return [Peddler::Response] The API response
89
89
  def get_report(report_id, rate_limit: 2.0)
90
- path = "/reports/2021-06-30/reports/#{report_id}"
90
+ path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}"
91
91
 
92
92
  meter(rate_limit).get(path)
93
93
  end
@@ -102,7 +102,7 @@ module Peddler
102
102
  def get_report_schedules(report_types, rate_limit: 0.0222)
103
103
  path = "/reports/2021-06-30/schedules"
104
104
  params = {
105
- "reportTypes" => report_types,
105
+ "reportTypes" => stringify_array(report_types),
106
106
  }.compact
107
107
 
108
108
  meter(rate_limit).get(path, params:)
@@ -129,7 +129,7 @@ module Peddler
129
129
  # @param rate_limit [Float] Requests per second
130
130
  # @return [Peddler::Response] The API response
131
131
  def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222)
132
- path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
132
+ path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}"
133
133
 
134
134
  meter(rate_limit).delete(path)
135
135
  end
@@ -142,7 +142,7 @@ module Peddler
142
142
  # @param rate_limit [Float] Requests per second
143
143
  # @return [Peddler::Response] The API response
144
144
  def get_report_schedule(report_schedule_id, rate_limit: 0.0222)
145
- path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
145
+ path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}"
146
146
 
147
147
  meter(rate_limit).get(path)
148
148
  end
@@ -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_report_document(report_document_id, rate_limit: 0.0167)
157
- path = "/reports/2021-06-30/documents/#{report_document_id}"
157
+ path = "/reports/2021-06-30/documents/#{percent_encode(report_document_id)}"
158
158
 
159
159
  meter(rate_limit).get(path)
160
160
  end
@@ -53,13 +53,17 @@ module Peddler
53
53
  # @param sku [String] Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an
54
54
  # error. Do not include this filter if you want the response to include order metrics for all SKUs. Example:
55
55
  # TestSKU, if you want the response to include order metrics for only SKU TestSKU.
56
+ # @param amazon_program [String] Filters the results by the Amazon program that you specify. Do not include this
57
+ # filter if you want the response to include order metrics for all programs. **Example:** `AmazonHaul` returns
58
+ # order metrics for the Amazon Haul program only.
56
59
  # @param rate_limit [Float] Requests per second
57
60
  # @return [Peddler::Response] The API response
58
61
  def get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All",
59
- fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5)
62
+ fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, amazon_program: nil,
63
+ rate_limit: 0.5)
60
64
  path = "/sales/v1/orderMetrics"
61
65
  params = {
62
- "marketplaceIds" => marketplace_ids,
66
+ "marketplaceIds" => stringify_array(marketplace_ids),
63
67
  "interval" => interval,
64
68
  "granularityTimeZone" => granularity_time_zone,
65
69
  "granularity" => granularity,
@@ -68,6 +72,7 @@ module Peddler
68
72
  "firstDayOfWeek" => first_day_of_week,
69
73
  "asin" => asin,
70
74
  "sku" => sku,
75
+ "amazonProgram" => amazon_program,
71
76
  }.compact
72
77
 
73
78
  meter(rate_limit).get(path, params:)
@@ -38,7 +38,7 @@ module Peddler
38
38
  # @param account_id [String] The ID of the Amazon Seller Wallet account.
39
39
  # @return [Peddler::Response] The API response
40
40
  def get_account(account_id)
41
- path = "/finances/transfers/wallet/2024-03-01/accounts/#{account_id}"
41
+ path = "/finances/transfers/wallet/2024-03-01/accounts/#{percent_encode(account_id)}"
42
42
 
43
43
  get(path)
44
44
  end
@@ -49,7 +49,7 @@ module Peddler
49
49
  # @param account_id [String] The ID of the Amazon Seller Wallet account.
50
50
  # @return [Peddler::Response] The API response
51
51
  def list_account_balances(account_id)
52
- path = "/finances/transfers/wallet/2024-03-01/accounts/#{account_id}/balance"
52
+ path = "/finances/transfers/wallet/2024-03-01/accounts/#{percent_encode(account_id)}/balance"
53
53
 
54
54
  get(path)
55
55
  end
@@ -116,7 +116,7 @@ module Peddler
116
116
  # @param transaction_id [String] The ID of the Amazon Seller Wallet transaction.
117
117
  # @return [Peddler::Response] The API response
118
118
  def get_transaction(transaction_id)
119
- path = "/finances/transfers/wallet/2024-03-01/transactions/#{transaction_id}"
119
+ path = "/finances/transfers/wallet/2024-03-01/transactions/#{percent_encode(transaction_id)}"
120
120
 
121
121
  get(path)
122
122
  end
@@ -174,7 +174,7 @@ module Peddler
174
174
  # @param transfer_schedule_id [String] The schedule ID of the Amazon Seller Wallet transfer.
175
175
  # @return [Peddler::Response] The API response
176
176
  def get_transfer_schedule(transfer_schedule_id)
177
- path = "/finances/transfers/wallet/2024-03-01/transferSchedules/#{transfer_schedule_id}"
177
+ path = "/finances/transfers/wallet/2024-03-01/transferSchedules/#{percent_encode(transfer_schedule_id)}"
178
178
 
179
179
  get(path)
180
180
  end
@@ -186,7 +186,7 @@ module Peddler
186
186
  # @param transfer_schedule_id [String] A unique reference ID for a scheduled transfer.
187
187
  # @return [Peddler::Response] The API response
188
188
  def delete_schedule_transaction(transfer_schedule_id)
189
- path = "/finances/transfers/wallet/2024-03-01/transferSchedules/#{transfer_schedule_id}"
189
+ path = "/finances/transfers/wallet/2024-03-01/transferSchedules/#{percent_encode(transfer_schedule_id)}"
190
190
 
191
191
  delete(path)
192
192
  end
@@ -22,7 +22,7 @@ module Peddler
22
22
  # @param rate_limit [Float] Requests per second
23
23
  # @return [Peddler::Response] The API response
24
24
  def get_service_job_by_service_job_id(service_job_id, rate_limit: 20.0)
25
- path = "/service/v1/serviceJobs/#{service_job_id}"
25
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}"
26
26
 
27
27
  meter(rate_limit).get(path)
28
28
  end
@@ -36,7 +36,7 @@ module Peddler
36
36
  # @param rate_limit [Float] Requests per second
37
37
  # @return [Peddler::Response] The API response
38
38
  def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code, rate_limit: 5.0)
39
- path = "/service/v1/serviceJobs/#{service_job_id}/cancellations"
39
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/cancellations"
40
40
  params = {
41
41
  "cancellationReasonCode" => cancellation_reason_code,
42
42
  }.compact
@@ -51,7 +51,7 @@ module Peddler
51
51
  # @param rate_limit [Float] Requests per second
52
52
  # @return [Peddler::Response] The API response
53
53
  def complete_service_job_by_service_job_id(service_job_id, rate_limit: 5.0)
54
- path = "/service/v1/serviceJobs/#{service_job_id}/completions"
54
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/completions"
55
55
 
56
56
  meter(rate_limit).put(path)
57
57
  end
@@ -97,8 +97,8 @@ module Peddler
97
97
  required_skills: nil, store_ids: nil, rate_limit: 10.0)
98
98
  path = "/service/v1/serviceJobs"
99
99
  params = {
100
- "serviceOrderIds" => service_order_ids,
101
- "serviceJobStatus" => service_job_status,
100
+ "serviceOrderIds" => stringify_array(service_order_ids),
101
+ "serviceJobStatus" => stringify_array(service_job_status),
102
102
  "pageToken" => page_token,
103
103
  "pageSize" => page_size,
104
104
  "sortField" => sort_field,
@@ -109,10 +109,10 @@ module Peddler
109
109
  "lastUpdatedBefore" => last_updated_before,
110
110
  "scheduleStartDate" => schedule_start_date,
111
111
  "scheduleEndDate" => schedule_end_date,
112
- "marketplaceIds" => marketplace_ids,
113
- "asins" => asins,
114
- "requiredSkills" => required_skills,
115
- "storeIds" => store_ids,
112
+ "marketplaceIds" => stringify_array(marketplace_ids),
113
+ "asins" => stringify_array(asins),
114
+ "requiredSkills" => stringify_array(required_skills),
115
+ "storeIds" => stringify_array(store_ids),
116
116
  }.compact
117
117
 
118
118
  meter(rate_limit).get(path, params:)
@@ -126,7 +126,7 @@ module Peddler
126
126
  # @param rate_limit [Float] Requests per second
127
127
  # @return [Peddler::Response] The API response
128
128
  def add_appointment_for_service_job_by_service_job_id(service_job_id, body, rate_limit: 5.0)
129
- path = "/service/v1/serviceJobs/#{service_job_id}/appointments"
129
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/appointments"
130
130
 
131
131
  meter(rate_limit).post(path, body:)
132
132
  end
@@ -141,7 +141,7 @@ module Peddler
141
141
  # @return [Peddler::Response] The API response
142
142
  def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, appointment_id, body,
143
143
  rate_limit: 5.0)
144
- path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}"
144
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/appointments/#{percent_encode(appointment_id)}"
145
145
 
146
146
  meter(rate_limit).post(path, body:)
147
147
  end
@@ -156,7 +156,7 @@ module Peddler
156
156
  # @param rate_limit [Float] Requests per second
157
157
  # @return [Peddler::Response] The API response
158
158
  def assign_appointment_resources(service_job_id, appointment_id, body, rate_limit: 1.0)
159
- path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/resources"
159
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/appointments/#{percent_encode(appointment_id)}/resources"
160
160
 
161
161
  meter(rate_limit).put(path, body:)
162
162
  end
@@ -171,7 +171,7 @@ module Peddler
171
171
  # @param rate_limit [Float] Requests per second
172
172
  # @return [Peddler::Response] The API response
173
173
  def set_appointment_fulfillment_data(service_job_id, appointment_id, body, rate_limit: 5.0)
174
- path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/fulfillment"
174
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/appointments/#{percent_encode(appointment_id)}/fulfillment"
175
175
 
176
176
  meter(rate_limit).put(path, body:)
177
177
  end
@@ -186,9 +186,9 @@ module Peddler
186
186
  # @param rate_limit [Float] Requests per second
187
187
  # @return [Peddler::Response] The API response
188
188
  def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
189
- path = "/service/v1/serviceResources/#{resource_id}/capacity/range"
189
+ path = "/service/v1/serviceResources/#{percent_encode(resource_id)}/capacity/range"
190
190
  params = {
191
- "marketplaceIds" => marketplace_ids,
191
+ "marketplaceIds" => stringify_array(marketplace_ids),
192
192
  "nextPageToken" => next_page_token,
193
193
  }.compact
194
194
 
@@ -205,9 +205,9 @@ module Peddler
205
205
  # @param rate_limit [Float] Requests per second
206
206
  # @return [Peddler::Response] The API response
207
207
  def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
208
- path = "/service/v1/serviceResources/#{resource_id}/capacity/fixed"
208
+ path = "/service/v1/serviceResources/#{percent_encode(resource_id)}/capacity/fixed"
209
209
  params = {
210
- "marketplaceIds" => marketplace_ids,
210
+ "marketplaceIds" => stringify_array(marketplace_ids),
211
211
  "nextPageToken" => next_page_token,
212
212
  }.compact
213
213
 
@@ -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 update_schedule(resource_id, body, marketplace_ids, rate_limit: 5.0)
226
- path = "/service/v1/serviceResources/#{resource_id}/schedules"
226
+ path = "/service/v1/serviceResources/#{percent_encode(resource_id)}/schedules"
227
227
  params = {
228
- "marketplaceIds" => marketplace_ids,
228
+ "marketplaceIds" => stringify_array(marketplace_ids),
229
229
  }.compact
230
230
 
231
231
  meter(rate_limit).put(path, body:, params:)
@@ -241,7 +241,7 @@ module Peddler
241
241
  def create_reservation(body, marketplace_ids, rate_limit: 5.0)
242
242
  path = "/service/v1/reservation"
243
243
  params = {
244
- "marketplaceIds" => marketplace_ids,
244
+ "marketplaceIds" => stringify_array(marketplace_ids),
245
245
  }.compact
246
246
 
247
247
  meter(rate_limit).post(path, body:, params:)
@@ -256,9 +256,9 @@ module Peddler
256
256
  # @param rate_limit [Float] Requests per second
257
257
  # @return [Peddler::Response] The API response
258
258
  def update_reservation(reservation_id, body, marketplace_ids, rate_limit: 5.0)
259
- path = "/service/v1/reservation/#{reservation_id}"
259
+ path = "/service/v1/reservation/#{percent_encode(reservation_id)}"
260
260
  params = {
261
- "marketplaceIds" => marketplace_ids,
261
+ "marketplaceIds" => stringify_array(marketplace_ids),
262
262
  }.compact
263
263
 
264
264
  meter(rate_limit).put(path, body:, params:)
@@ -272,9 +272,9 @@ module Peddler
272
272
  # @param rate_limit [Float] Requests per second
273
273
  # @return [Peddler::Response] The API response
274
274
  def cancel_reservation(reservation_id, marketplace_ids, rate_limit: 5.0)
275
- path = "/service/v1/reservation/#{reservation_id}"
275
+ path = "/service/v1/reservation/#{percent_encode(reservation_id)}"
276
276
  params = {
277
- "marketplaceIds" => marketplace_ids,
277
+ "marketplaceIds" => stringify_array(marketplace_ids),
278
278
  }.compact
279
279
 
280
280
  meter(rate_limit).delete(path, params:)
@@ -295,9 +295,9 @@ module Peddler
295
295
  # @return [Peddler::Response] The API response
296
296
  def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time: nil, end_time: nil,
297
297
  rate_limit: 5.0)
298
- path = "/service/v1/serviceJobs/#{service_job_id}/appointmentSlots"
298
+ path = "/service/v1/serviceJobs/#{percent_encode(service_job_id)}/appointmentSlots"
299
299
  params = {
300
- "marketplaceIds" => marketplace_ids,
300
+ "marketplaceIds" => stringify_array(marketplace_ids),
301
301
  "startTime" => start_time,
302
302
  "endTime" => end_time,
303
303
  }.compact
@@ -324,7 +324,7 @@ module Peddler
324
324
  params = {
325
325
  "asin" => asin,
326
326
  "storeId" => store_id,
327
- "marketplaceIds" => marketplace_ids,
327
+ "marketplaceIds" => stringify_array(marketplace_ids),
328
328
  "startTime" => start_time,
329
329
  "endTime" => end_time,
330
330
  }.compact
@@ -25,7 +25,7 @@ module Peddler
25
25
  # @param rate_limit [Float] Requests per second
26
26
  # @return [Peddler::Response] The API response
27
27
  def get_shipment_details(shipment_id, rate_limit: 1.133)
28
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}"
28
+ path = "/fba/outbound/brazil/v0/shipments/#{percent_encode(shipment_id)}"
29
29
 
30
30
  meter(rate_limit).get(path)
31
31
  end
@@ -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 submit_invoice(shipment_id, body, rate_limit: 1.133)
41
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice"
41
+ path = "/fba/outbound/brazil/v0/shipments/#{percent_encode(shipment_id)}/invoice"
42
42
 
43
43
  meter(rate_limit).post(path, body:)
44
44
  end
@@ -50,7 +50,7 @@ module Peddler
50
50
  # @param rate_limit [Float] Requests per second
51
51
  # @return [Peddler::Response] The API response
52
52
  def get_invoice_status(shipment_id, rate_limit: 1.133)
53
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice/status"
53
+ path = "/fba/outbound/brazil/v0/shipments/#{percent_encode(shipment_id)}/invoice/status"
54
54
 
55
55
  meter(rate_limit).get(path)
56
56
  end
@@ -37,7 +37,7 @@ module Peddler
37
37
  # @param rate_limit [Float] Requests per second
38
38
  # @return [Peddler::Response] The API response
39
39
  def get_shipment(shipment_id, rate_limit: 5.0)
40
- path = "/shipping/v1/shipments/#{shipment_id}"
40
+ path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}"
41
41
 
42
42
  meter(rate_limit).get(path)
43
43
  end
@@ -49,7 +49,7 @@ module Peddler
49
49
  # @param rate_limit [Float] Requests per second
50
50
  # @return [Peddler::Response] The API response
51
51
  def cancel_shipment(shipment_id, rate_limit: 5.0)
52
- path = "/shipping/v1/shipments/#{shipment_id}/cancel"
52
+ path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/cancel"
53
53
 
54
54
  meter(rate_limit).post(path)
55
55
  end
@@ -62,7 +62,7 @@ module Peddler
62
62
  # @param rate_limit [Float] Requests per second
63
63
  # @return [Peddler::Response] The API response
64
64
  def purchase_labels(shipment_id, body, rate_limit: 5.0)
65
- path = "/shipping/v1/shipments/#{shipment_id}/purchaseLabels"
65
+ path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/purchaseLabels"
66
66
 
67
67
  meter(rate_limit).post(path, body:)
68
68
  end
@@ -76,7 +76,7 @@ module Peddler
76
76
  # @param rate_limit [Float] Requests per second
77
77
  # @return [Peddler::Response] The API response
78
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"
79
+ path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/containers/#{percent_encode(tracking_id)}/label"
80
80
 
81
81
  meter(rate_limit).post(path, body:)
82
82
  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_tracking_information(tracking_id, rate_limit: 1.0)
126
- path = "/shipping/v1/tracking/#{tracking_id}"
126
+ path = "/shipping/v1/tracking/#{percent_encode(tracking_id)}"
127
127
 
128
128
  meter(rate_limit).get(path)
129
129
  end
@@ -121,7 +121,7 @@ module Peddler
121
121
  # @return [Peddler::Response] The API response
122
122
  def get_shipment_documents(shipment_id, package_client_reference_id, format: nil, dpi: nil,
123
123
  x_amzn_shipping_business_id: nil, rate_limit: 80.0)
124
- path = "/shipping/v2/shipments/#{shipment_id}/documents"
124
+ path = "/shipping/v2/shipments/#{percent_encode(shipment_id)}/documents"
125
125
  params = {
126
126
  "packageClientReferenceId" => package_client_reference_id,
127
127
  "format" => format,
@@ -140,7 +140,7 @@ module Peddler
140
140
  # @param rate_limit [Float] Requests per second
141
141
  # @return [Peddler::Response] The API response
142
142
  def cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
143
- path = "/shipping/v2/shipments/#{shipment_id}/cancel"
143
+ path = "/shipping/v2/shipments/#{percent_encode(shipment_id)}/cancel"
144
144
 
145
145
  meter(rate_limit).put(path)
146
146
  end
@@ -206,7 +206,7 @@ module Peddler
206
206
  # @param rate_limit [Float] Requests per second
207
207
  # @return [Peddler::Response] The API response
208
208
  def link_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 5.0)
209
- path = "/shipping/v2/carrierAccounts/#{carrier_id}"
209
+ path = "/shipping/v2/carrierAccounts/#{percent_encode(carrier_id)}"
210
210
 
211
211
  meter(rate_limit).post(path, body:)
212
212
  end
@@ -222,7 +222,7 @@ module Peddler
222
222
  def unlink_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
223
223
  cannot_sandbox!
224
224
 
225
- path = "/shipping/v2/carrierAccounts/#{carrier_id}/unlink"
225
+ path = "/shipping/v2/carrierAccounts/#{percent_encode(carrier_id)}/unlink"
226
226
 
227
227
  meter(rate_limit).put(path, body:)
228
228
  end
@@ -286,7 +286,7 @@ module Peddler
286
286
  def get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
287
287
  cannot_sandbox!
288
288
 
289
- path = "/shipping/v2/collectionForms/#{collection_form_id}"
289
+ path = "/shipping/v2/collectionForms/#{percent_encode(collection_form_id)}"
290
290
 
291
291
  meter(rate_limit).get(path)
292
292
  end
@@ -305,7 +305,7 @@ module Peddler
305
305
  rate_limit: 80.0)
306
306
  path = "/shipping/v2/accessPoints"
307
307
  params = {
308
- "accessPointTypes" => access_point_types,
308
+ "accessPointTypes" => stringify_array(access_point_types),
309
309
  "countryCode" => country_code,
310
310
  "postalCode" => postal_code,
311
311
  }.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 get_solicitation_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
35
- path = "/solicitations/v1/orders/#{amazon_order_id}"
35
+ path = "/solicitations/v1/orders/#{percent_encode(amazon_order_id)}"
36
36
  params = {
37
- "marketplaceIds" => marketplace_ids,
37
+ "marketplaceIds" => stringify_array(marketplace_ids),
38
38
  }.compact
39
39
 
40
40
  meter(rate_limit).get(path, params:)
@@ -51,9 +51,9 @@ module Peddler
51
51
  # @param rate_limit [Float] Requests per second
52
52
  # @return [Peddler::Response] The API response
53
53
  def create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids, rate_limit: 1.0)
54
- path = "/solicitations/v1/orders/#{amazon_order_id}/solicitations/productReviewAndSellerFeedback"
54
+ path = "/solicitations/v1/orders/#{percent_encode(amazon_order_id)}/solicitations/productReviewAndSellerFeedback"
55
55
  params = {
56
- "marketplaceIds" => marketplace_ids,
56
+ "marketplaceIds" => stringify_array(marketplace_ids),
57
57
  }.compact
58
58
 
59
59
  meter(rate_limit).post(path, params:)
@@ -48,7 +48,7 @@ module Peddler
48
48
  # @param supply_source_id [String] The unique identifier of a supply source.
49
49
  # @return [Peddler::Response] The API response
50
50
  def get_supply_source(supply_source_id)
51
- path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
51
+ path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
52
52
 
53
53
  get(path)
54
54
  end
@@ -60,7 +60,7 @@ module Peddler
60
60
  # @param payload [Hash]
61
61
  # @return [Peddler::Response] The API response
62
62
  def update_supply_source(supply_source_id, payload: nil)
63
- path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
63
+ path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
64
64
  body = payload
65
65
 
66
66
  put(path, body:)
@@ -72,7 +72,7 @@ module Peddler
72
72
  # @param supply_source_id [String] The unique identifier of a supply source.
73
73
  # @return [Peddler::Response] The API response
74
74
  def archive_supply_source(supply_source_id)
75
- path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
75
+ path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
76
76
 
77
77
  delete(path)
78
78
  end
@@ -84,7 +84,7 @@ module Peddler
84
84
  # @param payload [Hash]
85
85
  # @return [Peddler::Response] The API response
86
86
  def update_supply_source_status(supply_source_id, payload: nil)
87
- path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}/status"
87
+ path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}/status"
88
88
  body = payload
89
89
 
90
90
  put(path, body:)
@@ -37,9 +37,9 @@ module Peddler
37
37
  rate_limit: 10.0)
38
38
  cannot_sandbox!
39
39
 
40
- path = "/uploads/2020-11-01/uploadDestinations/#{resource}"
40
+ path = "/uploads/2020-11-01/uploadDestinations/#{percent_encode(resource)}"
41
41
  params = {
42
- "marketplaceIds" => marketplace_ids,
42
+ "marketplaceIds" => stringify_array(marketplace_ids),
43
43
  "contentMD5" => content_md5,
44
44
  "contentType" => content_type,
45
45
  }.compact
@@ -23,7 +23,7 @@ module Peddler
23
23
  # @param rate_limit [Float] Requests per second
24
24
  # @return [Peddler::Response] The API response
25
25
  def submit_inventory_update(body, warehouse_id, rate_limit: 10.0)
26
- path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items"
26
+ path = "/vendor/directFulfillment/inventory/v1/warehouses/#{percent_encode(warehouse_id)}/items"
27
27
 
28
28
  meter(rate_limit).post(path, body:)
29
29
  end
@@ -63,7 +63,7 @@ module Peddler
63
63
  # @param rate_limit [Float] Requests per second
64
64
  # @return [Peddler::Response] The API response
65
65
  def get_order(purchase_order_number, rate_limit: 10.0)
66
- path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"
66
+ path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{percent_encode(purchase_order_number)}"
67
67
 
68
68
  meter(rate_limit).get(path)
69
69
  end
@@ -63,7 +63,7 @@ module Peddler
63
63
  # @param rate_limit [Float] Requests per second
64
64
  # @return [Peddler::Response] The API response
65
65
  def get_order(purchase_order_number, rate_limit: 10.0)
66
- path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{purchase_order_number}"
66
+ path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{percent_encode(purchase_order_number)}"
67
67
 
68
68
  meter(rate_limit).get(path)
69
69
  end
@@ -34,7 +34,7 @@ module Peddler
34
34
  # operation.
35
35
  # @return [Peddler::Response] The API response
36
36
  def get_order_scenarios(transaction_id)
37
- path = "/vendor/directFulfillment/sandbox/2021-10-28/transactions/#{transaction_id}"
37
+ path = "/vendor/directFulfillment/sandbox/2021-10-28/transactions/#{percent_encode(transaction_id)}"
38
38
 
39
39
  get(path)
40
40
  end