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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -106
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +34 -22
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +86 -48
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +12 -2
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +31 -20
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +35 -25
  9. data/lib/peddler/api/catalog_items_v0.rb +39 -26
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +41 -25
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +62 -43
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +13 -5
  13. data/lib/peddler/api/fba_inventory_v1.rb +40 -24
  14. data/lib/peddler/api/feeds_2021_06_30.rb +43 -25
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +86 -59
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +304 -205
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +112 -74
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +90 -53
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +44 -33
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +76 -60
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +19 -9
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +31 -15
  25. data/lib/peddler/api/messaging_v1.rb +93 -61
  26. data/lib/peddler/api/notifications_v1.rb +54 -23
  27. data/lib/peddler/api/orders_v0.rb +87 -72
  28. data/lib/peddler/api/product_fees_v0.rb +39 -31
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +17 -6
  30. data/lib/peddler/api/product_pricing_v0.rb +63 -45
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +29 -18
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +21 -9
  33. data/lib/peddler/api/reports_2021_06_30.rb +60 -36
  34. data/lib/peddler/api/sales_v1.rb +20 -12
  35. data/lib/peddler/api/sellers_v1.rb +16 -4
  36. data/lib/peddler/api/services_v1.rb +138 -98
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +25 -12
  38. data/lib/peddler/api/shipping_v1.rb +54 -29
  39. data/lib/peddler/api/shipping_v2.rb +132 -80
  40. data/lib/peddler/api/solicitations_v1.rb +18 -8
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +33 -15
  42. data/lib/peddler/api/tokens_2021_03_01.rb +13 -5
  43. data/lib/peddler/api/uploads_2020_11_01.rb +16 -6
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +12 -4
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +29 -17
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +29 -17
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +11 -3
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +14 -4
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +74 -48
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +74 -50
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +11 -3
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +11 -3
  53. data/lib/peddler/api/vendor_invoices_v1.rb +11 -3
  54. data/lib/peddler/api/vendor_orders_v1.rb +54 -43
  55. data/lib/peddler/api/vendor_shipments_v1.rb +63 -51
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +12 -3
  57. data/lib/peddler/api.rb +41 -18
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +1 -0
  60. data/lib/peddler/marketplace.rb +49 -0
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -52
  64. metadata +10 -6
  65. data/lib/peddler/access_token.rb +0 -76
  66. 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 catalog_items_v0(...)
8
+ API::CatalogItemsV0.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Catalog Items
8
14
  #
@@ -11,29 +17,32 @@ module Peddler
11
17
  class CatalogItemsV0 < API
12
18
  # Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling
13
19
  # Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of
14
- # the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference).
15
- # Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation
16
- # to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not
17
- # being deprecated and you can continue to make calls to it.
20
+ # the {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-reference Selling Partner API
21
+ # for Catalog Items v2022-04-01}. Integrations that rely on the `listCatalogItems` operation should migrate to the
22
+ # `searchCatalogItems`operation to avoid service disruption. _Note:_ The
23
+ # [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to
24
+ # make calls to it.
18
25
  #
19
- # @param [String] marketplace_id A marketplace identifier. Specifies the marketplace for which items are returned.
20
- # @param [String] query Keyword(s) to use to search for items in the catalog. Example: 'harry potter books'.
21
- # @param [String] query_context_id An identifier for the context within which the given search will be performed.
26
+ # @note This operation can make a static sandbox call.
27
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for which items are returned.
28
+ # @param query [String] Keyword(s) to use to search for items in the catalog. Example: 'harry potter books'.
29
+ # @param query_context_id [String] An identifier for the context within which the given search will be performed.
22
30
  # A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example,
23
31
  # the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter
24
32
  # specifies such a subset. If it is omitted, the search will be performed using the default context for the
25
33
  # marketplace, which will typically contain the largest set of items.
26
- # @param [String] seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the
34
+ # @param seller_sku [String] Used to identify an item in the given marketplace. SellerSKU is qualified by the
27
35
  # seller's SellerId, which is included with every operation that you submit.
28
- # @param [String] upc A 12-digit bar code used for retail packaging.
29
- # @param [String] ean A European article number that uniquely identifies the catalog item, manufacturer, and its
36
+ # @param upc [String] A 12-digit bar code used for retail packaging.
37
+ # @param ean [String] A European article number that uniquely identifies the catalog item, manufacturer, and its
30
38
  # attributes.
31
- # @param [String] isbn The unique commercial book identifier used to identify books internationally.
32
- # @param [String] jan A Japanese article number that uniquely identifies the product, manufacturer, and its
39
+ # @param isbn [String] The unique commercial book identifier used to identify books internationally.
40
+ # @param jan [String] A Japanese article number that uniquely identifies the product, manufacturer, and its
33
41
  # attributes.
42
+ # @param rate_limit [Float] Requests per second
34
43
  # @return [Hash] The API response
35
44
  def list_catalog_items(marketplace_id, query: nil, query_context_id: nil, seller_sku: nil, upc: nil, ean: nil,
36
- isbn: nil, jan: nil)
45
+ isbn: nil, jan: nil, rate_limit: nil)
37
46
  path = "/catalog/v0/items"
38
47
  params = {
39
48
  "MarketplaceId" => marketplace_id,
@@ -50,16 +59,18 @@ module Peddler
50
59
  end
51
60
 
52
61
  # Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner
53
- # API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for
54
- # Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this
55
- # operation should migrate to the latest version to avoid service disruption. _Note:_ The
56
- # [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to
57
- # make calls to it.
62
+ # API for Catalog Items v0. This operation is available in the latest version of the
63
+ # {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-reference Selling Partner API for
64
+ # Catalog Items v2022-04-01}. Integrations that rely on this operation should migrate to the latest version to
65
+ # avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being
66
+ # deprecated and you can continue to make calls to it.
58
67
  #
59
- # @param [String] marketplace_id A marketplace identifier. Specifies the marketplace for the item.
60
- # @param [String] asin The Amazon Standard Identification Number (ASIN) of the item.
68
+ # @note This operation can make a static sandbox call.
69
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for the item.
70
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
71
+ # @param rate_limit [Float] Requests per second
61
72
  # @return [Hash] The API response
62
- def get_catalog_item(marketplace_id, asin)
73
+ def get_catalog_item(marketplace_id, asin, rate_limit: nil)
63
74
  path = "/catalog/v0/items/#{asin}"
64
75
  params = {
65
76
  "MarketplaceId" => marketplace_id,
@@ -70,12 +81,14 @@ module Peddler
70
81
 
71
82
  # Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU.
72
83
  #
73
- # @param [String] marketplace_id A marketplace identifier. Specifies the marketplace for the item.
74
- # @param [String] asin The Amazon Standard Identification Number (ASIN) of the item.
75
- # @param [String] seller_sku Used to identify items in the given marketplace. SellerSKU is qualified by the
84
+ # @note This operation can make a static sandbox call.
85
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace for the item.
86
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
87
+ # @param seller_sku [String] Used to identify items in the given marketplace. SellerSKU is qualified by the
76
88
  # seller's SellerId, which is included with every operation that you submit.
89
+ # @param rate_limit [Float] Requests per second
77
90
  # @return [Hash] The API response
78
- def list_catalog_categories(marketplace_id, asin: nil, seller_sku: nil)
91
+ def list_catalog_categories(marketplace_id, asin: nil, seller_sku: nil, rate_limit: 1.0)
79
92
  path = "/catalog/v0/categories"
80
93
  params = {
81
94
  "MarketplaceId" => marketplace_id,
@@ -83,7 +96,7 @@ module Peddler
83
96
  "SellerSKU" => seller_sku,
84
97
  }.compact
85
98
 
86
- rate_limit(1.0).get(path, params:)
99
+ meter(rate_limit).get(path, params:)
87
100
  end
88
101
  end
89
102
  end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def data_kiosk_2023_11_15(...)
8
+ API::DataKiosk20231115.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Data Kiosk
8
14
  #
@@ -12,20 +18,22 @@ module Peddler
12
18
  # Returns details for the Data Kiosk queries that match the specified filters. See the `createQuery` operation for
13
19
  # details about query retention.
14
20
  #
15
- # @param [Array<String>] processing_statuses A list of processing statuses used to filter queries.
16
- # @param [Integer] page_size The maximum number of queries to return in a single call.
17
- # @param [String] created_since The earliest query creation date and time for queries to include in the response,
21
+ # @note This operation can make a static sandbox call.
22
+ # @param processing_statuses [Array<String>] A list of processing statuses used to filter queries.
23
+ # @param page_size [Integer] The maximum number of queries to return in a single call.
24
+ # @param created_since [String] The earliest query creation date and time for queries to include in the response,
18
25
  # in ISO 8601 date time format. The default is 90 days ago.
19
- # @param [String] created_until The latest query creation date and time for queries to include in the response, in
26
+ # @param created_until [String] The latest query creation date and time for queries to include in the response, in
20
27
  # ISO 8601 date time format. The default is the time of the `getQueries` request.
21
- # @param [String] pagination_token A token to fetch a certain page of results when there are multiple pages of
28
+ # @param pagination_token [String] A token to fetch a certain page of results when there are multiple pages of
22
29
  # results available. The value of this token is fetched from the `pagination.nextToken` field returned in the
23
30
  # `GetQueriesResponse` object. All other parameters must be provided with the same values that were provided
24
31
  # with the request that generated this token, with the exception of `pageSize` which can be modified between
25
32
  # calls to `getQueries`. In the absence of this token value, `getQueries` returns the first page of results.
33
+ # @param rate_limit [Float] Requests per second
26
34
  # @return [Hash] The API response
27
- def get_queries(processing_statuses: nil, page_size: nil, created_since: nil, created_until: nil,
28
- pagination_token: nil)
35
+ def get_queries(processing_statuses: nil, page_size: 10, created_since: nil, created_until: nil,
36
+ pagination_token: nil, rate_limit: 0.0222)
29
37
  path = "/dataKiosk/2023-11-15/queries"
30
38
  params = {
31
39
  "processingStatuses" => processing_statuses,
@@ -35,21 +43,23 @@ module Peddler
35
43
  "paginationToken" => pagination_token,
36
44
  }.compact
37
45
 
38
- rate_limit(0.0222).get(path, params:)
46
+ meter(rate_limit).get(path, params:)
39
47
  end
40
48
 
41
- # Creates a Data Kiosk query request.
42
- # @note The retention of a query varies based on the fields requested. Each field within a schema is annotated
43
- # with a `@resultRetention` directive that defines how long a query containing that field will be retained. When
44
- # a query contains multiple fields with different retentions, the shortest (minimum) retention is applied. The
45
- # retention of a query's resulting documents always matches the retention of the query.
49
+ # Creates a Data Kiosk query request. **Note:** The retention of a query varies based on the fields requested.
50
+ # Each field within a schema is annotated with a `@resultRetention` directive that defines how long a query
51
+ # containing that field will be retained. When a query contains multiple fields with different retentions, the
52
+ # shortest (minimum) retention is applied. The retention of a query's resulting documents always matches the
53
+ # retention of the query.
46
54
  #
47
- # @param [Hash] body The body of the request.
55
+ # @note This operation can make a static sandbox call.
56
+ # @param body [Hash] The body of the request.
57
+ # @param rate_limit [Float] Requests per second
48
58
  # @return [Hash] The API response
49
- def create_query(body)
59
+ def create_query(body, rate_limit: 0.0167)
50
60
  path = "/dataKiosk/2023-11-15/queries"
51
61
 
52
- rate_limit(0.0167).post(path, body:)
62
+ meter(rate_limit).post(path, body:)
53
63
  end
54
64
 
55
65
  # Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus`
@@ -57,35 +67,41 @@ module Peddler
57
67
  # `CANCELLED` will no-op. Cancelled queries are returned in subsequent calls to the `getQuery` and `getQueries`
58
68
  # operations.
59
69
  #
60
- # @param [String] query_id The identifier for the query. This identifier is unique only in combination with a
70
+ # @note This operation can make a static sandbox call.
71
+ # @param query_id [String] The identifier for the query. This identifier is unique only in combination with a
61
72
  # selling partner account ID.
73
+ # @param rate_limit [Float] Requests per second
62
74
  # @return [Hash] The API response
63
- def cancel_query(query_id)
75
+ def cancel_query(query_id, rate_limit: 0.0222)
64
76
  path = "/dataKiosk/2023-11-15/queries/#{query_id}"
65
77
 
66
- rate_limit(0.0222).delete(path)
78
+ meter(rate_limit).delete(path)
67
79
  end
68
80
 
69
81
  # Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for
70
82
  # details about query retention.
71
83
  #
72
- # @param [String] query_id The query identifier.
84
+ # @note This operation can make a static sandbox call.
85
+ # @param query_id [String] The query identifier.
86
+ # @param rate_limit [Float] Requests per second
73
87
  # @return [Hash] The API response
74
- def get_query(query_id)
88
+ def get_query(query_id, rate_limit: 2.0)
75
89
  path = "/dataKiosk/2023-11-15/queries/#{query_id}"
76
90
 
77
- rate_limit(2.0).get(path)
91
+ meter(rate_limit).get(path)
78
92
  end
79
93
 
80
94
  # Returns the information required for retrieving a Data Kiosk document's contents. See the `createQuery`
81
95
  # operation for details about document retention.
82
96
  #
83
- # @param [String] document_id The identifier for the Data Kiosk document.
97
+ # @note This operation can make a static sandbox call.
98
+ # @param document_id [String] The identifier for the Data Kiosk document.
99
+ # @param rate_limit [Float] Requests per second
84
100
  # @return [Hash] The API response
85
- def get_document(document_id)
101
+ def get_document(document_id, rate_limit: 0.0167)
86
102
  path = "/dataKiosk/2023-11-15/documents/#{document_id}"
87
103
 
88
- rate_limit(0.0167).get(path)
104
+ meter(rate_limit).get(path)
89
105
  end
90
106
  end
91
107
  end
@@ -3,105 +3,124 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def easy_ship_2022_03_23(...)
8
+ API::EasyShip20220323.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Easy Ship
8
14
  #
9
15
  # The Selling Partner API for Easy Ship helps you build applications that help sellers manage and ship Amazon Easy
10
16
  # Ship orders. Your Easy Ship applications can: * Get available time slots for packages to be scheduled for
11
17
  # delivery. * Schedule, reschedule, and cancel Easy Ship orders. * Print labels, invoices, and warranties. See the
12
- # [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) for the
13
- # differences in Easy Ship operations by marketplace.
18
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
19
+ # Marketplace Support Table} for the differences in Easy Ship operations by marketplace.
14
20
  class EasyShip20220323 < API
15
21
  # Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions
16
22
  # that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace
17
- # support. See **Get Time Slots** in the [Marketplace Support
18
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time
19
- # slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the
20
- # [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).
23
+ # support. See **Get Time Slots** in the
24
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
25
+ # Marketplace Support Table}. This operation can return time slots that have either pickup or drop-off handover
26
+ # methods - see **Supported Handover Methods** in the
27
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
28
+ # Marketplace Support Table}.
21
29
  #
22
- # @param [Hash] list_handover_slots_request The request schema for the `listHandoverSlots` operation.
30
+ # @note This operation can make a static sandbox call.
31
+ # @param list_handover_slots_request [Hash] The request schema for the `listHandoverSlots` operation.
32
+ # @param rate_limit [Float] Requests per second
23
33
  # @return [Hash] The API response
24
- def list_handover_slots(list_handover_slots_request: nil)
34
+ def list_handover_slots(list_handover_slots_request: nil, rate_limit: 1.0)
25
35
  path = "/easyShip/2022-03-23/timeSlot"
26
36
  body = list_handover_slots_request
27
37
 
28
- rate_limit(1.0).post(path, body:)
38
+ meter(rate_limit).post(path, body:)
29
39
  end
30
40
 
31
41
  # Returns information about a package, including dimensions, weight, time slot information for handover, invoice
32
42
  # and item information, and status.
33
43
  #
34
- # @param [String] amazon_order_id An Amazon-defined order identifier. Identifies the order that the seller wants
44
+ # @note This operation can make a static sandbox call.
45
+ # @param amazon_order_id [String] An Amazon-defined order identifier. Identifies the order that the seller wants
35
46
  # to deliver using Amazon Easy Ship.
36
- # @param [String] marketplace_id An identifier for the marketplace in which the seller is selling.
47
+ # @param marketplace_id [String] An identifier for the marketplace in which the seller is selling.
48
+ # @param rate_limit [Float] Requests per second
37
49
  # @return [Hash] The API response
38
- def get_scheduled_package(amazon_order_id, marketplace_id)
50
+ def get_scheduled_package(amazon_order_id, marketplace_id, rate_limit: 1.0)
39
51
  path = "/easyShip/2022-03-23/package"
40
52
  params = {
41
53
  "amazonOrderId" => amazon_order_id,
42
54
  "marketplaceId" => marketplace_id,
43
55
  }.compact
44
56
 
45
- rate_limit(1.0).get(path, params:)
57
+ meter(rate_limit).get(path, params:)
46
58
  end
47
59
 
48
60
  # Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: *
49
61
  # Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship
50
62
  # order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a
51
- # warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice,
52
- # shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy
53
- # Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the
54
- # `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and
55
- # **Warranty** columns in the [Marketplace Support
56
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are
57
- # supported in each marketplace.
63
+ # warranty document if you specify a `SerialNumber` value. To get these documents, see
64
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide How to get invoice,
65
+ # shipping label, and warranty documents}. * Shows the status of Easy Ship orders when you call the `getOrders`
66
+ # operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the
67
+ # response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the
68
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
69
+ # Marketplace Support Table} to see which documents are supported in each marketplace.
58
70
  #
59
- # @param [Hash] create_scheduled_package_request The request schema for the `createScheduledPackage` operation.
71
+ # @note This operation can make a static sandbox call.
72
+ # @param create_scheduled_package_request [Hash] The request schema for the `createScheduledPackage` operation.
73
+ # @param rate_limit [Float] Requests per second
60
74
  # @return [Hash] The API response
61
- def create_scheduled_package(create_scheduled_package_request)
75
+ def create_scheduled_package(create_scheduled_package_request, rate_limit: 1.0)
62
76
  path = "/easyShip/2022-03-23/package"
63
77
  body = create_scheduled_package_request
64
78
 
65
- rate_limit(1.0).post(path, body:)
79
+ meter(rate_limit).post(path, body:)
66
80
  end
67
81
 
68
82
  # Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get
69
83
  # the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another
70
- # `patch` call. See the **Update Package** column in the [Marketplace Support
71
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this
72
- # operation is supported in.
84
+ # `patch` call. See the **Update Package** column in the
85
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
86
+ # Marketplace Support Table} to see which marketplaces this operation is supported in.
73
87
  #
74
- # @param [Hash] update_scheduled_packages_request The request schema for the `updateScheduledPackages` operation.
88
+ # @note This operation can make a static sandbox call.
89
+ # @param update_scheduled_packages_request [Hash] The request schema for the `updateScheduledPackages` operation.
90
+ # @param rate_limit [Float] Requests per second
75
91
  # @return [Hash] The API response
76
- def update_scheduled_packages(update_scheduled_packages_request: nil)
92
+ def update_scheduled_packages(update_scheduled_packages_request: nil, rate_limit: 1.0)
77
93
  path = "/easyShip/2022-03-23/package"
78
94
  body = update_scheduled_packages_request
79
95
 
80
- rate_limit(1.0).patch(path, body:)
96
+ meter(rate_limit).patch(path, body:)
81
97
  end
82
98
 
83
99
  # This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the
84
100
  # associated shipping labels, along with other compliance documents according to the marketplace (refer to the
85
- # [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).
86
- # Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a
87
- # preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective
88
- # packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will
89
- # then pick the earliest time slot possible. Regarding the shipping label's file format, external developers are
90
- # able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array
91
- # composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated
92
- # shipping labels and the other documents enabled for your marketplace. If at least an order couldn't be
93
- # scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order
94
- # we couldn't process. Each entry is composed of an error message describing the reason of the failure, so that
95
- # sellers can take action. The table below displays the supported request and burst maximum rates:
101
+ # {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
102
+ # marketplace document support table}). Developers calling this operation may optionally assign a `packageDetails`
103
+ # object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will
104
+ # try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time
105
+ # slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label's file
106
+ # format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.
107
+ # This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file
108
+ # containing the generated shipping labels and the other documents enabled for your marketplace. If at least an
109
+ # order couldn't be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an
110
+ # entry for each order we couldn't process. Each entry is composed of an error message describing the reason of
111
+ # the failure, so that sellers can take action. The table below displays the supported request and burst maximum
112
+ # rates:
96
113
  #
97
- # @param [Hash] create_scheduled_packages_request The request schema for the `createScheduledPackageBulk`
114
+ # @note This operation can make a static sandbox call.
115
+ # @param create_scheduled_packages_request [Hash] The request schema for the `createScheduledPackageBulk`
98
116
  # operation.
117
+ # @param rate_limit [Float] Requests per second
99
118
  # @return [Hash] The API response
100
- def create_scheduled_package_bulk(create_scheduled_packages_request)
119
+ def create_scheduled_package_bulk(create_scheduled_packages_request, rate_limit: 1.0)
101
120
  path = "/easyShip/2022-03-23/packages/bulk"
102
121
  body = create_scheduled_packages_request
103
122
 
104
- rate_limit(1.0).post(path, body:)
123
+ meter(rate_limit).post(path, body:)
105
124
  end
106
125
  end
107
126
  end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def fba_inbound_eligibility_v1(...)
8
+ API::FBAInboundEligibilityV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for FBA Inbound Eligibilty
8
14
  #
@@ -16,12 +22,14 @@ module Peddler
16
22
  # preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which
17
23
  # you want to determine the item's eligibility.
18
24
  #
19
- # @param [Array<String>] marketplace_ids The identifier for the marketplace in which you want to determine
25
+ # @note This operation can make a static sandbox call.
26
+ # @param marketplace_ids [Array<String>] The identifier for the marketplace in which you want to determine
20
27
  # eligibility. Required only when program=INBOUND.
21
- # @param [String] asin The ASIN of the item for which you want an eligibility preview.
22
- # @param [String] program The program that you want to check eligibility against.
28
+ # @param asin [String] The ASIN of the item for which you want an eligibility preview.
29
+ # @param program [String] The program that you want to check eligibility against.
30
+ # @param rate_limit [Float] Requests per second
23
31
  # @return [Hash] The API response
24
- def get_item_eligibility_preview(asin, program, marketplace_ids: nil)
32
+ def get_item_eligibility_preview(asin, program, marketplace_ids: nil, rate_limit: 1.0)
25
33
  path = "/fba/inbound/v1/eligibility/itemPreview"
26
34
  params = {
27
35
  "marketplaceIds" => marketplace_ids,
@@ -29,7 +37,7 @@ module Peddler
29
37
  "program" => program,
30
38
  }.compact
31
39
 
32
- rate_limit(1.0).get(path, params:)
40
+ meter(rate_limit).get(path, params:)
33
41
  end
34
42
  end
35
43
  end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def fba_inventory_v1(...)
8
+ API::FBAInventoryV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for FBA Inventory
8
14
  #
@@ -19,30 +25,28 @@ module Peddler
19
25
  # sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation
20
26
  # returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this
21
27
  # operation may contain special characters that must be encoded to successfully call the API. To avoid errors with
22
- # SKUs when encoding URLs, refer to URL Encoding. Usage Plan: | Rate (requests per second) | Burst | | ---- | ----
23
- # | | 2 | 2 | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to
24
- # the requested operation, when available. The table above indicates the default rate and burst values for this
25
- # operation. Selling partners whose business demands require higher throughput may see higher rate and burst
26
- # values than those shown here. For more information, see Usage Plans and Rate Limits in the Selling Partner API.
28
+ # SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
27
29
  #
28
- # @param [Boolean] details true to return inventory summaries with additional summarized inventory details and
30
+ # @note This operation can make a dynamic sandbox call.
31
+ # @param details [Boolean] true to return inventory summaries with additional summarized inventory details and
29
32
  # quantities. Otherwise, returns inventory summaries only (default value).
30
- # @param [String] granularity_type The granularity type for the inventory aggregation level.
31
- # @param [String] granularity_id The granularity ID for the inventory aggregation level.
32
- # @param [String] start_date_time A start date and time in ISO8601 format. If specified, all inventory summaries
33
+ # @param granularity_type [String] The granularity type for the inventory aggregation level.
34
+ # @param granularity_id [String] The granularity ID for the inventory aggregation level.
35
+ # @param start_date_time [String] A start date and time in ISO8601 format. If specified, all inventory summaries
33
36
  # that have changed since then are returned. You must specify a date and time that is no earlier than 18 months
34
37
  # prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity,
35
38
  # inboundShippedQuantity and inboundReceivingQuantity are not detected.
36
- # @param [Array<String>] seller_skus A list of seller SKUs for which to return inventory summaries. You may
39
+ # @param seller_skus [Array<String>] A list of seller SKUs for which to return inventory summaries. You may
37
40
  # specify up to 50 SKUs.
38
- # @param [String] seller_sku A single seller SKU used for querying the specified seller SKU inventory summaries.
39
- # @param [String] next_token String token returned in the response of your previous request. The string token will
41
+ # @param seller_sku [String] A single seller SKU used for querying the specified seller SKU inventory summaries.
42
+ # @param next_token [String] String token returned in the response of your previous request. The string token will
40
43
  # expire 30 seconds after being created.
41
- # @param [Array<String>] marketplace_ids The marketplace ID for the marketplace for which to return inventory
44
+ # @param marketplace_ids [Array<String>] The marketplace ID for the marketplace for which to return inventory
42
45
  # summaries.
46
+ # @param rate_limit [Float] Requests per second
43
47
  # @return [Hash] The API response
44
- def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil,
45
- start_date_time: nil, seller_skus: nil, seller_sku: nil, next_token: nil)
48
+ def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil,
49
+ seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0)
46
50
  path = "/fba/inventory/v1/summaries"
47
51
  params = {
48
52
  "details" => details,
@@ -55,16 +59,20 @@ module Peddler
55
59
  "marketplaceIds" => marketplace_ids,
56
60
  }.compact
57
61
 
58
- rate_limit(2.0).get(path, params:)
62
+ meter(rate_limit).get(path, params:)
59
63
  end
60
64
 
61
65
  # Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a
62
66
  # sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API
63
67
  # sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
64
68
  #
65
- # @param [Hash] create_inventory_item_request_body CreateInventoryItem Request Body Parameter.
69
+ # @note This operation can make a dynamic sandbox call.
70
+ # @param create_inventory_item_request_body [Hash] CreateInventoryItem Request Body Parameter.
71
+ # @param rate_limit [Float] Requests per second
66
72
  # @return [Hash] The API response
67
- def create_inventory_item(create_inventory_item_request_body)
73
+ def create_inventory_item(create_inventory_item_request_body, rate_limit: nil)
74
+ must_sandbox!
75
+
68
76
  path = "/fba/inventory/v1/items"
69
77
  body = create_inventory_item_request_body
70
78
 
@@ -75,10 +83,14 @@ module Peddler
75
83
  # sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API
76
84
  # sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
77
85
  #
78
- # @param [String] seller_sku A single seller SKU used for querying the specified seller SKU inventory summaries.
79
- # @param [String] marketplace_id The marketplace ID for the marketplace for which the sellerSku is to be deleted.
86
+ # @note This operation can make a dynamic sandbox call.
87
+ # @param seller_sku [String] A single seller SKU used for querying the specified seller SKU inventory summaries.
88
+ # @param marketplace_id [String] The marketplace ID for the marketplace for which the sellerSku is to be deleted.
89
+ # @param rate_limit [Float] Requests per second
80
90
  # @return [Hash] The API response
81
- def delete_inventory_item(seller_sku, marketplace_id)
91
+ def delete_inventory_item(seller_sku, marketplace_id, rate_limit: nil)
92
+ must_sandbox!
93
+
82
94
  path = "/fba/inventory/v1/items/#{seller_sku}"
83
95
  params = {
84
96
  "marketplaceId" => marketplace_id,
@@ -92,10 +104,14 @@ module Peddler
92
104
  # Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more
93
105
  # information.
94
106
  #
95
- # @param [String] x_amzn_idempotency_token A unique token/requestId provided with each call to ensure idempotency.
96
- # @param [Hash] add_inventory_request_body List of items to add to Sandbox inventory.
107
+ # @note This operation can make a dynamic sandbox call.
108
+ # @param x_amzn_idempotency_token [String] A unique token/requestId provided with each call to ensure idempotency.
109
+ # @param add_inventory_request_body [Hash] List of items to add to Sandbox inventory.
110
+ # @param rate_limit [Float] Requests per second
97
111
  # @return [Hash] The API response
98
- def add_inventory(x_amzn_idempotency_token, add_inventory_request_body)
112
+ def add_inventory(x_amzn_idempotency_token, add_inventory_request_body, rate_limit: nil)
113
+ must_sandbox!
114
+
99
115
  path = "/fba/inventory/v1/items/inventory"
100
116
  body = add_inventory_request_body
101
117