peddler 5.0.0 → 5.1.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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -6
  3. data/lib/peddler/acronyms.rb +1 -0
  4. data/lib/peddler/api.rb +35 -62
  5. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +11 -11
  6. data/lib/peddler/apis/aplus_content_2020_11_01.rb +10 -10
  7. data/lib/peddler/apis/application_integrations_2024_04_01.rb +3 -3
  8. data/lib/peddler/apis/application_management_2023_11_30.rb +1 -1
  9. data/lib/peddler/apis/catalog_items_2020_12_01.rb +2 -2
  10. data/lib/peddler/apis/catalog_items_2022_04_01.rb +2 -2
  11. data/lib/peddler/apis/catalog_items_v0.rb +1 -1
  12. data/lib/peddler/apis/data_kiosk_2023_11_15.rb +5 -5
  13. data/lib/peddler/apis/delivery_by_amazon_2022_07_01/error.rb +23 -0
  14. data/lib/peddler/apis/delivery_by_amazon_2022_07_01/error_list.rb +18 -0
  15. data/lib/peddler/apis/delivery_by_amazon_2022_07_01/get_invoice_status_response.rb +26 -0
  16. data/lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_request.rb +31 -0
  17. data/lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_response.rb +17 -0
  18. data/lib/peddler/apis/delivery_by_amazon_2022_07_01.rb +59 -0
  19. data/lib/peddler/apis/easy_ship_2022_03_23.rb +5 -5
  20. data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment.rb +3 -0
  21. data/lib/peddler/apis/fba_inbound_eligibility_v1.rb +1 -1
  22. data/lib/peddler/apis/fba_inventory_v1.rb +1 -1
  23. data/lib/peddler/apis/feeds_2021_06_30.rb +6 -6
  24. data/lib/peddler/apis/finances_2024_06_19/amazon_pay_context.rb +2 -2
  25. data/lib/peddler/apis/finances_2024_06_19/breakdown.rb +3 -4
  26. data/lib/peddler/apis/finances_2024_06_19/context.rb +11 -11
  27. data/lib/peddler/apis/finances_2024_06_19/contexts.rb +1 -1
  28. data/lib/peddler/apis/finances_2024_06_19/deferred_context.rb +1 -1
  29. data/lib/peddler/apis/finances_2024_06_19/error.rb +1 -1
  30. data/lib/peddler/apis/finances_2024_06_19/error_list.rb +1 -1
  31. data/lib/peddler/apis/finances_2024_06_19/item.rb +3 -3
  32. data/lib/peddler/apis/finances_2024_06_19/item_related_identifier.rb +1 -1
  33. data/lib/peddler/apis/finances_2024_06_19/item_related_identifiers.rb +1 -1
  34. data/lib/peddler/apis/finances_2024_06_19/items.rb +1 -1
  35. data/lib/peddler/apis/finances_2024_06_19/marketplace_details.rb +2 -3
  36. data/lib/peddler/apis/finances_2024_06_19/payments_context.rb +5 -5
  37. data/lib/peddler/apis/finances_2024_06_19/product_context.rb +4 -4
  38. data/lib/peddler/apis/finances_2024_06_19/related_identifier.rb +2 -2
  39. data/lib/peddler/apis/finances_2024_06_19/selling_partner_metadata.rb +3 -3
  40. data/lib/peddler/apis/finances_2024_06_19/time_range_context.rb +3 -3
  41. data/lib/peddler/apis/finances_2024_06_19/transaction.rb +8 -10
  42. data/lib/peddler/apis/finances_2024_06_19/transactions.rb +1 -1
  43. data/lib/peddler/apis/finances_2024_06_19/transactions_payload.rb +4 -2
  44. data/lib/peddler/apis/finances_2024_06_19.rb +24 -13
  45. data/lib/peddler/apis/finances_v0/adhoc_disbursement_event.rb +1 -3
  46. data/lib/peddler/apis/finances_v0/adjustment_event.rb +11 -18
  47. data/lib/peddler/apis/finances_v0/adjustment_item.rb +3 -3
  48. data/lib/peddler/apis/finances_v0/affordability_expense_event.rb +6 -7
  49. data/lib/peddler/apis/finances_v0/capacity_reservation_billing_event.rb +1 -1
  50. data/lib/peddler/apis/finances_v0/charge_component.rb +37 -35
  51. data/lib/peddler/apis/finances_v0/charge_refund_event.rb +2 -6
  52. data/lib/peddler/apis/finances_v0/coupon_payment_event.rb +1 -1
  53. data/lib/peddler/apis/finances_v0/debt_recovery_event.rb +1 -5
  54. data/lib/peddler/apis/finances_v0/debt_recovery_item.rb +4 -4
  55. data/lib/peddler/apis/finances_v0/direct_payment.rb +7 -7
  56. data/lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event.rb +23 -0
  57. data/lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event_list.rb +18 -0
  58. data/lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event.rb +3 -9
  59. data/lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event_list.rb +1 -1
  60. data/lib/peddler/apis/finances_v0/fba_liquidation_event.rb +1 -1
  61. data/lib/peddler/apis/finances_v0/financial_event_group.rb +5 -7
  62. data/lib/peddler/apis/finances_v0/financial_events.rb +4 -1
  63. data/lib/peddler/apis/finances_v0/list_financial_event_groups_payload.rb +1 -1
  64. data/lib/peddler/apis/finances_v0/list_financial_event_groups_response.rb +3 -3
  65. data/lib/peddler/apis/finances_v0/list_financial_events_payload.rb +1 -1
  66. data/lib/peddler/apis/finances_v0/list_financial_events_response.rb +3 -3
  67. data/lib/peddler/apis/finances_v0/loan_servicing_event.rb +3 -3
  68. data/lib/peddler/apis/finances_v0/network_commingling_transaction_event.rb +3 -3
  69. data/lib/peddler/apis/finances_v0/pay_with_amazon_event.rb +5 -5
  70. data/lib/peddler/apis/finances_v0/product_ads_payment_event.rb +4 -4
  71. data/lib/peddler/apis/finances_v0/removal_shipment_adjustment_event.rb +2 -2
  72. data/lib/peddler/apis/finances_v0/removal_shipment_adjustment_event_list.rb +1 -1
  73. data/lib/peddler/apis/finances_v0/removal_shipment_event.rb +2 -2
  74. data/lib/peddler/apis/finances_v0/removal_shipment_item.rb +5 -6
  75. data/lib/peddler/apis/finances_v0/removal_shipment_item_adjustment.rb +8 -9
  76. data/lib/peddler/apis/finances_v0/removal_shipment_item_list.rb +1 -1
  77. data/lib/peddler/apis/finances_v0/rental_transaction_event.rb +17 -16
  78. data/lib/peddler/apis/finances_v0/retrocharge_event.rb +2 -2
  79. data/lib/peddler/apis/finances_v0/retrocharge_event_list.rb +1 -1
  80. data/lib/peddler/apis/finances_v0/safet_reimbursement_event_list.rb +1 -1
  81. data/lib/peddler/apis/finances_v0/safet_reimbursement_item_list.rb +1 -1
  82. data/lib/peddler/apis/finances_v0/seller_deal_payment_event.rb +2 -2
  83. data/lib/peddler/apis/finances_v0/seller_review_enrollment_payment_event.rb +1 -1
  84. data/lib/peddler/apis/finances_v0/solution_provider_credit_event.rb +1 -1
  85. data/lib/peddler/apis/finances_v0/solution_provider_credit_event_list.rb +1 -1
  86. data/lib/peddler/apis/finances_v0/tax_withheld_component.rb +2 -3
  87. data/lib/peddler/apis/finances_v0/tax_withholding_event.rb +1 -1
  88. data/lib/peddler/apis/finances_v0/tax_withholding_event_list.rb +1 -1
  89. data/lib/peddler/apis/finances_v0/tax_withholding_period.rb +1 -1
  90. data/lib/peddler/apis/finances_v0/value_added_service_charge_event.rb +1 -3
  91. data/lib/peddler/apis/finances_v0.rb +60 -47
  92. data/lib/peddler/apis/fulfillment_inbound_2024_03_20/delivery_window_option.rb +2 -1
  93. data/lib/peddler/apis/fulfillment_inbound_2024_03_20/selected_delivery_window.rb +2 -1
  94. data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +90 -142
  95. data/lib/peddler/apis/fulfillment_inbound_v0.rb +6 -6
  96. data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +14 -17
  97. data/lib/peddler/apis/invoices_2024_06_19.rb +7 -7
  98. data/lib/peddler/apis/listings_items_2020_09_01.rb +3 -3
  99. data/lib/peddler/apis/listings_items_2021_08_01.rb +5 -5
  100. data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +1 -1
  101. data/lib/peddler/apis/merchant_fulfillment_v0.rb +5 -5
  102. data/lib/peddler/apis/messaging_v1.rb +11 -11
  103. data/lib/peddler/apis/notifications_v1.rb +8 -8
  104. data/lib/peddler/apis/orders_v0/buyer_info.rb +0 -3
  105. data/lib/peddler/apis/orders_v0/order_buyer_info.rb +0 -3
  106. data/lib/peddler/apis/orders_v0.rb +12 -15
  107. data/lib/peddler/apis/product_fees_v0.rb +3 -3
  108. data/lib/peddler/apis/product_pricing_2022_05_01.rb +2 -2
  109. data/lib/peddler/apis/product_pricing_v0.rb +6 -6
  110. data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +2 -2
  111. data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_response_metric.rb +66 -22
  112. data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_response_offer.rb +13 -13
  113. data/lib/peddler/apis/replenishment_2022_11_07.rb +3 -3
  114. data/lib/peddler/apis/reports_2021_06_30.rb +9 -9
  115. data/lib/peddler/apis/sales_v1.rb +1 -1
  116. data/lib/peddler/apis/seller_wallet_2024_03_01/bank_account.rb +23 -18
  117. data/lib/peddler/apis/seller_wallet_2024_03_01/payee_contact_information.rb +54 -0
  118. data/lib/peddler/apis/seller_wallet_2024_03_01/transaction.rb +7 -3
  119. data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_initiation_request.rb +3 -3
  120. data/lib/peddler/apis/seller_wallet_2024_03_01.rb +7 -2
  121. data/lib/peddler/apis/sellers_v1.rb +2 -2
  122. data/lib/peddler/apis/services_v1.rb +17 -17
  123. data/lib/peddler/apis/shipment_invoicing_v0.rb +3 -3
  124. data/lib/peddler/apis/shipping_v1.rb +9 -9
  125. data/lib/peddler/apis/shipping_v2.rb +19 -19
  126. data/lib/peddler/apis/solicitations_v1.rb +2 -2
  127. data/lib/peddler/apis/tokens_2021_03_01.rb +1 -1
  128. data/lib/peddler/apis/transfers_2024_06_01.rb +2 -2
  129. data/lib/peddler/apis/uploads_2020_11_01.rb +1 -1
  130. data/lib/peddler/apis/vendor_direct_fulfillment_inventory_v1.rb +1 -1
  131. data/lib/peddler/apis/vendor_direct_fulfillment_orders_2021_12_28.rb +3 -3
  132. data/lib/peddler/apis/vendor_direct_fulfillment_orders_v1.rb +3 -3
  133. data/lib/peddler/apis/vendor_direct_fulfillment_payments_v1.rb +1 -1
  134. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +11 -11
  135. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +9 -9
  136. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_2021_12_28.rb +1 -1
  137. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_v1.rb +1 -1
  138. data/lib/peddler/apis/vendor_invoices_v1.rb +1 -1
  139. data/lib/peddler/apis/vendor_orders_v1.rb +4 -4
  140. data/lib/peddler/apis/vendor_shipments_v1/package_item_details.rb +16 -0
  141. data/lib/peddler/apis/vendor_shipments_v1/regulation_references.rb +32 -0
  142. data/lib/peddler/apis/vendor_shipments_v1.rb +5 -5
  143. data/lib/peddler/apis/vendor_transaction_status_v1.rb +1 -1
  144. data/lib/peddler/data_kiosk/economics20240315/analytics_economics20240315.rb +5 -0
  145. data/lib/peddler/data_kiosk/economics20240315.json +340 -7
  146. data/lib/peddler/data_kiosk/vendor_analytics20240930/traffic.rb +5 -0
  147. data/lib/peddler/data_kiosk/vendor_analytics20240930.json +12 -0
  148. data/lib/peddler/response.rb +1 -1
  149. data/lib/peddler/version.rb +1 -1
  150. data/lib/peddler.rb +2 -0
  151. data/sig/peddler/api.rbs +13 -23
  152. data/sig/peddler/apis/delivery_by_amazon_2022_07_01.rbs +85 -0
  153. data/sig/peddler/apis/external_fulfillment_shipments_2024_09_11.rbs +8 -7
  154. data/sig/peddler/apis/finances_2024_06_19.rbs +1 -1
  155. data/sig/peddler/apis/finances_v0.rbs +30 -7
  156. data/sig/peddler/apis/fulfillment_inbound_2024_03_20.rbs +45 -45
  157. data/sig/peddler/apis/fulfillment_outbound_2020_07_01.rbs +1 -1
  158. data/sig/peddler/apis/orders_v0.rbs +15 -17
  159. data/sig/peddler/apis/replenishment_2022_11_07.rbs +18 -7
  160. data/sig/peddler/apis/seller_wallet_2024_03_01.rbs +49 -42
  161. data/sig/peddler/apis/vendor_shipments_v1.rbs +30 -41
  162. data/sig/peddler/data_kiosk/economics20240315.rbs +8 -7
  163. data/sig/peddler/data_kiosk/vendor_analytics20240930.rbs +8 -7
  164. data/sig/peddler.rbs +4 -0
  165. metadata +13 -5
  166. data/lib/peddler/apis/seller_wallet_2024_03_01/account_holder_address.rb +0 -36
  167. data/lib/peddler/apis/vendor_shipments_v1/packed_quantity.rb +0 -25
  168. data/lib/peddler/apis/vendor_shipments_v1/purchase_order_item_details.rb +0 -18
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ module Peddler
6
+ module APIs
7
+ # Selling Partner API for Delivery Shipment Invoicing
8
+ #
9
+ # The Selling Partner API for Delivery Shipment Invoicing helps you programmatically retrieve shipment invoice
10
+ # information in the Brazil marketplace for a selling partner’s orders.
11
+ #
12
+ # @see https://github.com/amzn/selling-partner-api-models/blob/main/models/delivery-by-amazon/deliveryShipmentInvoiceV2022-07-01.json
13
+ class DeliveryByAmazon20220701 < API
14
+ # Submits a shipment invoice for a given order or shipment. You must specify either an `orderId` or `shipmentId`
15
+ # as query parameter. If both parameters are supplied, `orderId` takes precedence over `shipmentId`.
16
+ #
17
+ # @note This operation can make a static sandbox call.
18
+ # @param order_id [String] The identifier for the order.
19
+ # @param shipment_id [String] The identifier for the shipment.
20
+ # @param body [Hash] The request body that specifies invoice, program and marketplace values.
21
+ # @param rate_limit [Float] Requests per second
22
+ # @return [Peddler::Response] The API response
23
+ def submit_invoice(body, order_id: nil, shipment_id: nil, rate_limit: 1.133)
24
+ path = "/delivery/2022-07-01/invoice"
25
+ params = {
26
+ "orderId" => order_id,
27
+ "shipmentId" => shipment_id,
28
+ }.compact
29
+ parser = -> { SubmitInvoiceResponse }
30
+ post(path, body:, params:, rate_limit:, parser:)
31
+ end
32
+
33
+ # Returns the invoice status for the order or shipment you specify. You must specify either an `orderId` or
34
+ # `shipmentId` as query parameter. If both parameters are supplied, `orderId` takes precedence over `shipmentId`.
35
+ #
36
+ # @note This operation can make a static sandbox call.
37
+ # @param order_id [String] The order identifier.
38
+ # @param shipment_id [String] The shipment identifier.
39
+ # @param marketplace_id [String] The marketplace identifier.
40
+ # @param invoice_type [String] The invoice's type.
41
+ # @param program_type [String] The Amazon program that seller is currently enrolled.
42
+ # @param rate_limit [Float] Requests per second
43
+ # @return [Peddler::Response] The API response
44
+ def get_invoice_status(marketplace_id, invoice_type, program_type, order_id: nil, shipment_id: nil,
45
+ rate_limit: 1.133)
46
+ path = "/delivery/2022-07-01/invoice/status"
47
+ params = {
48
+ "orderId" => order_id,
49
+ "shipmentId" => shipment_id,
50
+ "marketplaceId" => marketplace_id,
51
+ "invoiceType" => invoice_type,
52
+ "programType" => program_type,
53
+ }.compact
54
+ parser = -> { GetInvoiceStatusResponse }
55
+ get(path, params:, rate_limit:, parser:)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -35,7 +35,7 @@ module Peddler
35
35
  path = "/easyShip/2022-03-23/timeSlot"
36
36
  body = list_handover_slots_request
37
37
  parser = -> { ListHandoverSlotsResponse }
38
- meter(rate_limit).post(path, body:, parser:)
38
+ post(path, body:, rate_limit:, parser:)
39
39
  end
40
40
 
41
41
  # Returns information about a package, including dimensions, weight, time slot information for handover, invoice
@@ -54,7 +54,7 @@ module Peddler
54
54
  "marketplaceId" => marketplace_id,
55
55
  }.compact
56
56
  parser = -> { Package }
57
- meter(rate_limit).get(path, params:, parser:)
57
+ get(path, params:, rate_limit:, parser:)
58
58
  end
59
59
 
60
60
  # Schedules an Easy Ship order and returns the scheduled package information.
@@ -85,7 +85,7 @@ module Peddler
85
85
  path = "/easyShip/2022-03-23/package"
86
86
  body = create_scheduled_package_request
87
87
  parser = -> { Package }
88
- meter(rate_limit).post(path, body:, parser:)
88
+ post(path, body:, rate_limit:, parser:)
89
89
  end
90
90
 
91
91
  # Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get
@@ -104,7 +104,7 @@ module Peddler
104
104
  path = "/easyShip/2022-03-23/package"
105
105
  body = update_scheduled_packages_request
106
106
  parser = -> { Packages }
107
- meter(rate_limit).patch(path, body:, parser:)
107
+ patch(path, body:, rate_limit:, parser:)
108
108
  end
109
109
 
110
110
  # This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the
@@ -137,7 +137,7 @@ module Peddler
137
137
  path = "/easyShip/2022-03-23/packages/bulk"
138
138
  body = create_scheduled_packages_request
139
139
  parser = -> { CreateScheduledPackagesResponse }
140
- meter(rate_limit).post(path, body:, parser:)
140
+ post(path, body:, rate_limit:, parser:)
141
141
  end
142
142
  end
143
143
  end
@@ -58,6 +58,9 @@ module Peddler
58
58
  # seller. Applicable for direct-fulfillment sellers.
59
59
  attribute?(:party_info_list, [PartyIdentificationInfo], from: "partyInfoList")
60
60
 
61
+ # @return [String] The reason for the sub-status.
62
+ attribute?(:reason, String)
63
+
61
64
  # @return [String] The sub status of the shipment.
62
65
  attribute?(:sub_status, String, from: "subStatus")
63
66
  end
@@ -33,7 +33,7 @@ module Peddler
33
33
  "program" => program,
34
34
  }.compact
35
35
  parser = -> { GetItemEligibilityPreviewResponse }
36
- meter(rate_limit).get(path, params:, parser:)
36
+ get(path, params:, rate_limit:, parser:)
37
37
  end
38
38
  end
39
39
  end
@@ -61,7 +61,7 @@ module Peddler
61
61
  "marketplaceIds" => stringify_array(marketplace_ids),
62
62
  }.compact
63
63
  parser = -> { GetInventorySummariesResponse }
64
- meter(rate_limit).get(path, params:, parser:)
64
+ get(path, params:, rate_limit:, parser:)
65
65
  end
66
66
 
67
67
  # Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a
@@ -45,7 +45,7 @@ module Peddler
45
45
  "nextToken" => next_token,
46
46
  }.compact
47
47
  parser = -> { GetFeedsResponse }
48
- meter(rate_limit).get(path, params:, parser:)
48
+ get(path, params:, rate_limit:, parser:)
49
49
  end
50
50
 
51
51
  # Creates a feed. Upload the contents of the feed document before calling this operation.
@@ -57,7 +57,7 @@ module Peddler
57
57
  def create_feed(body, rate_limit: 0.0083)
58
58
  path = "/feeds/2021-06-30/feeds"
59
59
  parser = -> { CreateFeedResponse }
60
- meter(rate_limit).post(path, body:, parser:)
60
+ post(path, body:, rate_limit:, parser:)
61
61
  end
62
62
 
63
63
  # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds
@@ -71,7 +71,7 @@ module Peddler
71
71
  # @return [Peddler::Response] The API response
72
72
  def cancel_feed(feed_id, rate_limit: 2.0)
73
73
  path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
74
- meter(rate_limit).delete(path)
74
+ delete(path, rate_limit:)
75
75
  end
76
76
 
77
77
  # Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify.
@@ -84,7 +84,7 @@ module Peddler
84
84
  def get_feed(feed_id, rate_limit: 2.0)
85
85
  path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
86
86
  parser = -> { Feed }
87
- meter(rate_limit).get(path, parser:)
87
+ get(path, rate_limit:, parser:)
88
88
  end
89
89
 
90
90
  # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading
@@ -98,7 +98,7 @@ module Peddler
98
98
  def create_feed_document(body, rate_limit: 0.5)
99
99
  path = "/feeds/2021-06-30/documents"
100
100
  parser = -> { CreateFeedDocumentResponse }
101
- meter(rate_limit).post(path, body:, parser:)
101
+ post(path, body:, rate_limit:, parser:)
102
102
  end
103
103
 
104
104
  # Returns the information required for retrieving a feed document's contents.
@@ -110,7 +110,7 @@ module Peddler
110
110
  def get_feed_document(feed_document_id, rate_limit: 0.0222)
111
111
  path = "/feeds/2021-06-30/documents/#{percent_encode(feed_document_id)}"
112
112
  parser = -> { FeedDocument }
113
- meter(rate_limit).get(path, parser:)
113
+ get(path, rate_limit:, parser:)
114
114
  end
115
115
  end
116
116
  end
@@ -12,10 +12,10 @@ module Peddler
12
12
  # @return [String] Channel details of related transaction.
13
13
  attribute?(:channel, String)
14
14
 
15
- # @return [String] Order type of the transaction.
15
+ # @return [String] The transaction's order type.
16
16
  attribute?(:order_type, String, from: "orderType")
17
17
 
18
- # @return [String] Store name related to transaction.
18
+ # @return [String] The name of the store that is related to the transaction.
19
19
  attribute?(:store_name, String, from: "storeName")
20
20
  end
21
21
  end
@@ -7,11 +7,10 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Breakdown provides details regarding the money movement under the financial transaction. Breakdowns get
11
- # categorized further into breakdown types, breakdown amounts, and further breakdowns into a hierarchical
12
- # structure.
10
+ # Details about the movement of money in the financial transaction. Breakdowns are further categorized into
11
+ # breakdown types, breakdown amounts, and further breakdowns.
13
12
  Breakdown = Structure.new do
14
- # @return [Money] The amount of the charge.
13
+ # @return [Money] The monetary amount of the charge.
15
14
  attribute?(:breakdown_amount, Money, from: "breakdownAmount")
16
15
 
17
16
  # @return [String] The type of charge.
@@ -12,7 +12,7 @@ module Peddler
12
12
  # @return [String]
13
13
  attribute(:context_type, String, from: "contextType")
14
14
 
15
- # @return [String] Amazon Standard Identification Number (ASIN) of the item.
15
+ # @return [String] The Amazon Standard Identification Number (ASIN) of the item.
16
16
  attribute?(:asin, String)
17
17
 
18
18
  # @return [String] Channel details of related transaction.
@@ -23,37 +23,37 @@ module Peddler
23
23
  # **Examples:** `B2B` (invoiced orders), `DD7` (delivery date policy)
24
24
  attribute?(:deferral_reason, String, from: "deferralReason")
25
25
 
26
- # @return [String] End time of the transaction.
26
+ # @return [String] The end time of the transaction.
27
27
  attribute?(:end_time, String, from: "endTime")
28
28
 
29
- # @return [String] Fulfillment network of the item.
29
+ # @return [String] The fulfillment network of the item.
30
30
  attribute?(:fulfillment_network, String, from: "fulfillmentNetwork")
31
31
 
32
32
  # @return [String] The release date of the transaction.
33
33
  attribute?(:maturity_date, String, from: "maturityDate")
34
34
 
35
- # @return [String] Order type of the transaction.
35
+ # @return [String] The transaction's order type.
36
36
  attribute?(:order_type, String, from: "orderType")
37
37
 
38
- # @return [String] Date of payment made.
38
+ # @return [String] The date of the payment.
39
39
  attribute?(:payment_date, String, from: "paymentDate")
40
40
 
41
- # @return [String] Method of payment made.
41
+ # @return [String] The method of payment.
42
42
  attribute?(:payment_method, String, from: "paymentMethod")
43
43
 
44
- # @return [String] Reference number of payment made.
44
+ # @return [String] The reference number of the payment.
45
45
  attribute?(:payment_reference, String, from: "paymentReference")
46
46
 
47
- # @return [String] Type of payment made.
47
+ # @return [String] The type of payment.
48
48
  attribute?(:payment_type, String, from: "paymentType")
49
49
 
50
- # @return [Integer] Quantity of the item shipped.
50
+ # @return [Integer] The quantity of the item shipped.
51
51
  attribute?(:quantity_shipped, Integer, from: "quantityShipped")
52
52
 
53
- # @return [String] Stock keeping unit (SKU) of the item.
53
+ # @return [String] The Stock Keeping Unit (SKU) of the item.
54
54
  attribute?(:sku, String)
55
55
 
56
- # @return [String] Start time of the transaction.
56
+ # @return [String] The start time of the transaction.
57
57
  attribute?(:start_time, String, from: "startTime")
58
58
 
59
59
  # @return [String] The store name associated with the transaction.
@@ -5,7 +5,7 @@
5
5
  module Peddler
6
6
  module APIs
7
7
  class Finances20240619
8
- # List of additional Information about the item.
8
+ # A list of additional information about the item.
9
9
  class Contexts < Array
10
10
  class << self
11
11
  def parse(array)
@@ -7,7 +7,7 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Additional information related to Deferred transactions.
10
+ # Additional information related to deferred transactions.
11
11
  DeferredContext = Structure.new do
12
12
  # @return [String] The deferral policy applied to the transaction.
13
13
  #
@@ -7,7 +7,7 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Error response returned when the request is unsuccessful.
10
+ # An error response returned when the request is unsuccessful.
11
11
  Error = Structure.new do
12
12
  # @return [String] An error code that identifies the type of error that occurred.
13
13
  attribute(:code, String)
@@ -9,7 +9,7 @@ module Peddler
9
9
  class Finances20240619
10
10
  # A list of error responses returned when a request is unsuccessful.
11
11
  ErrorList = Structure.new do
12
- # @return [Array<Error>] Error response returned when the request is unsuccessful.
12
+ # @return [Array<Error>] The error responses that are returned when the request is unsuccessful.
13
13
  attribute(:errors, [Error])
14
14
  end
15
15
  end
@@ -7,7 +7,7 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Additional information about the items in Transaction.
10
+ # Additional information about the items in a transaction.
11
11
  Item = Structure.new do
12
12
  # @return [Array<Breakdown>] A list of breakdowns that detail how the total amount is calculated for the
13
13
  # transaction.
@@ -16,13 +16,13 @@ module Peddler
16
16
  # @return [Array<Context>] Additional Information about the item.
17
17
  attribute?(:contexts, [Context])
18
18
 
19
- # @return [String] Description of items in the transaction
19
+ # @return [String] A description of the items in a transaction.
20
20
  attribute?(:description, String)
21
21
 
22
22
  # @return [Array<ItemRelatedIdentifier>] Related business identifiers of the item.
23
23
  attribute?(:related_identifiers, [ItemRelatedIdentifier], from: "relatedIdentifiers")
24
24
 
25
- # @return [Money] The total amount of the item.
25
+ # @return [Money] The total monetary amount of the item.
26
26
  attribute?(:total_amount, Money, from: "totalAmount")
27
27
  end
28
28
  end
@@ -12,7 +12,7 @@ module Peddler
12
12
  # @return [String] Enumerated set of related item identifier names for the item.
13
13
  attribute?(:item_related_identifier_name, String, from: "itemRelatedIdentifierName")
14
14
 
15
- # @return [String] Corresponding value of ItemRelatedIdentifierName
15
+ # @return [String] Corresponding value to `ItemRelatedIdentifierName`.
16
16
  attribute?(:item_related_identifier_value, String, from: "itemRelatedIdentifierValue")
17
17
  end
18
18
  end
@@ -5,7 +5,7 @@
5
5
  module Peddler
6
6
  module APIs
7
7
  class Finances20240619
8
- # Related Business identifiers of the item in Transaction.
8
+ # Related business identifiers of the item in the transaction.
9
9
  class ItemRelatedIdentifiers < Array
10
10
  class << self
11
11
  def parse(array)
@@ -5,7 +5,7 @@
5
5
  module Peddler
6
6
  module APIs
7
7
  class Finances20240619
8
- # List of items in the transaction
8
+ # A list of items in the transaction.
9
9
  class Items < Array
10
10
  class << self
11
11
  def parse(array)
@@ -14,9 +14,8 @@ module Peddler
14
14
  # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
15
15
  attribute?(:marketplace_id, String, from: "marketplaceId")
16
16
 
17
- # @return [String] The name of the marketplace where the transaction occurred.
18
- #
19
- # Example: 'Amazon.com','Amazon.in'
17
+ # @return [String] The name of the marketplace where the transaction occurred. For example:
18
+ # `Amazon.com`,`Amazon.in`
20
19
  attribute?(:marketplace_name, String, from: "marketplaceName")
21
20
  end
22
21
  end
@@ -7,18 +7,18 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Additional information related to Payments related transactions.
10
+ # Additional information related to payments-related transactions.
11
11
  PaymentsContext = Structure.new do
12
- # @return [String] Date of payment made.
12
+ # @return [String] The date of the payment.
13
13
  attribute?(:payment_date, String, from: "paymentDate")
14
14
 
15
- # @return [String] Method of payment made.
15
+ # @return [String] The method of payment.
16
16
  attribute?(:payment_method, String, from: "paymentMethod")
17
17
 
18
- # @return [String] Reference number of payment made.
18
+ # @return [String] The reference number of the payment.
19
19
  attribute?(:payment_reference, String, from: "paymentReference")
20
20
 
21
- # @return [String] Type of payment made.
21
+ # @return [String] The type of payment.
22
22
  attribute?(:payment_type, String, from: "paymentType")
23
23
  end
24
24
  end
@@ -9,16 +9,16 @@ module Peddler
9
9
  class Finances20240619
10
10
  # Additional information related to the product.
11
11
  ProductContext = Structure.new do
12
- # @return [String] Amazon Standard Identification Number (ASIN) of the item.
12
+ # @return [String] The Amazon Standard Identification Number (ASIN) of the item.
13
13
  attribute?(:asin, String)
14
14
 
15
- # @return [String] Fulfillment network of the item.
15
+ # @return [String] The fulfillment network of the item.
16
16
  attribute?(:fulfillment_network, String, from: "fulfillmentNetwork")
17
17
 
18
- # @return [Integer] Quantity of the item shipped.
18
+ # @return [Integer] The quantity of the item shipped.
19
19
  attribute?(:quantity_shipped, Integer, from: "quantityShipped")
20
20
 
21
- # @return [String] Stock keeping unit (SKU) of the item.
21
+ # @return [String] The Stock Keeping Unit (SKU) of the item.
22
22
  attribute?(:sku, String)
23
23
  end
24
24
  end
@@ -9,10 +9,10 @@ module Peddler
9
9
  class Finances20240619
10
10
  # Related business identifier of the transaction.
11
11
  RelatedIdentifier = Structure.new do
12
- # @return [String] Enumerated set of related business identifier names.
12
+ # @return [String] An enumerated set of related business identifier names.
13
13
  attribute?(:related_identifier_name, String, from: "relatedIdentifierName")
14
14
 
15
- # @return [String] Corresponding value of RelatedIdentifierName
15
+ # @return [String] Corresponding value of `RelatedIdentifierName`.
16
16
  attribute?(:related_identifier_value, String, from: "relatedIdentifierValue")
17
17
  end
18
18
  end
@@ -7,9 +7,9 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Metadata describing the seller.
10
+ # Metadata that describes the seller.
11
11
  SellingPartnerMetadata = Structure.new do
12
- # @return [String] Account type of transaction.
12
+ # @return [String] The type of account in the transaction.
13
13
  attribute?(:account_type, String, from: "accountType")
14
14
 
15
15
  # @return [String] The identifier of the marketplace where the transaction occurred. The marketplace ID is the
@@ -17,7 +17,7 @@ module Peddler
17
17
  # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
18
18
  attribute?(:marketplace_id, String, from: "marketplaceId")
19
19
 
20
- # @return [String] Unique seller identifier.
20
+ # @return [String] A unique seller identifier.
21
21
  attribute?(:selling_partner_id, String, from: "sellingPartnerId")
22
22
  end
23
23
  end
@@ -7,12 +7,12 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Additional information related to time range for transaction.
10
+ # Additional information that is related to the time range of the transaction.
11
11
  TimeRangeContext = Structure.new do
12
- # @return [String] End time of the transaction.
12
+ # @return [String] The end time of the transaction.
13
13
  attribute?(:end_time, String, from: "endTime")
14
14
 
15
- # @return [String] Start time of the transaction.
15
+ # @return [String] The start time of the transaction.
16
16
  attribute?(:start_time, String, from: "startTime")
17
17
  end
18
18
  end
@@ -7,7 +7,7 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class Finances20240619
10
- # Contains all information related to the transaction.
10
+ # All the information related to a transaction.
11
11
  Transaction = Structure.new do
12
12
  # @return [Array<Breakdown>] A list of breakdowns that detail how the total amount is calculated for the
13
13
  # transaction.
@@ -18,10 +18,10 @@ module Peddler
18
18
 
19
19
  # @return [String] Describes the reasons for the transaction.
20
20
  #
21
- # Example: 'Order Payment','Refund Order'
21
+ # **Example:** 'Order Payment', 'Refund Order'
22
22
  attribute?(:description, String)
23
23
 
24
- # @return [Array<Item>] Additional information about the items in Transaction.
24
+ # @return [Array<Item>] Additional information about the items in the transaction.
25
25
  attribute?(:items, [Item])
26
26
 
27
27
  # @return [MarketplaceDetails] Information about the marketplace where the transaction occurred.
@@ -30,16 +30,16 @@ module Peddler
30
30
  # @return [String] The date and time when the transaction was posted.
31
31
  attribute?(:posted_date, String, from: "postedDate")
32
32
 
33
- # @return [Array<RelatedIdentifier>] Related business identifiers of the transaction.
33
+ # @return [Array<RelatedIdentifier>] Identifiers related to the transaction, such as order and shipment IDs.
34
34
  attribute?(:related_identifiers, [RelatedIdentifier], from: "relatedIdentifiers")
35
35
 
36
- # @return [SellingPartnerMetadata] Metadata describing the seller.
36
+ # @return [SellingPartnerMetadata] Metadata that describes the seller.
37
37
  attribute?(:selling_partner_metadata, SellingPartnerMetadata, from: "sellingPartnerMetadata")
38
38
 
39
- # @return [Money] Total amount of transaction.
39
+ # @return [Money] The total amount of money in the transaction.
40
40
  attribute?(:total_amount, Money, from: "totalAmount")
41
41
 
42
- # @return [String] The unique identifier for the transaction.
42
+ # @return [String] The unique identifier of the transaction.
43
43
  attribute?(:transaction_id, String, from: "transactionId")
44
44
 
45
45
  # @return [String] The status of the transaction.
@@ -54,9 +54,7 @@ module Peddler
54
54
 
55
55
  # @return [String] The type of transaction.
56
56
  #
57
- # Possible values:
58
- #
59
- # * Shipment
57
+ # **Possible value:** `Shipment`
60
58
  attribute?(:transaction_type, String, from: "transactionType")
61
59
  end
62
60
  end
@@ -5,7 +5,7 @@
5
5
  module Peddler
6
6
  module APIs
7
7
  class Finances20240619
8
- # Contains transactions within a given time period.
8
+ # A list of transactions within the specified time period.
9
9
  class Transactions < Array
10
10
  class << self
11
11
  def parse(array)
@@ -9,8 +9,10 @@ module Peddler
9
9
  class Finances20240619
10
10
  # The payload for the `listTransactions` operation.
11
11
  TransactionsPayload = Structure.new do
12
- # @return [String] When present and not empty, pass this string token in the next request to return the next
13
- # response page.
12
+ # @return [String] The response includes `nextToken` when the number of results exceeds the specified `pageSize`
13
+ # value. To get the next page of results, call the operation with this token and include the same arguments as
14
+ # the call that produced the token. To get a complete list, call this operation until `nextToken` is null.
15
+ # Note that this operation can return empty pages.
14
16
  attribute?(:next_token, String, from: "nextToken")
15
17
 
16
18
  # @return [Array<Transaction>]
@@ -6,9 +6,8 @@ module Peddler
6
6
  module APIs
7
7
  # The Selling Partner API for Finances
8
8
  #
9
- # The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You
10
- # can obtain financial events for a given order or date range without having to wait until a statement period
11
- # closes.
9
+ # The Selling Partner API for Finances provides financial information relevant to a seller's business. You can
10
+ # obtain financial events for a given order or date range without having to wait until a statement period closes.
12
11
  #
13
12
  # @see https://github.com/amzn/selling-partner-api-models/blob/main/models/finances-api-model/finances_2024-06-19.json
14
13
  class Finances20240619 < API
@@ -17,12 +16,13 @@ module Peddler
17
16
  # @note This operation can make a static sandbox call.
18
17
  # @param posted_after [String] The response includes financial events posted on or after this date. This date must
19
18
  # be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must
20
- # be more than two minutes before the time of the request.
21
- # @param posted_before [String] A date used for selecting transactions posted before (but not at) a specified
22
- # time. The date-time must be later than PostedAfter and no later than two minutes before the request was
23
- # submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no
24
- # transactions are returned. You must specify the PostedAfter parameter if you specify the PostedBefore
25
- # parameter. Default: Now minus two minutes.
19
+ # be more than two minutes before the time of the request. This field is required if you do not specify a
20
+ # related identifier.
21
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
22
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
23
+ # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
24
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes
25
+ # before the time of the request.
26
26
  # @param marketplace_id [String] The identifier of the marketplace from which you want to retrieve transactions.
27
27
  # The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace,
28
28
  # refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
@@ -30,21 +30,32 @@ module Peddler
30
30
  # transaction is currently deferred. * `RELEASED`: the transaction is currently released. * `DEFERRED_RELEASED`:
31
31
  # the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated
32
32
  # to `DEFERRED_RELEASED` when the transaction is released.
33
- # @param next_token [String] A string token returned in the response of your previous request.
33
+ # @param related_identifier_name [String] The name of the `relatedIdentifier`. **Possible values:** *
34
+ # `FINANCIAL_EVENT_GROUP_ID`: the financial event group ID associated with the transaction. **Note:**
35
+ # FINANCIAL_EVENT_GROUP_ID is the only `relatedIdentifier` with filtering capabilities at the moment. While
36
+ # other `relatedIdentifier` values will be included in the response when available, they cannot be used for
37
+ # filtering purposes.
38
+ # @param related_identifier_value [String] The value of the `relatedIdentifier`.
39
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
40
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
41
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
42
+ # is null. Note that this operation can return empty pages.
34
43
  # @param rate_limit [Float] Requests per second
35
44
  # @return [Peddler::Response] The API response
36
- def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, transaction_status: nil,
37
- next_token: nil, rate_limit: 0.5)
45
+ def list_transactions(posted_after: nil, posted_before: nil, marketplace_id: nil, transaction_status: nil,
46
+ related_identifier_name: nil, related_identifier_value: nil, next_token: nil, rate_limit: 0.5)
38
47
  path = "/finances/2024-06-19/transactions"
39
48
  params = {
40
49
  "postedAfter" => posted_after,
41
50
  "postedBefore" => posted_before,
42
51
  "marketplaceId" => marketplace_id,
43
52
  "transactionStatus" => transaction_status,
53
+ "relatedIdentifierName" => related_identifier_name,
54
+ "relatedIdentifierValue" => related_identifier_value,
44
55
  "nextToken" => next_token,
45
56
  }.compact
46
57
  parser = -> { ListTransactionsResponse }
47
- meter(rate_limit).get(path, params:, parser:)
58
+ get(path, params:, rate_limit:, parser:)
48
59
  end
49
60
  end
50
61
  end