peddler 3.0.0.beta1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +96 -106
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +34 -22
- data/lib/peddler/api/aplus_content_2020_11_01.rb +86 -48
- data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +12 -2
- data/lib/peddler/api/catalog_items_2020_12_01.rb +31 -20
- data/lib/peddler/api/catalog_items_2022_04_01.rb +35 -25
- data/lib/peddler/api/catalog_items_v0.rb +39 -26
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +41 -25
- data/lib/peddler/api/easy_ship_2022_03_23.rb +62 -43
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +13 -5
- data/lib/peddler/api/fba_inventory_v1.rb +40 -24
- data/lib/peddler/api/feeds_2021_06_30.rb +43 -25
- data/lib/peddler/api/finances_2024_06_19.rb +50 -0
- data/lib/peddler/api/finances_v0.rb +86 -59
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +304 -205
- data/lib/peddler/api/fulfillment_inbound_v0.rb +112 -74
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +90 -53
- data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +44 -33
- data/lib/peddler/api/listings_items_2021_08_01.rb +76 -60
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +19 -9
- data/lib/peddler/api/merchant_fulfillment_v0.rb +31 -15
- data/lib/peddler/api/messaging_v1.rb +93 -61
- data/lib/peddler/api/notifications_v1.rb +54 -23
- data/lib/peddler/api/orders_v0.rb +87 -72
- data/lib/peddler/api/product_fees_v0.rb +39 -31
- data/lib/peddler/api/product_pricing_2022_05_01.rb +17 -6
- data/lib/peddler/api/product_pricing_v0.rb +63 -45
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +29 -18
- data/lib/peddler/api/replenishment_2022_11_07.rb +21 -9
- data/lib/peddler/api/reports_2021_06_30.rb +60 -36
- data/lib/peddler/api/sales_v1.rb +20 -12
- data/lib/peddler/api/sellers_v1.rb +16 -4
- data/lib/peddler/api/services_v1.rb +138 -98
- data/lib/peddler/api/shipment_invoicing_v0.rb +25 -12
- data/lib/peddler/api/shipping_v1.rb +54 -29
- data/lib/peddler/api/shipping_v2.rb +132 -80
- data/lib/peddler/api/solicitations_v1.rb +18 -8
- data/lib/peddler/api/supply_sources_2020_07_01.rb +33 -15
- data/lib/peddler/api/tokens_2021_03_01.rb +13 -5
- data/lib/peddler/api/uploads_2020_11_01.rb +16 -6
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +12 -4
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +29 -17
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +29 -17
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +11 -3
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +14 -4
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +74 -48
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +74 -50
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +11 -3
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +11 -3
- data/lib/peddler/api/vendor_invoices_v1.rb +11 -3
- data/lib/peddler/api/vendor_orders_v1.rb +54 -43
- data/lib/peddler/api/vendor_shipments_v1.rb +63 -51
- data/lib/peddler/api/vendor_transaction_status_v1.rb +12 -3
- data/lib/peddler/api.rb +41 -18
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +1 -0
- data/lib/peddler/marketplace.rb +49 -0
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +56 -52
- metadata +10 -6
- data/lib/peddler/access_token.rb +0 -76
- data/lib/peddler/region.rb +0 -30
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def feeds_2021_06_30(...)
|
8
|
+
API::Feeds20210630.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Feeds
|
8
14
|
#
|
@@ -10,24 +16,26 @@ module Peddler
|
|
10
16
|
class Feeds20210630 < API
|
11
17
|
# Returns feed details for the feeds that match the filters that you specify.
|
12
18
|
#
|
13
|
-
# @
|
19
|
+
# @note This operation can make a static sandbox call.
|
20
|
+
# @param feed_types [Array<String>] A list of feed types used to filter feeds. When feedTypes is provided, the
|
14
21
|
# other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also
|
15
22
|
# be provided. Either feedTypes or nextToken is required.
|
16
|
-
# @param [Array<String>]
|
23
|
+
# @param marketplace_ids [Array<String>] A list of marketplace identifiers used to filter feeds. The feeds
|
17
24
|
# returned will match at least one of the marketplaces that you specify.
|
18
|
-
# @param [Integer]
|
19
|
-
# @param [Array<String>]
|
20
|
-
# @param [String]
|
25
|
+
# @param page_size [Integer] The maximum number of feeds to return in a single call.
|
26
|
+
# @param processing_statuses [Array<String>] A list of processing statuses used to filter feeds.
|
27
|
+
# @param created_since [String] The earliest feed creation date and time for feeds included in the response, in
|
21
28
|
# ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days.
|
22
|
-
# @param [String]
|
29
|
+
# @param created_until [String] The latest feed creation date and time for feeds included in the response, in ISO
|
23
30
|
# 8601 format. The default is now.
|
24
|
-
# @param [String]
|
31
|
+
# @param next_token [String] A string token returned in the response to your previous request. nextToken is
|
25
32
|
# returned when the number of results exceeds the specified pageSize value. To get the next page of results,
|
26
33
|
# call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other
|
27
34
|
# parameters will cause the request to fail.
|
35
|
+
# @param rate_limit [Float] Requests per second
|
28
36
|
# @return [Hash] The API response
|
29
|
-
def get_feeds(feed_types: nil, marketplace_ids: nil, page_size:
|
30
|
-
|
37
|
+
def get_feeds(feed_types: nil, marketplace_ids: nil, page_size: 10, processing_statuses: nil, created_since: nil,
|
38
|
+
created_until: nil, next_token: nil, rate_limit: 0.0222)
|
31
39
|
path = "/feeds/2021-06-30/feeds"
|
32
40
|
params = {
|
33
41
|
"feedTypes" => feed_types,
|
@@ -39,17 +47,19 @@ module Peddler
|
|
39
47
|
"nextToken" => next_token,
|
40
48
|
}.compact
|
41
49
|
|
42
|
-
rate_limit
|
50
|
+
meter(rate_limit).get(path, params:)
|
43
51
|
end
|
44
52
|
|
45
53
|
# Creates a feed. Upload the contents of the feed document before calling this operation.
|
46
54
|
#
|
47
|
-
# @
|
55
|
+
# @note This operation can make a static sandbox call.
|
56
|
+
# @param body [Hash] Information required to create the feed.
|
57
|
+
# @param rate_limit [Float] Requests per second
|
48
58
|
# @return [Hash] The API response
|
49
|
-
def create_feed(body)
|
59
|
+
def create_feed(body, rate_limit: 0.0083)
|
50
60
|
path = "/feeds/2021-06-30/feeds"
|
51
61
|
|
52
|
-
rate_limit
|
62
|
+
meter(rate_limit).post(path, body:)
|
53
63
|
end
|
54
64
|
|
55
65
|
# Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds
|
@@ -57,24 +67,28 @@ module Peddler
|
|
57
67
|
# [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and
|
58
68
|
# [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations.
|
59
69
|
#
|
60
|
-
# @
|
70
|
+
# @note This operation can make a static sandbox call.
|
71
|
+
# @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller
|
61
72
|
# ID.
|
73
|
+
# @param rate_limit [Float] Requests per second
|
62
74
|
# @return [Hash] The API response
|
63
|
-
def cancel_feed(feed_id)
|
75
|
+
def cancel_feed(feed_id, rate_limit: 2.0)
|
64
76
|
path = "/feeds/2021-06-30/feeds/#{feed_id}"
|
65
77
|
|
66
|
-
rate_limit
|
78
|
+
meter(rate_limit).delete(path)
|
67
79
|
end
|
68
80
|
|
69
81
|
# Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify.
|
70
82
|
#
|
71
|
-
# @
|
83
|
+
# @note This operation can make a static sandbox call.
|
84
|
+
# @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller
|
72
85
|
# ID.
|
86
|
+
# @param rate_limit [Float] Requests per second
|
73
87
|
# @return [Hash] The API response
|
74
|
-
def get_feed(feed_id)
|
88
|
+
def get_feed(feed_id, rate_limit: 2.0)
|
75
89
|
path = "/feeds/2021-06-30/feeds/#{feed_id}"
|
76
90
|
|
77
|
-
rate_limit
|
91
|
+
meter(rate_limit).get(path)
|
78
92
|
end
|
79
93
|
|
80
94
|
# Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading
|
@@ -82,22 +96,26 @@ module Peddler
|
|
82
96
|
# to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed)
|
83
97
|
# operation.
|
84
98
|
#
|
85
|
-
# @
|
99
|
+
# @note This operation can make a static sandbox call.
|
100
|
+
# @param body [Hash] Specifies the content type for the createFeedDocument operation.
|
101
|
+
# @param rate_limit [Float] Requests per second
|
86
102
|
# @return [Hash] The API response
|
87
|
-
def create_feed_document(body)
|
103
|
+
def create_feed_document(body, rate_limit: 0.5)
|
88
104
|
path = "/feeds/2021-06-30/documents"
|
89
105
|
|
90
|
-
rate_limit
|
106
|
+
meter(rate_limit).post(path, body:)
|
91
107
|
end
|
92
108
|
|
93
109
|
# Returns the information required for retrieving a feed document's contents.
|
94
110
|
#
|
95
|
-
# @
|
111
|
+
# @note This operation can make a static sandbox call.
|
112
|
+
# @param feed_document_id [String] The identifier of the feed document.
|
113
|
+
# @param rate_limit [Float] Requests per second
|
96
114
|
# @return [Hash] The API response
|
97
|
-
def get_feed_document(feed_document_id)
|
115
|
+
def get_feed_document(feed_document_id, rate_limit: 0.0222)
|
98
116
|
path = "/feeds/2021-06-30/documents/#{feed_document_id}"
|
99
117
|
|
100
|
-
rate_limit
|
118
|
+
meter(rate_limit).get(path)
|
101
119
|
end
|
102
120
|
end
|
103
121
|
end
|
@@ -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
|
@@ -3,31 +3,42 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def finances_v0(...)
|
8
|
+
API::FinancesV0.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Finances
|
8
14
|
#
|
9
|
-
# The Selling Partner API for Finances
|
15
|
+
# The Selling Partner API for Finances provides financial information that is relevant to a seller's business. You
|
10
16
|
# can obtain financial events for a given order, financial event group, or date range without having to wait until a
|
11
17
|
# statement period closes. You can also obtain financial event groups for a given date range.
|
12
18
|
class FinancesV0 < API
|
13
|
-
# Returns financial event groups for a given date range.
|
19
|
+
# Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in
|
14
20
|
# financial events.
|
15
21
|
#
|
16
|
-
# @
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# FinancialEventGroupStartedAfter and
|
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
|
23
30
|
# financial event groups are returned.
|
24
|
-
# @param [String]
|
25
|
-
#
|
26
|
-
# format. The date-time must be
|
27
|
-
# @param [String]
|
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
|
28
39
|
# @return [Hash] The API response
|
29
|
-
def list_financial_event_groups(max_results_per_page:
|
30
|
-
financial_event_group_started_after: nil, next_token: nil)
|
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)
|
31
42
|
path = "/finances/v0/financialEventGroups"
|
32
43
|
params = {
|
33
44
|
"MaxResultsPerPage" => max_results_per_page,
|
@@ -36,30 +47,34 @@ module Peddler
|
|
36
47
|
"NextToken" => next_token,
|
37
48
|
}.compact
|
38
49
|
|
39
|
-
rate_limit
|
50
|
+
meter(rate_limit).get(path, params:)
|
40
51
|
end
|
41
52
|
|
42
|
-
# Returns all financial events for the specified financial event group.
|
43
|
-
#
|
44
|
-
#
|
45
|
-
# spanning more than two years, an empty response is returned.
|
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.
|
46
56
|
#
|
47
|
-
# @
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
# `PostedAfter` and
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
# @param [String]
|
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
|
60
75
|
# @return [Hash] The API response
|
61
|
-
def list_financial_events_by_group_id(event_group_id, max_results_per_page:
|
62
|
-
posted_before: nil, next_token: nil)
|
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)
|
63
78
|
path = "/finances/v0/financialEventGroups/#{event_group_id}/financialEvents"
|
64
79
|
params = {
|
65
80
|
"MaxResultsPerPage" => max_results_per_page,
|
@@ -68,44 +83,56 @@ module Peddler
|
|
68
83
|
"NextToken" => next_token,
|
69
84
|
}.compact
|
70
85
|
|
71
|
-
rate_limit
|
86
|
+
meter(rate_limit).get(path, params:)
|
72
87
|
end
|
73
88
|
|
74
|
-
# Returns all financial events for the specified order.
|
89
|
+
# Returns all financial events for the specified order. Orders from the last 48 hours might not be included in
|
75
90
|
# financial events.
|
76
91
|
#
|
77
|
-
# @
|
78
|
-
# @param [
|
79
|
-
#
|
80
|
-
#
|
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
|
81
101
|
# @return [Hash] The API response
|
82
|
-
def list_financial_events_by_order_id(order_id, max_results_per_page:
|
102
|
+
def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
|
83
103
|
path = "/finances/v0/orders/#{order_id}/financialEvents"
|
84
104
|
params = {
|
85
105
|
"MaxResultsPerPage" => max_results_per_page,
|
86
106
|
"NextToken" => next_token,
|
87
107
|
}.compact
|
88
108
|
|
89
|
-
rate_limit
|
109
|
+
meter(rate_limit).get(path, params:)
|
90
110
|
end
|
91
111
|
|
92
|
-
# Returns financial events for the specified data range.
|
93
|
-
# financial events.
|
94
|
-
#
|
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.
|
95
115
|
#
|
96
|
-
# @
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
# PostedAfter and
|
105
|
-
#
|
106
|
-
#
|
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
|
107
133
|
# @return [Hash] The API response
|
108
|
-
def list_financial_events(max_results_per_page:
|
134
|
+
def list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil,
|
135
|
+
rate_limit: 0.5)
|
109
136
|
path = "/finances/v0/financialEvents"
|
110
137
|
params = {
|
111
138
|
"MaxResultsPerPage" => max_results_per_page,
|
@@ -114,7 +141,7 @@ module Peddler
|
|
114
141
|
"NextToken" => next_token,
|
115
142
|
}.compact
|
116
143
|
|
117
|
-
rate_limit
|
144
|
+
meter(rate_limit).get(path, params:)
|
118
145
|
end
|
119
146
|
end
|
120
147
|
end
|