peddler 2.4.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +402 -140
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
  9. data/lib/peddler/api/catalog_items_v0.rb +103 -0
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
  13. data/lib/peddler/api/fba_inventory_v1.rb +122 -0
  14. data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +148 -0
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
  25. data/lib/peddler/api/messaging_v1.rb +273 -0
  26. data/lib/peddler/api/notifications_v1.rb +145 -0
  27. data/lib/peddler/api/orders_v0.rb +279 -0
  28. data/lib/peddler/api/product_fees_v0.rb +77 -0
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
  30. data/lib/peddler/api/product_pricing_v0.rb +162 -0
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
  33. data/lib/peddler/api/reports_2021_06_30.rb +163 -0
  34. data/lib/peddler/api/sales_v1.rb +77 -0
  35. data/lib/peddler/api/sellers_v1.rb +45 -0
  36. data/lib/peddler/api/services_v1.rb +348 -0
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
  38. data/lib/peddler/api/shipping_v1.rb +132 -0
  39. data/lib/peddler/api/shipping_v2.rb +319 -0
  40. data/lib/peddler/api/solicitations_v1.rb +63 -0
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
  42. data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
  43. data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
  53. data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
  54. data/lib/peddler/api/vendor_orders_v1.rb +159 -0
  55. data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
  57. data/lib/peddler/api.rb +138 -0
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +31 -0
  60. data/lib/peddler/marketplace.rb +38 -68
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -1
  64. metadata +74 -80
  65. data/lib/mws/easy_ship/client.rb +0 -93
  66. data/lib/mws/easy_ship.rb +0 -3
  67. data/lib/mws/feeds/client.rb +0 -122
  68. data/lib/mws/feeds.rb +0 -3
  69. data/lib/mws/finances/client.rb +0 -82
  70. data/lib/mws/finances.rb +0 -3
  71. data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
  72. data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
  73. data/lib/mws/fulfillment_inventory/client.rb +0 -57
  74. data/lib/mws/fulfillment_inventory.rb +0 -3
  75. data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
  76. data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
  77. data/lib/mws/merchant_fulfillment/client.rb +0 -87
  78. data/lib/mws/merchant_fulfillment.rb +0 -3
  79. data/lib/mws/off_amazon_payments.rb +0 -3
  80. data/lib/mws/orders/client.rb +0 -120
  81. data/lib/mws/orders.rb +0 -3
  82. data/lib/mws/products/client.rb +0 -268
  83. data/lib/mws/products.rb +0 -3
  84. data/lib/mws/recommendations/client.rb +0 -72
  85. data/lib/mws/recommendations.rb +0 -3
  86. data/lib/mws/reports/client.rb +0 -236
  87. data/lib/mws/reports.rb +0 -3
  88. data/lib/mws/sellers/client.rb +0 -44
  89. data/lib/mws/sellers.rb +0 -3
  90. data/lib/mws/shipment_invoicing/client.rb +0 -74
  91. data/lib/mws/shipment_invoicing.rb +0 -3
  92. data/lib/mws/subscriptions/client.rb +0 -179
  93. data/lib/mws/subscriptions.rb +0 -3
  94. data/lib/mws.rb +0 -29
  95. data/lib/peddler/client.rb +0 -159
  96. data/lib/peddler/errors/builder.rb +0 -64
  97. data/lib/peddler/errors/class_generator.rb +0 -40
  98. data/lib/peddler/errors/error.rb +0 -45
  99. data/lib/peddler/errors/parser.rb +0 -28
  100. data/lib/peddler/flat_file_parser.rb +0 -56
  101. data/lib/peddler/headers.rb +0 -102
  102. data/lib/peddler/operation.rb +0 -78
  103. data/lib/peddler/parser.rb +0 -33
  104. data/lib/peddler/structured_list.rb +0 -23
  105. data/lib/peddler/vcr_matcher.rb +0 -97
  106. data/lib/peddler/xml_parser.rb +0 -38
  107. data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_orders_2021_12_28(...)
8
+ API::VendorDirectFulfillmentOrders20211228.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Orders
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment
16
+ # vendor's order data.
17
+ class VendorDirectFulfillmentOrders20211228 < API
18
+ # Returns a list of purchase orders created during the time frame that you specify. You define the time frame
19
+ # using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only
20
+ # the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns
21
+ # a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
22
+ # order.
23
+ #
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
26
+ # specified, the result will contain orders for all warehouses.
27
+ # @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
28
+ # result will contain orders that match any status.
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
31
+ # the result. Must be in ISO-8601 date/time format.
32
+ # @param created_before [String] Purchase orders that became available before this date and time will be included
33
+ # in the result. Must be in ISO-8601 date/time format.
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.
36
+ # The token value is returned in the previous API call.
37
+ # @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
38
+ # order numbers are returned.
39
+ # @param rate_limit [Float] Requests per second
40
+ # @return [Hash] 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)
43
+ path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders"
44
+ params = {
45
+ "shipFromPartyId" => ship_from_party_id,
46
+ "status" => status,
47
+ "limit" => limit,
48
+ "createdAfter" => created_after,
49
+ "createdBefore" => created_before,
50
+ "sortOrder" => sort_order,
51
+ "nextToken" => next_token,
52
+ "includeDetails" => include_details,
53
+ }.compact
54
+
55
+ meter(rate_limit).get(path, params:)
56
+ end
57
+
58
+ # Returns purchase order information for the purchaseOrderNumber that you specify.
59
+ #
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
62
+ # Notes: alpha-numeric code.
63
+ # @param rate_limit [Float] Requests per second
64
+ # @return [Hash] The API response
65
+ def get_order(purchase_order_number, rate_limit: 10.0)
66
+ path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"
67
+
68
+ meter(rate_limit).get(path)
69
+ end
70
+
71
+ # Submits acknowledgements for one or more purchase orders.
72
+ #
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 [Hash] The API response
77
+ def submit_acknowledgement(body, rate_limit: 10.0)
78
+ path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements"
79
+
80
+ meter(rate_limit).post(path, body:)
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_orders_v1(...)
8
+ API::VendorDirectFulfillmentOrdersV1.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Orders
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment
16
+ # vendor's order data.
17
+ class VendorDirectFulfillmentOrdersV1 < API
18
+ # Returns a list of purchase orders created during the time frame that you specify. You define the time frame
19
+ # using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only
20
+ # the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns
21
+ # a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
22
+ # order.
23
+ #
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
26
+ # specified, the result will contain orders for all warehouses.
27
+ # @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
28
+ # result will contain orders that match any status.
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
31
+ # the result. Must be in ISO-8601 date/time format.
32
+ # @param created_before [String] Purchase orders that became available before this date and time will be included
33
+ # in the result. Must be in ISO-8601 date/time format.
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.
36
+ # The token value is returned in the previous API call.
37
+ # @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
38
+ # order numbers are returned.
39
+ # @param rate_limit [Float] Requests per second
40
+ # @return [Hash] 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)
43
+ path = "/vendor/directFulfillment/orders/v1/purchaseOrders"
44
+ params = {
45
+ "shipFromPartyId" => ship_from_party_id,
46
+ "status" => status,
47
+ "limit" => limit,
48
+ "createdAfter" => created_after,
49
+ "createdBefore" => created_before,
50
+ "sortOrder" => sort_order,
51
+ "nextToken" => next_token,
52
+ "includeDetails" => include_details,
53
+ }.compact
54
+
55
+ meter(rate_limit).get(path, params:)
56
+ end
57
+
58
+ # Returns purchase order information for the purchaseOrderNumber that you specify.
59
+ #
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
62
+ # Notes: alpha-numeric code.
63
+ # @param rate_limit [Float] Requests per second
64
+ # @return [Hash] The API response
65
+ def get_order(purchase_order_number, rate_limit: 10.0)
66
+ path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{purchase_order_number}"
67
+
68
+ meter(rate_limit).get(path)
69
+ end
70
+
71
+ # Submits acknowledgements for one or more purchase orders.
72
+ #
73
+ # @note This operation can make a static sandbox call.
74
+ # @param body [Hash] The request body that contains the order acknowledgement.
75
+ # @param rate_limit [Float] Requests per second
76
+ # @return [Hash] The API response
77
+ def submit_acknowledgement(body, rate_limit: 10.0)
78
+ path = "/vendor/directFulfillment/orders/v1/acknowledgements"
79
+
80
+ meter(rate_limit).post(path, body:)
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_payments_v1(...)
8
+ API::VendorDirectFulfillmentPaymentsV1.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Payments
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment
16
+ # vendor's invoice data.
17
+ class VendorDirectFulfillmentPaymentsV1 < API
18
+ # Submits one or more invoices for a vendor's direct fulfillment orders.
19
+ #
20
+ # @note This operation can make a static sandbox call.
21
+ # @param body [Hash] The request body that contains one or more invoices for vendor orders.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Hash] The API response
24
+ def submit_invoice(body, rate_limit: 10.0)
25
+ path = "/vendor/directFulfillment/payments/v1/invoices"
26
+
27
+ meter(rate_limit).post(path, body:)
28
+ end
29
+ end
30
+ end
31
+ 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
+ API::VendorDirectFulfillmentSandboxTestData20211028.new(...)
9
+ end
10
+ end
11
+
12
+ class API
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 that contain parameters to generate test order data scenarios.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Hash] 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
+ # Retrieves the transaction status identified by the specified `transactionId`, and returns the requested test
31
+ # order data if the transaction is successful.
32
+ #
33
+ # @note This operation can make a dynamic sandbox call.
34
+ # @param transaction_id [String] The transaction identifier returned in the response for the
35
+ # `generateOrderScenarios` operation.
36
+ # @param rate_limit [Float] Requests per second
37
+ # @return [Hash] 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
@@ -0,0 +1,203 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_shipping_2021_12_28(...)
8
+ API::VendorDirectFulfillmentShipping20211228.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Shipping
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment
16
+ # vendor's shipping data.
17
+ class VendorDirectFulfillmentShipping20211228 < API
18
+ # Returns a list of shipping labels created during the time frame that you specify. You define that time frame
19
+ # using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
20
+ # search must not be more than 7 days.
21
+ #
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
24
+ # will contain orders for all warehouses.
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
27
+ # the result. Must be in ISO-8601 date/time format.
28
+ # @param created_before [String] Shipping labels that became available before this date and time will be included
29
+ # in the result. Must be in ISO-8601 date/time format.
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
32
+ # limit. The token value is returned in the previous API call.
33
+ # @param rate_limit [Float] Requests per second
34
+ # @return [Hash] 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)
37
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
38
+ params = {
39
+ "shipFromPartyId" => ship_from_party_id,
40
+ "limit" => limit,
41
+ "createdAfter" => created_after,
42
+ "createdBefore" => created_before,
43
+ "sortOrder" => sort_order,
44
+ "nextToken" => next_token,
45
+ }.compact
46
+
47
+ meter(rate_limit).get(path, params:)
48
+ end
49
+
50
+ # Creates a shipping label for a purchase order and returns a transactionId for reference.
51
+ #
52
+ # @note This operation can make a dynamic sandbox call.
53
+ # @param body [Hash] Request body that contains the shipping labels data.
54
+ # @param rate_limit [Float] Requests per second
55
+ # @return [Hash] The API response
56
+ def submit_shipping_label_request(body, rate_limit: 10.0)
57
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
58
+
59
+ meter(rate_limit).post(path, body:)
60
+ end
61
+
62
+ # Returns a shipping label for the purchaseOrderNumber that you specify.
63
+ #
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
+ # Should be the same `purchaseOrderNumber` as received in the order.
67
+ # @param rate_limit [Float] Requests per second
68
+ # @return [Hash] The API response
69
+ def get_shipping_label(purchase_order_number, rate_limit: 10.0)
70
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
71
+
72
+ meter(rate_limit).get(path)
73
+ end
74
+
75
+ # Creates shipping labels for a purchase order and returns the labels.
76
+ #
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
79
+ # labels. It should be the same purchaseOrderNumber as received in the order.
80
+ # @param body [Hash] The request payload that contains parameters for creating shipping labels.
81
+ # @param rate_limit [Float] Requests per second
82
+ # @return [Hash] The API response
83
+ def create_shipping_labels(purchase_order_number, body, rate_limit: 10.0)
84
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
85
+
86
+ meter(rate_limit).post(path, body:)
87
+ end
88
+
89
+ # Submits one or more shipment confirmations for vendor orders.
90
+ #
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 [Hash] The API response
95
+ def submit_shipment_confirmations(body, rate_limit: 10.0)
96
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentConfirmations"
97
+
98
+ meter(rate_limit).post(path, body:)
99
+ end
100
+
101
+ # This operation is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API submits a shipment
102
+ # status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their
103
+ # order, when the package is outside of Amazon Network visibility.
104
+ #
105
+ # @note This operation can make a dynamic sandbox call.
106
+ # @param body [Hash] Request body that contains the shipment status update data.
107
+ # @param rate_limit [Float] Requests per second
108
+ # @return [Hash] The API response
109
+ def submit_shipment_status_updates(body, rate_limit: 10.0)
110
+ path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentStatusUpdates"
111
+
112
+ meter(rate_limit).post(path, body:)
113
+ end
114
+
115
+ # Returns a list of customer invoices created during a time frame that you specify. You define the time frame
116
+ # using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to
117
+ # search must be no more than 7 days.
118
+ #
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
121
+ # will contain orders for all warehouses.
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
124
+ # result. Must be in ISO-8601 date/time format.
125
+ # @param created_before [String] Orders that became available before this date and time will be included in the
126
+ # result. Must be in ISO-8601 date/time format.
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.
129
+ # The token value is returned in the previous API call.
130
+ # @param rate_limit [Float] Requests per second
131
+ # @return [Hash] The API response
132
+ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
133
+ next_token: nil, rate_limit: 10.0)
134
+ path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices"
135
+ params = {
136
+ "shipFromPartyId" => ship_from_party_id,
137
+ "limit" => limit,
138
+ "createdAfter" => created_after,
139
+ "createdBefore" => created_before,
140
+ "sortOrder" => sort_order,
141
+ "nextToken" => next_token,
142
+ }.compact
143
+
144
+ meter(rate_limit).get(path, params:)
145
+ end
146
+
147
+ # Returns a customer invoice based on the purchaseOrderNumber that you specify.
148
+ #
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 [Hash] The API response
153
+ def get_customer_invoice(purchase_order_number, rate_limit: 10.0)
154
+ path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices/#{purchase_order_number}"
155
+
156
+ meter(rate_limit).get(path)
157
+ end
158
+
159
+ # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search
160
+ # must not be more than 7 days.
161
+ #
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
164
+ # will contain orders for all warehouses.
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
167
+ # the result. Must be in ISO-8601 date/time format.
168
+ # @param created_before [String] Packing slips that became available before this date and time will be included in
169
+ # the result. Must be in ISO-8601 date/time format.
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
172
+ # limit. The token value is returned in the previous API call.
173
+ # @param rate_limit [Float] Requests per second
174
+ # @return [Hash] 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)
177
+ path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips"
178
+ params = {
179
+ "shipFromPartyId" => ship_from_party_id,
180
+ "limit" => limit,
181
+ "createdAfter" => created_after,
182
+ "createdBefore" => created_before,
183
+ "sortOrder" => sort_order,
184
+ "nextToken" => next_token,
185
+ }.compact
186
+
187
+ meter(rate_limit).get(path, params:)
188
+ end
189
+
190
+ # Returns a packing slip based on the purchaseOrderNumber that you specify.
191
+ #
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 [Hash] The API response
196
+ def get_packing_slip(purchase_order_number, rate_limit: 10.0)
197
+ path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips/#{purchase_order_number}"
198
+
199
+ meter(rate_limit).get(path)
200
+ end
201
+ end
202
+ end
203
+ end
@@ -0,0 +1,189 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_shipping_v1(...)
8
+ API::VendorDirectFulfillmentShippingV1.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Shipping
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment
16
+ # vendor's shipping data.
17
+ class VendorDirectFulfillmentShippingV1 < API
18
+ # Returns a list of shipping labels created during the time frame that you specify. You define that time frame
19
+ # using the `createdAfter` and `createdBefore` parameters. You must use both of these parameters. The date range
20
+ # to search must not be more than 7 days.
21
+ #
22
+ # @note This operation can make a static sandbox call.
23
+ # @param ship_from_party_id [String] The vendor `warehouseId` for order fulfillment. If not specified, the result
24
+ # will contain orders for all warehouses.
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
27
+ # the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
28
+ # @param created_before [String] Shipping labels that became available before this date and time will be included
29
+ # in the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
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
32
+ # limit. The token value is returned in the previous API call.
33
+ # @param rate_limit [Float] Requests per second
34
+ # @return [Hash] 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)
37
+ path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
38
+ params = {
39
+ "shipFromPartyId" => ship_from_party_id,
40
+ "limit" => limit,
41
+ "createdAfter" => created_after,
42
+ "createdBefore" => created_before,
43
+ "sortOrder" => sort_order,
44
+ "nextToken" => next_token,
45
+ }.compact
46
+
47
+ meter(rate_limit).get(path, params:)
48
+ end
49
+
50
+ # Creates a shipping label for a purchase order and returns a `transactionId` for reference.
51
+ #
52
+ # @note This operation can make a static sandbox call.
53
+ # @param body [Hash] Request body containing one or more shipping labels data.
54
+ # @param rate_limit [Float] Requests per second
55
+ # @return [Hash] The API response
56
+ def submit_shipping_label_request(body, rate_limit: 10.0)
57
+ path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
58
+
59
+ meter(rate_limit).post(path, body:)
60
+ end
61
+
62
+ # Returns a shipping label for the `purchaseOrderNumber` that you specify.
63
+ #
64
+ # @note This operation can make a static sandbox call.
65
+ # @param purchase_order_number [String] The purchase order number for which you want to return the shipping label.
66
+ # It should be the same `purchaseOrderNumber` as received in the order.
67
+ # @param rate_limit [Float] Requests per second
68
+ # @return [Hash] The API response
69
+ def get_shipping_label(purchase_order_number, rate_limit: 10.0)
70
+ path = "/vendor/directFulfillment/shipping/v1/shippingLabels/#{purchase_order_number}"
71
+
72
+ meter(rate_limit).get(path)
73
+ end
74
+
75
+ # Submits one or more shipment confirmations for vendor orders.
76
+ #
77
+ # @note This operation can make a static sandbox call.
78
+ # @param body [Hash] Request body containing the shipment confirmations data.
79
+ # @param rate_limit [Float] Requests per second
80
+ # @return [Hash] The API response
81
+ def submit_shipment_confirmations(body, rate_limit: 10.0)
82
+ path = "/vendor/directFulfillment/shipping/v1/shipmentConfirmations"
83
+
84
+ meter(rate_limit).post(path, body:)
85
+ end
86
+
87
+ # This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment
88
+ # status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their
89
+ # order, when the package is outside of Amazon Network visibility.
90
+ #
91
+ # @note This operation can make a static sandbox call.
92
+ # @param body [Hash] Request body containing the shipment status update data.
93
+ # @param rate_limit [Float] Requests per second
94
+ # @return [Hash] The API response
95
+ def submit_shipment_status_updates(body, rate_limit: 10.0)
96
+ path = "/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates"
97
+
98
+ meter(rate_limit).post(path, body:)
99
+ end
100
+
101
+ # Returns a list of customer invoices created during a time frame that you specify. You define the time frame
102
+ # using the `createdAfter` and `createdBefore` parameters. You must use both of these parameters. The date range
103
+ # to search must be no more than 7 days.
104
+ #
105
+ # @note This operation can make a static sandbox call.
106
+ # @param ship_from_party_id [String] The vendor `warehouseId` for order fulfillment. If not specified, the result
107
+ # will contain orders for all warehouses.
108
+ # @param limit [Integer] The limit to the number of records returned
109
+ # @param created_after [String] Orders that became available after this date and time will be included in the
110
+ # result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
111
+ # @param created_before [String] Orders that became available before this date and time will be included in the
112
+ # result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
113
+ # @param sort_order [String] Sort ASC or DESC by order creation date.
114
+ # @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
115
+ # The token value is returned in the previous API call.
116
+ # @param rate_limit [Float] Requests per second
117
+ # @return [Hash] The API response
118
+ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
119
+ next_token: nil, rate_limit: 10.0)
120
+ path = "/vendor/directFulfillment/shipping/v1/customerInvoices"
121
+ params = {
122
+ "shipFromPartyId" => ship_from_party_id,
123
+ "limit" => limit,
124
+ "createdAfter" => created_after,
125
+ "createdBefore" => created_before,
126
+ "sortOrder" => sort_order,
127
+ "nextToken" => next_token,
128
+ }.compact
129
+
130
+ meter(rate_limit).get(path, params:)
131
+ end
132
+
133
+ # Returns a customer invoice based on the `purchaseOrderNumber` that you specify.
134
+ #
135
+ # @note This operation can make a static sandbox call.
136
+ # @param purchase_order_number [String] Purchase order number of the shipment for which to return the invoice.
137
+ # @param rate_limit [Float] Requests per second
138
+ # @return [Hash] The API response
139
+ def get_customer_invoice(purchase_order_number, rate_limit: 10.0)
140
+ path = "/vendor/directFulfillment/shipping/v1/customerInvoices/#{purchase_order_number}"
141
+
142
+ meter(rate_limit).get(path)
143
+ end
144
+
145
+ # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search
146
+ # must not be more than 7 days.
147
+ #
148
+ # @note This operation can make a static sandbox call.
149
+ # @param ship_from_party_id [String] The vendor `warehouseId` for order fulfillment. If not specified the result
150
+ # will contain orders for all warehouses.
151
+ # @param limit [Integer] The limit to the number of records returned
152
+ # @param created_after [String] Packing slips that became available after this date and time will be included in
153
+ # the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
154
+ # @param created_before [String] Packing slips that became available before this date and time will be included in
155
+ # the result. Must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date/time format.
156
+ # @param sort_order [String] Sort ASC or DESC by packing slip creation date.
157
+ # @param next_token [String] Used for pagination when there are more packing slips than the specified result size
158
+ # limit. The token value is returned in the previous API call.
159
+ # @param rate_limit [Float] Requests per second
160
+ # @return [Hash] The API response
161
+ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: "ASC",
162
+ next_token: nil, rate_limit: 10.0)
163
+ path = "/vendor/directFulfillment/shipping/v1/packingSlips"
164
+ params = {
165
+ "shipFromPartyId" => ship_from_party_id,
166
+ "limit" => limit,
167
+ "createdAfter" => created_after,
168
+ "createdBefore" => created_before,
169
+ "sortOrder" => sort_order,
170
+ "nextToken" => next_token,
171
+ }.compact
172
+
173
+ meter(rate_limit).get(path, params:)
174
+ end
175
+
176
+ # Returns a packing slip based on the `purchaseOrderNumber` that you specify.
177
+ #
178
+ # @note This operation can make a static sandbox call.
179
+ # @param purchase_order_number [String] The `purchaseOrderNumber` for the packing slip you want.
180
+ # @param rate_limit [Float] Requests per second
181
+ # @return [Hash] The API response
182
+ def get_packing_slip(purchase_order_number, rate_limit: 10.0)
183
+ path = "/vendor/directFulfillment/shipping/v1/packingSlips/#{purchase_order_number}"
184
+
185
+ meter(rate_limit).get(path)
186
+ end
187
+ end
188
+ end
189
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def vendor_direct_fulfillment_transactions_2021_12_28(...)
8
+ API::VendorDirectFulfillmentTransactions20211228.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Direct Fulfillment Transaction Status
14
+ #
15
+ # The Selling Partner API for Direct Fulfillment Transaction Status provides programmatic access to a direct
16
+ # fulfillment vendor's transaction status.
17
+ class VendorDirectFulfillmentTransactions20211228 < API
18
+ # Returns the status of the transaction indicated by the specified `transactionId`.
19
+ #
20
+ # @note This operation can make a dynamic sandbox call.
21
+ # @param transaction_id [String] Previously returned in the response to the POST request of a specific
22
+ # transaction.
23
+ # @param rate_limit [Float] Requests per second
24
+ # @return [Hash] The API response
25
+ def get_transaction_status(transaction_id, rate_limit: 10.0)
26
+ path = "/vendor/directFulfillment/transactions/2021-12-28/transactions/#{transaction_id}"
27
+
28
+ meter(rate_limit).get(path)
29
+ end
30
+ end
31
+ end
32
+ end