muffin_man 2.2.2 → 2.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa3142f3ad585c025626b9296b5b697bac037ce987a551f010c4b9e4653fb265
4
- data.tar.gz: b6abba7a9292b49fc6be63976b6866aae79be7dc173d837ceca28e9ba039f312
3
+ metadata.gz: d6ce4c06aa97acdef0dd6d1a1959a89b038fd99dfbdc718e07cd119338137db7
4
+ data.tar.gz: 0bac02da9b9af7875324101073e30e0012215fe8f02bd17c0d53a645528924d6
5
5
  SHA512:
6
- metadata.gz: 062ece67a630646a2b5fa8a117514cb78ce0b1c2db49f80ba25901f76fe75fc1a1e5164459944cc2d36c6f768bb6dccf4296eab70324202bfd69cce56bf07fc1
7
- data.tar.gz: f9bea8a969c5b247699cf530ee251fe929a9228d859212ebc9c822f3e493aafc61b3978246d74f499d4b2eeaf67935c2dcc566c077749af7a72947fe0762424e
6
+ metadata.gz: d7e3add57e41ca34546a36d24a9006a08d059482dc6d9b25b7a9b91d8d4095a89cb19a35a5c3f4b0ea4d6d4d7a30c2c26f4ef32461654598ddf9dbd183c51fdf
7
+ data.tar.gz: 3862fc6c73824469f13ce291e5eb50ddd58d9f07cdc6f6ad9490977e527642a54889003863a84b5d39b15d3aa19bdd9af05ad6c150f846335a8212e04da4e358
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 2.4.1 [#73](https://github.com/patterninc/muffin_man/pull/73)
2
+
3
+ - Support for Listings Restrictions API v2021-08-01
4
+ # 2.4.0 [#72](https://github.com/patterninc/muffin_man/pull/72)
5
+
6
+ - Support for the following:
7
+ Vendor Direct Fulfillment Inventory API v1
8
+ Vendor Direct Fulfillment Orders API v2021-12-28
9
+ Vendor Direct Fulfillment Payments API v1
10
+ Vendor Direct Fulfillment Shipping API v2021-12-28
11
+ Vendor Direct Fulfillment Transactions API v2021-12-28
12
+ Vendor Invoices API v1
13
+ Vendor Orders API v1
14
+ Vendor Shipments API v1
15
+ Vendor Transaction Status API v1
16
+
1
17
  # 2.2.0 [#66](https://github.com/patterninc/muffin_man/pull/66)
2
18
 
3
19
  - Support for Data Kiosk API v2023-11-15
data/README.md CHANGED
@@ -6,17 +6,34 @@ MuffinMan is a ruby interface to the Amazon Selling Partner API. For more inform
6
6
 
7
7
  As of now, this gem only supports portions of the following APIs with more to come:
8
8
 
9
- - `create_product_review_and_seller_feedback_solicitation`
10
- - `catalog_items`
11
- - `data_kiosk`
12
- - `reports`
13
- - `product_fees`
14
- - `product_pricing`
15
- - `fulfillment_inbound`
16
- - `fulfillment_outbound`
17
- - `feeds`
18
- - `notifications`
19
- - `listings`
9
+ - `Amazon Warehousing and Distribution API v2024-05-09`
10
+ - `Catalog Items API v2022-04-01`
11
+ - `Data Kiosk API v2023-11-15`
12
+ - `FBA Inventory API v1`
13
+ - `Feeds API v2021-06-30`
14
+ - `Finances API v0`
15
+ - `Fulfillment Inbound API v2024-03-20`
16
+ - `Fulfillment Outbound API v2020-07-01`
17
+ - `Listings API v2021-08-01`
18
+ - `Listings API v2020-09-01`
19
+ - `Listings Restrictions API v2021-08-01`
20
+ - `Merchant Fulfillment API v0`
21
+ - `Notifications API v1`
22
+ - `Orders API v0`
23
+ - `Product Fees API v0`
24
+ - `Product Pricing API v0`
25
+ - `Reports API v2021-06-30`
26
+ - `Solicitations API v1`
27
+ - `Tokens API v2021-03-01`
28
+ - `Vendor Direct Fulfillment Transactions API v1`
29
+ - `Vendor Direct Fulfillment Orders API v2021-12-28`
30
+ - `Vendor Direct Fulfillment Payments API v1`
31
+ - `Vendor Direct Fulfillment Shipping API v2021-12-28`
32
+ - `Vendor Direct Fulfillment Transactions API v2021-12-28`
33
+ - `Vendor Invoices API v1`
34
+ - `Vendor Orders API v1`
35
+ - `Vendor Shipments API v1`
36
+ - `Vendor Transaction Status API v1`
20
37
 
21
38
  ## Installation
22
39
 
@@ -34,7 +34,7 @@ module MuffinMan
34
34
  ].freeze
35
35
 
36
36
  def get_queries(params = {})
37
- @local_var_path = "/datakiosk/2023-11-15/queries"
37
+ @local_var_path = "/dataKiosk/2023-11-15/queries"
38
38
  if sandbox
39
39
  params = {
40
40
  "pageSize" => SANDBOX_PAGE_SIZE,
@@ -47,7 +47,7 @@ module MuffinMan
47
47
  end
48
48
 
49
49
  def create_query(query, pagination_token = nil)
50
- @local_var_path = "/datakiosk/2023-11-15/queries"
50
+ @local_var_path = "/dataKiosk/2023-11-15/queries"
51
51
  query = SANDBOX_QUERY if sandbox
52
52
  @request_body = {
53
53
  "query" => query
@@ -59,21 +59,21 @@ module MuffinMan
59
59
 
60
60
  def get_query(query_id)
61
61
  query_id = SANDBOX_QUERY_ID if sandbox
62
- @local_var_path = "/datakiosk/2023-11-15/queries/#{query_id}"
62
+ @local_var_path = "/dataKiosk/2023-11-15/queries/#{query_id}"
63
63
  @request_type = "GET"
64
64
  call_api
65
65
  end
66
66
 
67
67
  def cancel_query(query_id)
68
68
  query_id = SANDBOX_QUERY_ID if sandbox
69
- @local_var_path = "/datakiosk/2023-11-15/queries/#{query_id}"
69
+ @local_var_path = "/dataKiosk/2023-11-15/queries/#{query_id}"
70
70
  @request_type = "DELETE"
71
71
  call_api
72
72
  end
73
73
 
74
74
  def get_document(document_id)
75
75
  document_id = SANDBOX_DOCUMENT_ID if sandbox
76
- @local_var_path = "/datakiosk/2023-11-15/documents/#{document_id}"
76
+ @local_var_path = "/dataKiosk/2023-11-15/documents/#{document_id}"
77
77
  @request_type = "GET"
78
78
  call_api
79
79
  end
@@ -17,6 +17,15 @@ module MuffinMan
17
17
  call_api
18
18
  end
19
19
 
20
+ def list_inbound_plan_items(inbound_plan_id, page_size: nil, pagination_token: nil)
21
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/items"
22
+ @query_params = {}
23
+ @query_params["pageSize"] = page_size if page_size
24
+ @query_params["paginationToken"] = pagination_token if pagination_token
25
+ @request_type = "GET"
26
+ call_api
27
+ end
28
+
20
29
  def get_inbound_plan(inbound_plan_id)
21
30
  @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}"
22
31
  @request_type = "GET"
@@ -37,6 +46,176 @@ module MuffinMan
37
46
  @request_type = "GET"
38
47
  call_api
39
48
  end
49
+
50
+ def create_inbound_plan(destination_marketplaces, items, source_address, name: nil)
51
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans"
52
+ @query_params = {}
53
+ @request_body = {
54
+ destinationMarketplaces: Array.wrap(destination_marketplaces),
55
+ items: items,
56
+ sourceAddress: source_address
57
+ }
58
+ @request_body["name"] = name if name
59
+ @request_type = "POST"
60
+ call_api
61
+ end
62
+
63
+ def generate_packing_options(inbound_plan_id)
64
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/packingOptions"
65
+ @request_type = "POST"
66
+ call_api
67
+ end
68
+
69
+ def list_packing_options(inbound_plan_id, page_size: nil, pagination_token: nil)
70
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/packingOptions"
71
+ @query_params = {}
72
+ @query_params["pageSize"] = page_size if page_size
73
+ @query_params["paginationToken"] = pagination_token if pagination_token
74
+ @request_type = "GET"
75
+ call_api
76
+ end
77
+
78
+ def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: nil, pagination_token: nil)
79
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/items"
80
+ @query_params = {}
81
+ @query_params["pageSize"] = page_size if page_size
82
+ @query_params["paginationToken"] = pagination_token if pagination_token
83
+ @request_type = "GET"
84
+ call_api
85
+ end
86
+
87
+ def confirm_packing_option(inbound_plan_id, packing_option_id)
88
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/packingOptions/#{packing_option_id}/confirmation" # rubocop:disable Layout/LineLength
89
+ @request_type = "POST"
90
+ call_api
91
+ end
92
+
93
+ def set_packing_information(inbound_plan_id, body)
94
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/packingInformation"
95
+ @request_body = body
96
+ @request_type = "POST"
97
+ call_api
98
+ end
99
+
100
+ def generate_placement_options(inbound_plan_id)
101
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/placementOptions"
102
+ @request_type = "POST"
103
+ call_api
104
+ end
105
+
106
+ def list_placement_options(inbound_plan_id, page_size: nil, pagination_token: nil)
107
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/placementOptions"
108
+ @query_params = {}
109
+ @query_params["pageSize"] = page_size if page_size
110
+ @query_params["paginationToken"] = pagination_token if pagination_token
111
+ @request_type = "GET"
112
+ call_api
113
+ end
114
+
115
+ def get_inbound_operation_status(operation_id)
116
+ @local_var_path = "#{INBOUND_PATH}/operations/#{operation_id}"
117
+ @request_type = "GET"
118
+ call_api
119
+ end
120
+
121
+ def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
122
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/pallets"
123
+ @query_params = {}
124
+ @query_params["pageSize"] = page_size if page_size
125
+ @query_params["paginationToken"] = pagination_token if pagination_token
126
+ @request_type = "GET"
127
+ call_api
128
+ end
129
+
130
+ def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
131
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots" # rubocop:disable Layout/LineLength
132
+ @query_params = {}
133
+ @query_params["pageSize"] = page_size if page_size
134
+ @query_params["paginationToken"] = pagination_token if pagination_token
135
+ @request_type = "GET"
136
+ call_api
137
+ end
138
+
139
+ def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body)
140
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots" # rubocop:disable Layout/LineLength
141
+ @request_body = body
142
+ @request_type = "POST"
143
+ call_api
144
+ end
145
+
146
+ def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body)
147
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots/#{slot_id}/schedule" # rubocop:disable Layout/LineLength
148
+ @request_body = body
149
+ @request_type = "POST"
150
+ call_api
151
+ end
152
+
153
+ def list_transportation_options(inbound_plan_id, page_size: nil, pagination_token: nil, placement_option_id: nil,
154
+ shipment_id: nil)
155
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/transportationOptions"
156
+ @query_params = {}
157
+ @query_params["pageSize"] = page_size if page_size
158
+ @query_params["paginationToken"] = pagination_token if pagination_token
159
+ @query_params["placementOptionId"] = placement_option_id if placement_option_id
160
+ @query_params["shipmentId"] = shipment_id if shipment_id
161
+ @request_type = "GET"
162
+ call_api
163
+ end
164
+
165
+ def generate_transportation_options(inbound_plan_id, body)
166
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/transportationOptions"
167
+ @request_body = body
168
+ @request_type = "POST"
169
+ call_api
170
+ end
171
+
172
+ def confirm_transportation_options(inbound_plan_id, body)
173
+ @local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/transportationOptions/confirmation"
174
+ @request_body = body
175
+ @request_type = "POST"
176
+ call_api
177
+ end
178
+
179
+ def list_item_compliance_details(mskus, marketplace_id)
180
+ @local_var_path = "#{INBOUND_PATH}/items/compliance"
181
+ @query_params = {}
182
+ @query_params["mskus"] = mskus
183
+ @query_params["marketplaceId"] = marketplace_id
184
+ @request_type = "GET"
185
+ call_api
186
+ end
187
+
188
+ def update_item_compliance_details(marketplace_id, body)
189
+ @local_var_path = "#{INBOUND_PATH}/items/compliance"
190
+ @query_params = {}
191
+ @query_params["marketplaceId"] = marketplace_id
192
+ @request_body = body
193
+ @request_type = "PUT"
194
+ call_api
195
+ end
196
+
197
+ def create_marketplace_item_labels(body)
198
+ @local_var_path = "#{INBOUND_PATH}/items/labels"
199
+ @request_body = body
200
+ @request_type = "POST"
201
+ call_api
202
+ end
203
+
204
+ def list_prep_details(marketplace_id, mskus)
205
+ @local_var_path = "#{INBOUND_PATH}/items/prepDetails"
206
+ @query_params = {}
207
+ @query_params["marketplaceId"] = marketplace_id
208
+ @query_params["mskus"] = mskus
209
+ @request_type = "GET"
210
+ call_api
211
+ end
212
+
213
+ def set_prep_details(body) # rubocop:disable Naming/AccessorMethodName
214
+ @local_var_path = "#{INBOUND_PATH}/items/prepDetails"
215
+ @request_body = body
216
+ @request_type = "POST"
217
+ call_api
218
+ end
40
219
  end
41
220
  end
42
221
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module ListingsRestrictions
5
+ class V20210801 < SpApiClient
6
+ def get_listings_restrictions(asin, seller_id, marketplace_ids, condition_type = nil, reason_locale = nil)
7
+ # Options for condition_type:
8
+ # new_new
9
+ # new_open_box
10
+ # new_oem
11
+ # refurbished_refurbished
12
+ # used_like_new
13
+ # used_very_good
14
+ # used_good
15
+ # used_acceptable
16
+ # collectible_like_new
17
+ # collectible_very_good
18
+ # collectible_good
19
+ # collectible_acceptable
20
+ # club_club
21
+
22
+ @local_var_path = "/listings/2021-08-01/restrictions"
23
+ @marketplace_ids = marketplace_ids.is_a?(Array) ? marketplace_ids : [marketplace_ids]
24
+ @query_params = {
25
+ "marketplaceIds" => @marketplace_ids.join(",")
26
+ }
27
+ @query_params["asin"] = asin if asin
28
+ @query_params["conditionType"] = condition_type if condition_type
29
+ @query_params["sellerId"] = seller_id if seller_id
30
+ @query_params["reason_locale"] = reason_locale if reason_locale
31
+ @request_type = "GET"
32
+ call_api
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorDirectFulfillmentInventory
5
+ class V1 < SpApiClient
6
+ def submit_inventory_update(warehouse_id, selling_party, is_full_update, items)
7
+ @local_var_path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items"
8
+ @request_body = {
9
+ "inventory" => {
10
+ "sellingParty" => selling_party,
11
+ "isFullUpdate" => is_full_update,
12
+ "items" => items
13
+ }
14
+ }
15
+ @request_type = "POST"
16
+ call_api
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorDirectFulfillmentOrders
5
+ class V20211228 < SpApiClient
6
+ GET_ORDERS_PARAMS = %w[
7
+ shipFromPartyId
8
+ status
9
+ limit
10
+ sortOrder
11
+ nextToken
12
+ includeDetails
13
+ ].freeze
14
+
15
+ def get_orders(created_after, created_before, params = {})
16
+ @local_var_path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders"
17
+ @query_params = {
18
+ "createdAfter" => created_after,
19
+ "createdBefore" => created_before
20
+ }
21
+ @query_params.merge!(params.slice(*GET_ORDERS_PARAMS))
22
+ @request_type = "GET"
23
+ call_api
24
+ end
25
+
26
+ def get_order(purchase_order_number)
27
+ @local_var_path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"
28
+ @request_type = "GET"
29
+ call_api
30
+ end
31
+
32
+ def submit_acknowledgement(order_acknowledgements)
33
+ @local_var_path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements"
34
+ @request_body = { "orderAcknowledgements" => order_acknowledgements }
35
+ @request_type = "POST"
36
+ call_api
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorDirectFulfillmentPayments
5
+ class V1 < SpApiClient
6
+ def submit_invoice(invoices)
7
+ @local_var_path = "/vendor/directFulfillment/payments/v1/invoices"
8
+ @request_body = { "invoices" => invoices }
9
+ @request_type = "POST"
10
+ call_api
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorDirectFulfillmentShipping
5
+ class V20211228 < SpApiClient
6
+ VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS = %w[
7
+ shipFromPartyId
8
+ limit
9
+ sortOrder
10
+ nextToken
11
+ ].freeze
12
+
13
+ def get_shipping_labels(created_after, created_before, params = {})
14
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
15
+ @query_params = {
16
+ "createdAfter" => created_after,
17
+ "createdBefore" => created_before
18
+ }
19
+ @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
20
+ @request_type = "GET"
21
+ call_api
22
+ end
23
+
24
+ def submit_shipping_label_request(shipping_label_requests)
25
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
26
+ @request_body = { "shippingLabelRequests" => shipping_label_requests }
27
+ @request_type = "POST"
28
+ call_api
29
+ end
30
+
31
+ def get_shipping_label(purchase_order_number)
32
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
33
+ @request_type = "GET"
34
+ call_api
35
+ end
36
+
37
+ def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers: nil)
38
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
39
+ @request_body = {
40
+ "sellingParty" => selling_party,
41
+ "shipFromParty" => ship_from_party
42
+ }
43
+ @request_body["containers"] = containers if containers
44
+ @request_type = "POST"
45
+ call_api
46
+ end
47
+
48
+ def submit_shipment_confirmations(shipment_confirmations)
49
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentConfirmations"
50
+ @request_body = { "shipmentConfirmations" => shipment_confirmations }
51
+ @request_type = "POST"
52
+ call_api
53
+ end
54
+
55
+ def submit_shipment_status_updates(shipment_status_updates)
56
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentStatusUpdates"
57
+ @request_body = { "shipmentStatusUpdates" => shipment_status_updates }
58
+ @request_type = "POST"
59
+ call_api
60
+ end
61
+
62
+ def get_customer_invoices(created_after, created_before, params = {})
63
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices"
64
+ @query_params = {
65
+ "createdAfter" => created_after,
66
+ "createdBefore" => created_before
67
+ }
68
+ @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
69
+ @request_type = "GET"
70
+ call_api
71
+ end
72
+
73
+ def get_customer_invoice(purchase_order_number)
74
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices/#{purchase_order_number}"
75
+ @request_type = "GET"
76
+ call_api
77
+ end
78
+
79
+ def get_packing_slips(created_after, created_before, params = {})
80
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips"
81
+ @query_params = {
82
+ "createdAfter" => created_after,
83
+ "createdBefore" => created_before
84
+ }
85
+ @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
86
+ @request_type = "GET"
87
+ call_api
88
+ end
89
+
90
+ def get_packing_slip(purchase_order_number)
91
+ @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips/#{purchase_order_number}"
92
+ @request_type = "GET"
93
+ call_api
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorDirectFulfillmentTransactions
5
+ class V20211228 < SpApiClient
6
+ def get_transaction_status(transaction_id)
7
+ @local_var_path = "/vendor/directFulfillment/transactions/2021-12-28/transactions/#{transaction_id}"
8
+ @request_type = "GET"
9
+ call_api
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorInvoices
5
+ class V1 < SpApiClient
6
+ def submit_invoices(invoices)
7
+ @local_var_path = "/vendor/payments/v1/invoices"
8
+ @request_body = { "invoices" => invoices }
9
+ @request_type = "POST"
10
+ call_api
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorOrders
5
+ class V1 < SpApiClient
6
+ GET_PURCHASE_ORDERS_PARAMS = %w[
7
+ limit
8
+ createdAfter
9
+ createdBefore
10
+ sortOrder
11
+ nextToken
12
+ includeDetails
13
+ changedAfter
14
+ changedBefore
15
+ poItemState
16
+ isPOChanged
17
+ purchaseOrderState
18
+ orderingVendorCode
19
+ ].freeze
20
+
21
+ GET_PURCHASE_ORDERS_STATUS_PARAMS = %w[
22
+ limit
23
+ sortOrder
24
+ nextToken
25
+ createdAfter
26
+ createdBefore
27
+ updatedAfter
28
+ updatedBefore
29
+ purchaseOrderNumber
30
+ purchaseOrderStatus
31
+ itemConfirmationStatus
32
+ itemReceiveStatus
33
+ orderingVendorCode
34
+ shipToPartyId
35
+ ].freeze
36
+
37
+ def get_purchase_orders(params = {})
38
+ @local_var_path = "/vendor/orders/v1/purchaseOrders"
39
+ @query_params = params.slice(*GET_PURCHASE_ORDERS_PARAMS)
40
+ @request_type = "GET"
41
+ call_api
42
+ end
43
+
44
+ def get_purchase_order(purchase_order_number)
45
+ @local_var_path = "/vendor/orders/v1/purchaseOrders/#{purchase_order_number}"
46
+ @request_type = "GET"
47
+ call_api
48
+ end
49
+
50
+ def submit_acknowledgement(acknowledgements)
51
+ @local_var_path = "/vendor/orders/v1/acknowledgements"
52
+ @request_body = { "acknowledgements" => acknowledgements }
53
+ @request_type = "POST"
54
+ call_api
55
+ end
56
+
57
+ def get_purchase_orders_status(params = {})
58
+ @local_var_path = "/vendor/orders/v1/purchaseOrdersStatus"
59
+ @query_params = params.slice(*GET_PURCHASE_ORDERS_STATUS_PARAMS)
60
+ @request_type = "GET"
61
+ call_api
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorShipments
5
+ class V1 < SpApiClient
6
+ GET_SHIPMENT_DETAILS_PARAMS = %w[
7
+ limit
8
+ sortOrder
9
+ nextToken
10
+ createdAfter
11
+ createdBefore
12
+ shipmentConfirmedBefore
13
+ shipmentConfirmedAfter
14
+ packageLabelCreatedBefore
15
+ packageLabelCreatedAfter
16
+ shippedBefore
17
+ shippedAfter
18
+ estimatedDeliveryBefore
19
+ estimatedDeliveryAfter
20
+ shipmentDeliveryBefore
21
+ shipmentDeliveryAfter
22
+ requestedPickUpBefore
23
+ requestedPickUpAfter
24
+ scheduledPickUpBefore
25
+ scheduledPickUpAfter
26
+ currentShipmentStatus
27
+ vendorShipmentIdentifier
28
+ buyerReferenceNumber
29
+ buyerWarehouseCode
30
+ sellerWarehouseCode
31
+ ].freeze
32
+
33
+ def submit_shipment_confirmations(shipment_confirmations)
34
+ @local_var_path = "/vendor/shipping/v1/shipmentConfirmations"
35
+ @request_body = { "shipmentConfirmations" => shipment_confirmations }
36
+ @request_type = "POST"
37
+ call_api
38
+ end
39
+
40
+ def get_shipment_details(params = {})
41
+ @local_var_path = "/vendor/shipping/v1/shipments"
42
+ @query_params = params.slice(*GET_SHIPMENT_DETAILS_PARAMS)
43
+ @request_type = "GET"
44
+ call_api
45
+ end
46
+
47
+ def submit_shipments(shipments)
48
+ @local_var_path = "/vendor/shipping/v1/shipments"
49
+ @request_body = { "shipments" => shipments }
50
+ @request_type = "POST"
51
+ call_api
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module VendorTransactionStatus
5
+ class V1 < SpApiClient
6
+ def get_transaction(transaction_id)
7
+ @local_var_path = "/vendor/transactions/v1/transactions/#{transaction_id}"
8
+ @request_type = "GET"
9
+ call_api
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "2.2.2"
4
+ VERSION = "2.4.2"
5
5
  end
data/lib/muffin_man.rb CHANGED
@@ -14,6 +14,7 @@ require "muffin_man/tokens/v20210301"
14
14
  require "muffin_man/product_pricing/v0"
15
15
  require "muffin_man/listings/v20210801"
16
16
  require "muffin_man/listings/v20200901"
17
+ require "muffin_man/listings_restrictions/v20210801"
17
18
  require "muffin_man/fulfillment_inbound/v0"
18
19
  require "muffin_man/fulfillment_inbound/v1"
19
20
  require "muffin_man/fulfillment_inbound/v20240320"
@@ -24,6 +25,15 @@ require "muffin_man/feeds/v20210630"
24
25
  require "muffin_man/notifications/v1"
25
26
  require "muffin_man/merchant_fulfillment/v0"
26
27
  require "muffin_man/awd/v20240509"
28
+ require "muffin_man/vendor_direct_fulfillment_inventory/v1"
29
+ require "muffin_man/vendor_direct_fulfillment_orders/v20211228"
30
+ require "muffin_man/vendor_direct_fulfillment_payments/v1"
31
+ require "muffin_man/vendor_direct_fulfillment_shipping/v20211228"
32
+ require "muffin_man/vendor_direct_fulfillment_transactions/v20211228"
33
+ require "muffin_man/vendor_invoices/v1"
34
+ require "muffin_man/vendor_orders/v1"
35
+ require "muffin_man/vendor_shipments/v1"
36
+ require "muffin_man/vendor_transaction_status/v1"
27
37
 
28
38
  module MuffinMan
29
39
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2024-08-02 00:00:00.000000000 Z
13
+ date: 2024-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -169,6 +169,7 @@ files:
169
169
  - lib/muffin_man/fulfillment_outbound/v20200701.rb
170
170
  - lib/muffin_man/listings/v20200901.rb
171
171
  - lib/muffin_man/listings/v20210801.rb
172
+ - lib/muffin_man/listings_restrictions/v20210801.rb
172
173
  - lib/muffin_man/lwa/auth_helper.rb
173
174
  - lib/muffin_man/merchant_fulfillment/v0.rb
174
175
  - lib/muffin_man/notifications/v1.rb
@@ -188,6 +189,15 @@ files:
188
189
  - lib/muffin_man/solicitations/v1.rb
189
190
  - lib/muffin_man/sp_api_client.rb
190
191
  - lib/muffin_man/tokens/v20210301.rb
192
+ - lib/muffin_man/vendor_direct_fulfillment_inventory/v1.rb
193
+ - lib/muffin_man/vendor_direct_fulfillment_orders/v20211228.rb
194
+ - lib/muffin_man/vendor_direct_fulfillment_payments/v1.rb
195
+ - lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb
196
+ - lib/muffin_man/vendor_direct_fulfillment_transactions/v20211228.rb
197
+ - lib/muffin_man/vendor_invoices/v1.rb
198
+ - lib/muffin_man/vendor_orders/v1.rb
199
+ - lib/muffin_man/vendor_shipments/v1.rb
200
+ - lib/muffin_man/vendor_transaction_status/v1.rb
191
201
  - lib/muffin_man/version.rb
192
202
  - lib/sp_api_helpers.rb
193
203
  - muffin_man.gemspec