peddler 2.4.5 → 3.0.0.beta1

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