peddler 3.0.0.beta1 → 4.0.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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +108 -110
  3. data/lib/peddler/api.rb +56 -18
  4. data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +38 -26
  5. data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +97 -59
  6. data/lib/peddler/apis/application_integrations_2024_04_01.rb +56 -0
  7. data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +14 -4
  8. data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +34 -23
  9. data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +39 -29
  10. data/lib/peddler/{api → apis}/catalog_items_v0.rb +43 -30
  11. data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +47 -31
  12. data/lib/peddler/apis/easy_ship_2022_03_23.rb +126 -0
  13. data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +15 -7
  14. data/lib/peddler/{api → apis}/fba_inventory_v1.rb +45 -29
  15. data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +54 -33
  16. data/lib/peddler/apis/finances_2024_06_19.rb +50 -0
  17. data/lib/peddler/{api → apis}/finances_v0.rb +50 -36
  18. data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +384 -255
  19. data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +138 -93
  20. data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +105 -68
  21. data/lib/peddler/apis/invoices_2024_06_19.rb +180 -0
  22. data/lib/peddler/apis/listings_items_2020_09_01.rb +95 -0
  23. data/lib/peddler/apis/listings_items_2021_08_01.rb +136 -0
  24. data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +21 -11
  25. data/lib/peddler/apis/merchant_fulfillment_v0.rb +80 -0
  26. data/lib/peddler/{api → apis}/messaging_v1.rb +107 -75
  27. data/lib/peddler/{api → apis}/notifications_v1.rb +63 -32
  28. data/lib/peddler/{api → apis}/orders_v0.rb +99 -84
  29. data/lib/peddler/apis/product_fees_v0.rb +77 -0
  30. data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +24 -13
  31. data/lib/peddler/{api → apis}/product_pricing_v0.rb +70 -52
  32. data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +32 -21
  33. data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +25 -13
  34. data/lib/peddler/{api → apis}/reports_2021_06_30.rb +71 -47
  35. data/lib/peddler/{api → apis}/sales_v1.rb +22 -14
  36. data/lib/peddler/{api → apis}/sellers_v1.rb +19 -7
  37. data/lib/peddler/{api → apis}/services_v1.rb +156 -116
  38. data/lib/peddler/apis/shipment_invoicing_v0.rb +59 -0
  39. data/lib/peddler/apis/shipping_v1.rb +132 -0
  40. data/lib/peddler/{api → apis}/shipping_v2.rb +150 -98
  41. data/lib/peddler/{api → apis}/solicitations_v1.rb +21 -11
  42. data/lib/peddler/apis/supply_sources_2020_07_01.rb +100 -0
  43. data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +15 -7
  44. data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +18 -8
  45. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +14 -6
  46. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +33 -21
  47. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +33 -21
  48. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +13 -5
  49. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  50. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +86 -60
  51. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  52. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +14 -6
  53. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +14 -6
  54. data/lib/peddler/apis/vendor_invoices_v1.rb +30 -0
  55. data/lib/peddler/{api → apis}/vendor_orders_v1.rb +59 -48
  56. data/lib/peddler/apis/vendor_shipments_v1.rb +132 -0
  57. data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +14 -5
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +21 -11
  60. data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
  61. data/lib/peddler/json_feed_document.rb +31 -0
  62. data/lib/peddler/marketplace.rb +93 -0
  63. data/lib/peddler/response.rb +46 -0
  64. data/lib/peddler/token.rb +70 -0
  65. data/lib/peddler/version.rb +1 -1
  66. data/lib/peddler.rb +55 -52
  67. metadata +64 -57
  68. data/lib/peddler/access_token.rb +0 -76
  69. data/lib/peddler/api/easy_ship_2022_03_23.rb +0 -108
  70. data/lib/peddler/api/listings_items_2020_09_01.rb +0 -84
  71. data/lib/peddler/api/listings_items_2021_08_01.rb +0 -154
  72. data/lib/peddler/api/merchant_fulfillment_v0.rb +0 -64
  73. data/lib/peddler/api/product_fees_v0.rb +0 -69
  74. data/lib/peddler/api/shipment_invoicing_v0.rb +0 -46
  75. data/lib/peddler/api/shipping_v1.rb +0 -107
  76. data/lib/peddler/api/supply_sources_2020_07_01.rb +0 -82
  77. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +0 -35
  78. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +0 -165
  79. data/lib/peddler/api/vendor_invoices_v1.rb +0 -22
  80. data/lib/peddler/api/vendor_shipments_v1.rb +0 -120
  81. data/lib/peddler/region.rb +0 -30
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def uploads_2020_11_01(...)
8
+ APIs::Uploads20201101.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Uploads
8
14
  #
9
15
  # The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such
@@ -12,20 +18,24 @@ module Peddler
12
18
  # Creates an upload destination, returning the information required to upload a file to the destination and to
13
19
  # programmatically access the file.
14
20
  #
15
- # @param [Array<String>] marketplace_ids A list of marketplace identifiers. This specifies the marketplaces where
21
+ # @param marketplace_ids [Array<String>] A list of marketplace identifiers. This specifies the marketplaces where
16
22
  # the upload will be available. Only one marketplace can be specified.
17
- # @param [String] content_md5 An MD5 hash of the content to be submitted to the upload destination. This value is
23
+ # @param content_md5 [String] An MD5 hash of the content to be submitted to the upload destination. This value is
18
24
  # used to determine if the data has been corrupted or tampered with during transit.
19
- # @param [String] resource The resource for the upload destination that you are creating. For example, if you are
25
+ # @param resource [String] The resource for the upload destination that you are creating. For example, if you are
20
26
  # creating an upload destination for the createLegalDisclosure operation of the Messaging API, the `{resource}`
21
27
  # would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be
22
28
  # `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you
23
29
  # are creating an upload destination for an Aplus content document, the `{resource}` would be
24
30
  # `aplus/2020-11-01/contentDocuments` and the path would be
25
31
  # `/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments`.
26
- # @param [String] content_type The content type of the file to be uploaded.
27
- # @return [Hash] The API response
28
- def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil)
32
+ # @param content_type [String] The content type of the file to be uploaded.
33
+ # @param rate_limit [Float] Requests per second
34
+ # @return [Peddler::Response] The API response
35
+ def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil,
36
+ rate_limit: 10.0)
37
+ cannot_sandbox!
38
+
29
39
  path = "/uploads/2020-11-01/uploadDestinations/#{resource}"
30
40
  params = {
31
41
  "marketplaceIds" => marketplace_ids,
@@ -33,7 +43,7 @@ module Peddler
33
43
  "contentType" => content_type,
34
44
  }.compact
35
45
 
36
- rate_limit(10.0).post(path, params:)
46
+ meter(rate_limit).post(path, params:)
37
47
  end
38
48
  end
39
49
  end
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def vendor_direct_fulfillment_inventory_v1(...)
8
+ APIs::VendorDirectFulfillmentInventoryV1.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Direct Fulfillment Inventory Updates
8
14
  #
9
15
  # The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct
@@ -11,13 +17,15 @@ module Peddler
11
17
  class VendorDirectFulfillmentInventoryV1 < API
12
18
  # Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items.
13
19
  #
14
- # @param [Hash] body The request body that contains the inventory update data to submit.
15
- # @param [String] warehouse_id Identifier for the warehouse for which to update inventory.
16
- # @return [Hash] The API response
17
- def submit_inventory_update(body, warehouse_id)
20
+ # @note This operation can make a static sandbox call.
21
+ # @param body [Hash] The request body containing the inventory update data to submit.
22
+ # @param warehouse_id [String] Identifier for the warehouse for which to update inventory.
23
+ # @param rate_limit [Float] Requests per second
24
+ # @return [Peddler::Response] The API response
25
+ def submit_inventory_update(body, warehouse_id, rate_limit: 10.0)
18
26
  path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items"
19
27
 
20
- rate_limit(10.0).post(path, body:)
28
+ meter(rate_limit).post(path, body:)
21
29
  end
22
30
  end
23
31
  end
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def vendor_direct_fulfillment_orders_2021_12_28(...)
8
+ APIs::VendorDirectFulfillmentOrders20211228.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Direct Fulfillment Orders
8
14
  #
9
15
  # The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment
@@ -15,23 +21,25 @@ module Peddler
15
21
  # a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
16
22
  # order.
17
23
  #
18
- # @param [String] ship_from_party_id The vendor warehouse identifier for the fulfillment warehouse. If not
24
+ # @note This operation can make a dynamic sandbox call.
25
+ # @param ship_from_party_id [String] The vendor warehouse identifier for the fulfillment warehouse. If not
19
26
  # specified, the result will contain orders for all warehouses.
20
- # @param [String] status Returns only the purchase orders that match the specified status. If not specified, the
27
+ # @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
21
28
  # result will contain orders that match any status.
22
- # @param [Integer] limit The limit to the number of purchase orders returned.
23
- # @param [String] created_after Purchase orders that became available after this date and time will be included in
29
+ # @param limit [Integer] The limit to the number of purchase orders returned.
30
+ # @param created_after [String] Purchase orders that became available after this date and time will be included in
24
31
  # the result. Must be in ISO-8601 date/time format.
25
- # @param [String] created_before Purchase orders that became available before this date and time will be included
32
+ # @param created_before [String] Purchase orders that became available before this date and time will be included
26
33
  # in the result. Must be in ISO-8601 date/time format.
27
- # @param [String] sort_order Sort the list in ascending or descending order by order creation date.
28
- # @param [String] next_token Used for pagination when there are more orders than the specified result size limit.
34
+ # @param sort_order [String] Sort the list in ascending or descending order by order creation date.
35
+ # @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
29
36
  # The token value is returned in the previous API call.
30
- # @param [String] include_details When true, returns the complete purchase order details. Otherwise, only purchase
37
+ # @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
31
38
  # order numbers are returned.
32
- # @return [Hash] The API response
33
- def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil,
34
- sort_order: nil, next_token: nil, include_details: nil)
39
+ # @param rate_limit [Float] Requests per second
40
+ # @return [Peddler::Response] The API response
41
+ def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil,
42
+ next_token: nil, include_details: "true", rate_limit: 10.0)
35
43
  path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders"
36
44
  params = {
37
45
  "shipFromPartyId" => ship_from_party_id,
@@ -44,28 +52,32 @@ module Peddler
44
52
  "includeDetails" => include_details,
45
53
  }.compact
46
54
 
47
- rate_limit(10.0).get(path, params:)
55
+ meter(rate_limit).get(path, params:)
48
56
  end
49
57
 
50
58
  # Returns purchase order information for the purchaseOrderNumber that you specify.
51
59
  #
52
- # @param [String] purchase_order_number The order identifier for the purchase order that you want. Formatting
60
+ # @note This operation can make a dynamic sandbox call.
61
+ # @param purchase_order_number [String] The order identifier for the purchase order that you want. Formatting
53
62
  # Notes: alpha-numeric code.
54
- # @return [Hash] The API response
55
- def get_order(purchase_order_number)
63
+ # @param rate_limit [Float] Requests per second
64
+ # @return [Peddler::Response] The API response
65
+ def get_order(purchase_order_number, rate_limit: 10.0)
56
66
  path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"
57
67
 
58
- rate_limit(10.0).get(path)
68
+ meter(rate_limit).get(path)
59
69
  end
60
70
 
61
71
  # Submits acknowledgements for one or more purchase orders.
62
72
  #
63
- # @param [Hash] body The request body containing the acknowledgement to an order
64
- # @return [Hash] The API response
65
- def submit_acknowledgement(body)
73
+ # @note This operation can make a dynamic sandbox call.
74
+ # @param body [Hash] The request body containing the acknowledgement to an order
75
+ # @param rate_limit [Float] Requests per second
76
+ # @return [Peddler::Response] The API response
77
+ def submit_acknowledgement(body, rate_limit: 10.0)
66
78
  path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements"
67
79
 
68
- rate_limit(10.0).post(path, body:)
80
+ meter(rate_limit).post(path, body:)
69
81
  end
70
82
  end
71
83
  end
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def vendor_direct_fulfillment_orders_v1(...)
8
+ APIs::VendorDirectFulfillmentOrdersV1.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Direct Fulfillment Orders
8
14
  #
9
15
  # The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment
@@ -15,23 +21,25 @@ module Peddler
15
21
  # a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
16
22
  # order.
17
23
  #
18
- # @param [String] ship_from_party_id The vendor warehouse identifier for the fulfillment warehouse. If not
24
+ # @note This operation can make a static sandbox call.
25
+ # @param ship_from_party_id [String] The vendor warehouse identifier for the fulfillment warehouse. If not
19
26
  # specified, the result will contain orders for all warehouses.
20
- # @param [String] status Returns only the purchase orders that match the specified status. If not specified, the
27
+ # @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
21
28
  # result will contain orders that match any status.
22
- # @param [Integer] limit The limit to the number of purchase orders returned.
23
- # @param [String] created_after Purchase orders that became available after this date and time will be included in
29
+ # @param limit [Integer] The limit to the number of purchase orders returned.
30
+ # @param created_after [String] Purchase orders that became available after this date and time will be included in
24
31
  # the result. Must be in ISO-8601 date/time format.
25
- # @param [String] created_before Purchase orders that became available before this date and time will be included
32
+ # @param created_before [String] Purchase orders that became available before this date and time will be included
26
33
  # in the result. Must be in ISO-8601 date/time format.
27
- # @param [String] sort_order Sort the list in ascending or descending order by order creation date.
28
- # @param [String] next_token Used for pagination when there are more orders than the specified result size limit.
34
+ # @param sort_order [String] Sort the list in ascending or descending order by order creation date.
35
+ # @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
29
36
  # The token value is returned in the previous API call.
30
- # @param [String] include_details When true, returns the complete purchase order details. Otherwise, only purchase
37
+ # @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
31
38
  # order numbers are returned.
32
- # @return [Hash] The API response
33
- def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil,
34
- sort_order: nil, next_token: nil, include_details: nil)
39
+ # @param rate_limit [Float] Requests per second
40
+ # @return [Peddler::Response] The API response
41
+ def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil,
42
+ next_token: nil, include_details: "true", rate_limit: 10.0)
35
43
  path = "/vendor/directFulfillment/orders/v1/purchaseOrders"
36
44
  params = {
37
45
  "shipFromPartyId" => ship_from_party_id,
@@ -44,28 +52,32 @@ module Peddler
44
52
  "includeDetails" => include_details,
45
53
  }.compact
46
54
 
47
- rate_limit(10.0).get(path, params:)
55
+ meter(rate_limit).get(path, params:)
48
56
  end
49
57
 
50
58
  # Returns purchase order information for the purchaseOrderNumber that you specify.
51
59
  #
52
- # @param [String] purchase_order_number The order identifier for the purchase order that you want. Formatting
60
+ # @note This operation can make a static sandbox call.
61
+ # @param purchase_order_number [String] The order identifier for the purchase order that you want. Formatting
53
62
  # Notes: alpha-numeric code.
54
- # @return [Hash] The API response
55
- def get_order(purchase_order_number)
63
+ # @param rate_limit [Float] Requests per second
64
+ # @return [Peddler::Response] The API response
65
+ def get_order(purchase_order_number, rate_limit: 10.0)
56
66
  path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{purchase_order_number}"
57
67
 
58
- rate_limit(10.0).get(path)
68
+ meter(rate_limit).get(path)
59
69
  end
60
70
 
61
71
  # Submits acknowledgements for one or more purchase orders.
62
72
  #
63
- # @param [Hash] body The request body that contains the order acknowledgement.
64
- # @return [Hash] The API response
65
- def submit_acknowledgement(body)
73
+ # @note This operation can make a static sandbox call.
74
+ # @param body [Hash] The request body containing the acknowledgement to an order.
75
+ # @param rate_limit [Float] Requests per second
76
+ # @return [Peddler::Response] The API response
77
+ def submit_acknowledgement(body, rate_limit: 10.0)
66
78
  path = "/vendor/directFulfillment/orders/v1/acknowledgements"
67
79
 
68
- rate_limit(10.0).post(path, body:)
80
+ meter(rate_limit).post(path, body:)
69
81
  end
70
82
  end
71
83
  end
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def vendor_direct_fulfillment_payments_v1(...)
8
+ APIs::VendorDirectFulfillmentPaymentsV1.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Direct Fulfillment Payments
8
14
  #
9
15
  # The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment
@@ -11,12 +17,14 @@ module Peddler
11
17
  class VendorDirectFulfillmentPaymentsV1 < API
12
18
  # Submits one or more invoices for a vendor's direct fulfillment orders.
13
19
  #
14
- # @param [Hash] body The request body that contains one or more invoices for vendor orders.
15
- # @return [Hash] The API response
16
- def submit_invoice(body)
20
+ # @note This operation can make a static sandbox call.
21
+ # @param body [Hash] The request body containing one or more invoices for vendor orders.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Peddler::Response] The API response
24
+ def submit_invoice(body, rate_limit: 10.0)
17
25
  path = "/vendor/directFulfillment/payments/v1/invoices"
18
26
 
19
- rate_limit(10.0).post(path, body:)
27
+ meter(rate_limit).post(path, body:)
20
28
  end
21
29
  end
22
30
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_sandbox_test_data_2021_10_28(...)
8
+ APIs::VendorDirectFulfillmentSandboxTestData20211028.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
13
+ # Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data
14
+ #
15
+ # The Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data provides programmatic access to vendor
16
+ # direct fulfillment sandbox test data.
17
+ class VendorDirectFulfillmentSandboxTestData20211028 < API
18
+ # Submits a request to generate test order data for Vendor Direct Fulfillment API entities.
19
+ #
20
+ # @note This operation can make a dynamic sandbox call.
21
+ # @param body [Hash] The request payload containing parameters for generating test order data scenarios.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Peddler::Response] The API response
24
+ def generate_order_scenarios(body, rate_limit: nil)
25
+ path = "/vendor/directFulfillment/sandbox/2021-10-28/orders"
26
+
27
+ post(path, body:)
28
+ end
29
+
30
+ # Returns the status of the transaction indicated by the specified transactionId. If the transaction was
31
+ # successful, also returns the requested test order data.
32
+ #
33
+ # @note This operation can make a dynamic sandbox call.
34
+ # @param transaction_id [String] The transaction identifier returned in the response to the generateOrderScenarios
35
+ # operation.
36
+ # @param rate_limit [Float] Requests per second
37
+ # @return [Peddler::Response] The API response
38
+ def get_order_scenarios(transaction_id, rate_limit: nil)
39
+ path = "/vendor/directFulfillment/sandbox/2021-10-28/transactions/#{transaction_id}"
40
+
41
+ get(path)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -3,7 +3,13 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
6
+ class << self
7
+ def vendor_direct_fulfillment_shipping_2021_12_28(...)
8
+ APIs::VendorDirectFulfillmentShipping20211228.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
7
13
  # Selling Partner API for Direct Fulfillment Shipping
8
14
  #
9
15
  # The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment
@@ -13,19 +19,21 @@ module Peddler
13
19
  # using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
14
20
  # search must not be more than 7 days.
15
21
  #
16
- # @param [String] ship_from_party_id The vendor warehouseId for order fulfillment. If not specified, the result
22
+ # @note This operation can make a dynamic sandbox call.
23
+ # @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified, the result
17
24
  # will contain orders for all warehouses.
18
- # @param [Integer] limit The limit to the number of records returned.
19
- # @param [String] created_after Shipping labels that became available after this date and time will be included in
25
+ # @param limit [Integer] The limit to the number of records returned.
26
+ # @param created_after [String] Shipping labels that became available after this date and time will be included in
20
27
  # the result. Must be in ISO-8601 date/time format.
21
- # @param [String] created_before Shipping labels that became available before this date and time will be included
28
+ # @param created_before [String] Shipping labels that became available before this date and time will be included
22
29
  # in the result. Must be in ISO-8601 date/time format.
23
- # @param [String] sort_order Sort ASC or DESC by order creation date.
24
- # @param [String] next_token Used for pagination when there are more ship labels than the specified result size
30
+ # @param sort_order [String] Sort ASC or DESC by order creation date.
31
+ # @param next_token [String] Used for pagination when there are more ship labels than the specified result size
25
32
  # limit. The token value is returned in the previous API call.
26
- # @return [Hash] The API response
27
- def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
28
- next_token: nil)
33
+ # @param rate_limit [Float] Requests per second
34
+ # @return [Peddler::Response] The API response
35
+ def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
36
+ next_token: nil, rate_limit: 10.0)
29
37
  path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
30
38
  params = {
31
39
  "shipFromPartyId" => ship_from_party_id,
@@ -36,81 +44,93 @@ module Peddler
36
44
  "nextToken" => next_token,
37
45
  }.compact
38
46
 
39
- rate_limit(10.0).get(path, params:)
47
+ meter(rate_limit).get(path, params:)
40
48
  end
41
49
 
42
50
  # Creates a shipping label for a purchase order and returns a transactionId for reference.
43
51
  #
44
- # @param [Hash] body Request body that contains the shipping labels data.
45
- # @return [Hash] The API response
46
- def submit_shipping_label_request(body)
52
+ # @note This operation can make a dynamic sandbox call.
53
+ # @param body [Hash] Request body containing the shipping labels data.
54
+ # @param rate_limit [Float] Requests per second
55
+ # @return [Peddler::Response] The API response
56
+ def submit_shipping_label_request(body, rate_limit: 10.0)
47
57
  path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
48
58
 
49
- rate_limit(10.0).post(path, body:)
59
+ meter(rate_limit).post(path, body:)
50
60
  end
51
61
 
52
62
  # Returns a shipping label for the purchaseOrderNumber that you specify.
53
63
  #
54
- # @param [String] purchase_order_number The purchase order number for which you want to return the shipping label.
55
- # Should be the same `purchaseOrderNumber` as received in the order.
56
- # @return [Hash] The API response
57
- def get_shipping_label(purchase_order_number)
64
+ # @note This operation can make a dynamic sandbox call.
65
+ # @param purchase_order_number [String] The purchase order number for which you want to return the shipping label
66
+ # and should be the same purchaseOrderNumber as received in the order.
67
+ # @param rate_limit [Float] Requests per second
68
+ # @return [Peddler::Response] The API response
69
+ def get_shipping_label(purchase_order_number, rate_limit: 10.0)
58
70
  path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
59
71
 
60
- rate_limit(10.0).get(path)
72
+ meter(rate_limit).get(path)
61
73
  end
62
74
 
63
75
  # Creates shipping labels for a purchase order and returns the labels.
64
76
  #
65
- # @param [String] purchase_order_number The purchase order number for which you want to return the shipping
77
+ # @note This operation can make a dynamic sandbox call.
78
+ # @param purchase_order_number [String] The purchase order number for which you want to return the shipping
66
79
  # labels. It should be the same purchaseOrderNumber as received in the order.
67
- # @param [Hash] body The request payload that contains parameters for creating shipping labels.
68
- # @return [Hash] The API response
69
- def create_shipping_labels(purchase_order_number, body)
80
+ # @param body [Hash] The request payload containing parameters for creating shipping labels.
81
+ # @param rate_limit [Float] Requests per second
82
+ # @return [Peddler::Response] The API response
83
+ def create_shipping_labels(purchase_order_number, body, rate_limit: 10.0)
70
84
  path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
71
85
 
72
- rate_limit(10.0).post(path, body:)
86
+ meter(rate_limit).post(path, body:)
73
87
  end
74
88
 
75
89
  # Submits one or more shipment confirmations for vendor orders.
76
90
  #
77
- # @param [Hash] body Request body containing the shipment confirmations data.
78
- # @return [Hash] The API response
79
- def submit_shipment_confirmations(body)
91
+ # @note This operation can make a dynamic sandbox call.
92
+ # @param body [Hash] Request body containing the shipment confirmations data.
93
+ # @param rate_limit [Float] Requests per second
94
+ # @return [Peddler::Response] The API response
95
+ def submit_shipment_confirmations(body, rate_limit: 10.0)
80
96
  path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentConfirmations"
81
97
 
82
- rate_limit(10.0).post(path, body:)
98
+ meter(rate_limit).post(path, body:)
83
99
  end
84
100
 
85
101
  # This operation is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API submits a shipment
86
102
  # status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their
87
103
  # order, when the package is outside of Amazon Network visibility.
88
104
  #
89
- # @param [Hash] body Request body that contains the shipment status update data.
90
- # @return [Hash] The API response
91
- def submit_shipment_status_updates(body)
105
+ # @note This operation can make a dynamic sandbox call.
106
+ # @param body [Hash] Request body containing the shipment status update data.
107
+ # @param rate_limit [Float] Requests per second
108
+ # @return [Peddler::Response] The API response
109
+ def submit_shipment_status_updates(body, rate_limit: 10.0)
92
110
  path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentStatusUpdates"
93
111
 
94
- rate_limit(10.0).post(path, body:)
112
+ meter(rate_limit).post(path, body:)
95
113
  end
96
114
 
97
115
  # Returns a list of customer invoices created during a time frame that you specify. You define the time frame
98
116
  # using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
99
117
  # search must be no more than 7 days.
100
118
  #
101
- # @param [String] ship_from_party_id The vendor warehouseId for order fulfillment. If not specified, the result
119
+ # @note This operation can make a dynamic sandbox call.
120
+ # @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified, the result
102
121
  # will contain orders for all warehouses.
103
- # @param [Integer] limit The limit to the number of records returned
104
- # @param [String] created_after Orders that became available after this date and time will be included in the
122
+ # @param limit [Integer] The limit to the number of records returned
123
+ # @param created_after [String] Orders that became available after this date and time will be included in the
105
124
  # result. Must be in ISO-8601 date/time format.
106
- # @param [String] created_before Orders that became available before this date and time will be included in the
125
+ # @param created_before [String] Orders that became available before this date and time will be included in the
107
126
  # result. Must be in ISO-8601 date/time format.
108
- # @param [String] sort_order Sort ASC or DESC by order creation date.
109
- # @param [String] next_token Used for pagination when there are more orders than the specified result size limit.
127
+ # @param sort_order [String] Sort ASC or DESC by order creation date.
128
+ # @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
110
129
  # The token value is returned in the previous API call.
111
- # @return [Hash] The API response
130
+ # @param rate_limit [Float] Requests per second
131
+ # @return [Peddler::Response] The API response
112
132
  def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
113
- next_token: nil)
133
+ next_token: nil, rate_limit: 10.0)
114
134
  path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices"
115
135
  params = {
116
136
  "shipFromPartyId" => ship_from_party_id,
@@ -121,35 +141,39 @@ module Peddler
121
141
  "nextToken" => next_token,
122
142
  }.compact
123
143
 
124
- rate_limit(10.0).get(path, params:)
144
+ meter(rate_limit).get(path, params:)
125
145
  end
126
146
 
127
147
  # Returns a customer invoice based on the purchaseOrderNumber that you specify.
128
148
  #
129
- # @param [String] purchase_order_number Purchase order number of the shipment for which to return the invoice.
130
- # @return [Hash] The API response
131
- def get_customer_invoice(purchase_order_number)
149
+ # @note This operation can make a dynamic sandbox call.
150
+ # @param purchase_order_number [String] Purchase order number of the shipment for which to return the invoice.
151
+ # @param rate_limit [Float] Requests per second
152
+ # @return [Peddler::Response] The API response
153
+ def get_customer_invoice(purchase_order_number, rate_limit: 10.0)
132
154
  path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices/#{purchase_order_number}"
133
155
 
134
- rate_limit(10.0).get(path)
156
+ meter(rate_limit).get(path)
135
157
  end
136
158
 
137
159
  # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search
138
160
  # must not be more than 7 days.
139
161
  #
140
- # @param [String] ship_from_party_id The vendor warehouseId for order fulfillment. If not specified the result
162
+ # @note This operation can make a dynamic sandbox call.
163
+ # @param ship_from_party_id [String] The vendor warehouseId for order fulfillment. If not specified the result
141
164
  # will contain orders for all warehouses.
142
- # @param [Integer] limit The limit to the number of records returned
143
- # @param [String] created_after Packing slips that became available after this date and time will be included in
165
+ # @param limit [Integer] The limit to the number of records returned
166
+ # @param created_after [String] Packing slips that became available after this date and time will be included in
144
167
  # the result. Must be in ISO-8601 date/time format.
145
- # @param [String] created_before Packing slips that became available before this date and time will be included in
168
+ # @param created_before [String] Packing slips that became available before this date and time will be included in
146
169
  # the result. Must be in ISO-8601 date/time format.
147
- # @param [String] sort_order Sort ASC or DESC by packing slip creation date.
148
- # @param [String] next_token Used for pagination when there are more packing slips than the specified result size
170
+ # @param sort_order [String] Sort ASC or DESC by packing slip creation date.
171
+ # @param next_token [String] Used for pagination when there are more packing slips than the specified result size
149
172
  # limit. The token value is returned in the previous API call.
150
- # @return [Hash] The API response
151
- def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
152
- next_token: nil)
173
+ # @param rate_limit [Float] Requests per second
174
+ # @return [Peddler::Response] The API response
175
+ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
176
+ next_token: nil, rate_limit: 10.0)
153
177
  path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips"
154
178
  params = {
155
179
  "shipFromPartyId" => ship_from_party_id,
@@ -160,17 +184,19 @@ module Peddler
160
184
  "nextToken" => next_token,
161
185
  }.compact
162
186
 
163
- rate_limit(10.0).get(path, params:)
187
+ meter(rate_limit).get(path, params:)
164
188
  end
165
189
 
166
190
  # Returns a packing slip based on the purchaseOrderNumber that you specify.
167
191
  #
168
- # @param [String] purchase_order_number The purchaseOrderNumber for the packing slip you want.
169
- # @return [Hash] The API response
170
- def get_packing_slip(purchase_order_number)
192
+ # @note This operation can make a dynamic sandbox call.
193
+ # @param purchase_order_number [String] The purchaseOrderNumber for the packing slip you want.
194
+ # @param rate_limit [Float] Requests per second
195
+ # @return [Peddler::Response] The API response
196
+ def get_packing_slip(purchase_order_number, rate_limit: 10.0)
171
197
  path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips/#{purchase_order_number}"
172
198
 
173
- rate_limit(10.0).get(path)
199
+ meter(rate_limit).get(path)
174
200
  end
175
201
  end
176
202
  end