peddler 2.4.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +402 -140
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
  9. data/lib/peddler/api/catalog_items_v0.rb +103 -0
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
  13. data/lib/peddler/api/fba_inventory_v1.rb +122 -0
  14. data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +148 -0
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
  25. data/lib/peddler/api/messaging_v1.rb +273 -0
  26. data/lib/peddler/api/notifications_v1.rb +145 -0
  27. data/lib/peddler/api/orders_v0.rb +279 -0
  28. data/lib/peddler/api/product_fees_v0.rb +77 -0
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
  30. data/lib/peddler/api/product_pricing_v0.rb +162 -0
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
  33. data/lib/peddler/api/reports_2021_06_30.rb +163 -0
  34. data/lib/peddler/api/sales_v1.rb +77 -0
  35. data/lib/peddler/api/sellers_v1.rb +45 -0
  36. data/lib/peddler/api/services_v1.rb +348 -0
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
  38. data/lib/peddler/api/shipping_v1.rb +132 -0
  39. data/lib/peddler/api/shipping_v2.rb +319 -0
  40. data/lib/peddler/api/solicitations_v1.rb +63 -0
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
  42. data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
  43. data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
  53. data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
  54. data/lib/peddler/api/vendor_orders_v1.rb +159 -0
  55. data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
  57. data/lib/peddler/api.rb +138 -0
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +31 -0
  60. data/lib/peddler/marketplace.rb +38 -68
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -1
  64. metadata +74 -80
  65. data/lib/mws/easy_ship/client.rb +0 -93
  66. data/lib/mws/easy_ship.rb +0 -3
  67. data/lib/mws/feeds/client.rb +0 -122
  68. data/lib/mws/feeds.rb +0 -3
  69. data/lib/mws/finances/client.rb +0 -82
  70. data/lib/mws/finances.rb +0 -3
  71. data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
  72. data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
  73. data/lib/mws/fulfillment_inventory/client.rb +0 -57
  74. data/lib/mws/fulfillment_inventory.rb +0 -3
  75. data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
  76. data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
  77. data/lib/mws/merchant_fulfillment/client.rb +0 -87
  78. data/lib/mws/merchant_fulfillment.rb +0 -3
  79. data/lib/mws/off_amazon_payments.rb +0 -3
  80. data/lib/mws/orders/client.rb +0 -120
  81. data/lib/mws/orders.rb +0 -3
  82. data/lib/mws/products/client.rb +0 -268
  83. data/lib/mws/products.rb +0 -3
  84. data/lib/mws/recommendations/client.rb +0 -72
  85. data/lib/mws/recommendations.rb +0 -3
  86. data/lib/mws/reports/client.rb +0 -236
  87. data/lib/mws/reports.rb +0 -3
  88. data/lib/mws/sellers/client.rb +0 -44
  89. data/lib/mws/sellers.rb +0 -3
  90. data/lib/mws/shipment_invoicing/client.rb +0 -74
  91. data/lib/mws/shipment_invoicing.rb +0 -3
  92. data/lib/mws/subscriptions/client.rb +0 -179
  93. data/lib/mws/subscriptions.rb +0 -3
  94. data/lib/mws.rb +0 -29
  95. data/lib/peddler/client.rb +0 -159
  96. data/lib/peddler/errors/builder.rb +0 -64
  97. data/lib/peddler/errors/class_generator.rb +0 -40
  98. data/lib/peddler/errors/error.rb +0 -45
  99. data/lib/peddler/errors/parser.rb +0 -28
  100. data/lib/peddler/flat_file_parser.rb +0 -56
  101. data/lib/peddler/headers.rb +0 -102
  102. data/lib/peddler/operation.rb +0 -78
  103. data/lib/peddler/parser.rb +0 -33
  104. data/lib/peddler/structured_list.rb +0 -23
  105. data/lib/peddler/vcr_matcher.rb +0 -97
  106. data/lib/peddler/xml_parser.rb +0 -38
  107. data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def finances_2024_06_19(...)
8
+ API::Finances20240619.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # The Selling Partner API for Finances
14
+ #
15
+ # The Selling Partner API for Finances provides financial information relevant to a seller's business. You can
16
+ # obtain financial events for a given order or date range without having to wait until a statement period closes.
17
+ class Finances20240619 < API
18
+ # Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial
19
+ # events.
20
+ #
21
+ # @note This operation can make a static sandbox call.
22
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
23
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
24
+ # must be more than two minutes before the time of the request.
25
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
26
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
27
+ # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
28
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes
29
+ # before the time of the request.
30
+ # @param marketplace_id [String] The ID of the marketplace from which you want to retrieve transactions.
31
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
32
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
33
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
34
+ # is null. Note that this operation can return empty pages.
35
+ # @param rate_limit [Float] Requests per second
36
+ # @return [Hash] The API response
37
+ def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, next_token: nil, rate_limit: 0.5)
38
+ path = "/finances/2024-06-19/transactions"
39
+ params = {
40
+ "postedAfter" => posted_after,
41
+ "postedBefore" => posted_before,
42
+ "marketplaceId" => marketplace_id,
43
+ "nextToken" => next_token,
44
+ }.compact
45
+
46
+ meter(rate_limit).get(path, params:)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def finances_v0(...)
8
+ API::FinancesV0.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Finances
14
+ #
15
+ # The Selling Partner API for Finances provides financial information that is relevant to a seller's business. You
16
+ # can obtain financial events for a given order, financial event group, or date range without having to wait until a
17
+ # statement period closes. You can also obtain financial event groups for a given date range.
18
+ class FinancesV0 < API
19
+ # Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in
20
+ # financial events.
21
+ #
22
+ # @note This operation can make a static sandbox call.
23
+ # @param max_results_per_page [Integer] The maximum number of results per page. If the response exceeds the
24
+ # maximum number of transactions or 10 MB, the response is `InvalidInput`.
25
+ # @param financial_event_group_started_before [String] A date that selects financial event groups that opened
26
+ # before (but not at) a specified date and time, in [ISO
27
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be after
28
+ # `FinancialEventGroupStartedAfter` and more than two minutes before the time of request. If
29
+ # `FinancialEventGroupStartedAfter` and `FinancialEventGroupStartedBefore` are more than 180 days apart, no
30
+ # financial event groups are returned.
31
+ # @param financial_event_group_started_after [String] A date that selects financial event groups that opened after
32
+ # (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
33
+ # format. The date-time must be more than two minutes before you submit the request.
34
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
35
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
36
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
37
+ # is null. Note that this operation can return empty pages.
38
+ # @param rate_limit [Float] Requests per second
39
+ # @return [Hash] The API response
40
+ def list_financial_event_groups(max_results_per_page: 10, financial_event_group_started_before: nil,
41
+ financial_event_group_started_after: nil, next_token: nil, rate_limit: 0.5)
42
+ path = "/finances/v0/financialEventGroups"
43
+ params = {
44
+ "MaxResultsPerPage" => max_results_per_page,
45
+ "FinancialEventGroupStartedBefore" => financial_event_group_started_before,
46
+ "FinancialEventGroupStartedAfter" => financial_event_group_started_after,
47
+ "NextToken" => next_token,
48
+ }.compact
49
+
50
+ meter(rate_limit).get(path, params:)
51
+ end
52
+
53
+ # Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be
54
+ # included in financial events. **Note:** This operation only retrieves a group's data for the past two years. A
55
+ # request for data spanning more than two years produces an empty response.
56
+ #
57
+ # @note This operation can make a static sandbox call.
58
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
59
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
60
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
61
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
62
+ # must be more than two minutes before the time of the request.
63
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
64
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
65
+ # date-time must be later than `PostedAfter` and more than two minutes before the requestd was submitted. If
66
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
67
+ # `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
68
+ # minutes before the time of the request.
69
+ # @param event_group_id [String] The identifier of the financial event group to which the events belong.
70
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
71
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
72
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
73
+ # is null. Note that this operation can return empty pages.
74
+ # @param rate_limit [Float] Requests per second
75
+ # @return [Hash] The API response
76
+ def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil,
77
+ posted_before: nil, next_token: nil, rate_limit: 0.5)
78
+ path = "/finances/v0/financialEventGroups/#{event_group_id}/financialEvents"
79
+ params = {
80
+ "MaxResultsPerPage" => max_results_per_page,
81
+ "PostedAfter" => posted_after,
82
+ "PostedBefore" => posted_before,
83
+ "NextToken" => next_token,
84
+ }.compact
85
+
86
+ meter(rate_limit).get(path, params:)
87
+ end
88
+
89
+ # Returns all financial events for the specified order. Orders from the last 48 hours might not be included in
90
+ # financial events.
91
+ #
92
+ # @note This operation can make a static sandbox call.
93
+ # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
94
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
95
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
96
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
97
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
98
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
99
+ # is null. Note that this operation can return empty pages.
100
+ # @param rate_limit [Float] Requests per second
101
+ # @return [Hash] The API response
102
+ def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
103
+ path = "/finances/v0/orders/#{order_id}/financialEvents"
104
+ params = {
105
+ "MaxResultsPerPage" => max_results_per_page,
106
+ "NextToken" => next_token,
107
+ }.compact
108
+
109
+ meter(rate_limit).get(path, params:)
110
+ end
111
+
112
+ # Returns financial events for the specified data range. Orders from the last 48 hours might not be included in
113
+ # financial events. **Note:** in `ListFinancialEvents`, deferred events don't show up in responses until in they
114
+ # are released.
115
+ #
116
+ # @note This operation can make a static sandbox call.
117
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
118
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
119
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
120
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
121
+ # must be more than two minutes before the time of the request.
122
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
123
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
124
+ # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
125
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
126
+ # `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
127
+ # minutes before the time of the request.
128
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
129
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
130
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
131
+ # is null. Note that this operation can return empty pages.
132
+ # @param rate_limit [Float] Requests per second
133
+ # @return [Hash] The API response
134
+ def list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil,
135
+ rate_limit: 0.5)
136
+ path = "/finances/v0/financialEvents"
137
+ params = {
138
+ "MaxResultsPerPage" => max_results_per_page,
139
+ "PostedAfter" => posted_after,
140
+ "PostedBefore" => posted_before,
141
+ "NextToken" => next_token,
142
+ }.compact
143
+
144
+ meter(rate_limit).get(path, params:)
145
+ end
146
+ end
147
+ end
148
+ end