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
@@ -1,122 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'peddler/client'
4
-
5
- module MWS
6
- module Feeds
7
- # The MWS Feeds API lets you upload inventory and order data to Amazon. You
8
- # can also use this API to get information about the processing of feeds.
9
- # @see https://sellercentral.amazon.com/gp/help/help-page.html?itemID=1611
10
- class Client < ::Peddler::Client
11
- self.version = '2009-01-01'
12
- self.path = "/Feeds/#{version}"
13
-
14
- # Uploads a feed
15
- #
16
- # @note Feed size is limited to 2,147,483,647 bytes (2^31 -1) per feed.
17
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html
18
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
19
- # @param [String] feed_content an XML or flat file feed
20
- # @param [String] feed_type the feed type
21
- # @param [Hash] opts
22
- # @option opts [Array<String>, String] :marketplace_id_list
23
- # @option opts [Boolean] :purge_and_replace
24
- # @return [Peddler::XMLParser]
25
- def submit_feed(feed_content, feed_type, opts = {})
26
- self.body = feed_content
27
-
28
- operation('SubmitFeed')
29
- .add(opts)
30
- .add('FeedType' => feed_type)
31
- .structure!('MarketplaceIdList', 'Id')
32
-
33
- run
34
- end
35
-
36
- # Lists feed submissions
37
- #
38
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionList.html
39
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
40
- # @param [Hash] opts
41
- # @option opts [Array<String>, String] :feed_submission_id_list
42
- # @option opts [Integer] :max_count
43
- # @option opts [Array<String>, String] :feed_type_list
44
- # @option opts [Array<String>, String] :feed_processing_status_list
45
- # @option opts [String, #iso8601] :submitted_from_date
46
- # @option opts [String, #iso8601] :submitted_to_date
47
- # @return [Peddler::XMLParser]
48
- def get_feed_submission_list(opts = {})
49
- operation('GetFeedSubmissionList')
50
- .add(opts)
51
- .structure!('FeedSubmissionIdList', 'Id')
52
- .structure!('FeedTypeList', 'Type')
53
- .structure!('FeedProcessingStatusList', 'Status')
54
-
55
- run
56
- end
57
-
58
- # Lists the next page of feed submissions
59
- #
60
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionListByNextToken.html
61
- # @param [String] next_token
62
- # @return [Peddler::XMLParser]
63
- def get_feed_submission_list_by_next_token(next_token)
64
- operation('GetFeedSubmissionListByNextToken')
65
- .add('NextToken' => next_token)
66
-
67
- run
68
- end
69
-
70
- # Counts submitted feeds
71
- #
72
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionCount.html
73
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
74
- # @param [Hash] opts
75
- # @option opts [Array<String>, String] :feed_type_list
76
- # @option opts [Array<String>, String] :feed_processing_status_list
77
- # @option opts [String, #iso8601] :submitted_from_date
78
- # @option opts [String, #iso8601] :submitted_to_date
79
- # @return [Peddler::XMLParser]
80
- def get_feed_submission_count(opts = {})
81
- operation('GetFeedSubmissionCount')
82
- .add(opts)
83
- .structure!('FeedTypeList', 'Type')
84
- .structure!('FeedProcessingStatusList', 'Status')
85
-
86
- run
87
- end
88
-
89
- # Cancels one or more feed submissions
90
- #
91
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_CancelFeedSubmissions.html
92
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
93
- # @param [Hash] opts
94
- # @option opts [Array<String>, String] :feed_submission_id_list
95
- # @option opts [Array<String>, String] :feed_type_list
96
- # @option opts [String, #iso8601] :submitted_from_date
97
- # @option opts [String, #iso8601] :submitted_to_date
98
- # @return [Peddler::XMLParser]
99
- def cancel_feed_submissions(opts = {})
100
- operation('CancelFeedSubmissions')
101
- .add(opts)
102
- .structure!('FeedSubmissionIdList', 'Id')
103
- .structure!('FeedTypeList', 'Type')
104
-
105
- run
106
- end
107
-
108
- # Gets the processing report for a feed and its Content-MD5 header
109
- #
110
- # @see https://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
111
- # @param [Integer, String] feed_submission_id
112
- # @return [Peddler::XMLParser] if the report is in XML format
113
- # @return [Peddler::FlatFileParser] if the report is a flat file
114
- def get_feed_submission_result(feed_submission_id)
115
- operation('GetFeedSubmissionResult')
116
- .add('FeedSubmissionId' => feed_submission_id)
117
-
118
- run
119
- end
120
- end
121
- end
122
- end
data/lib/mws/feeds.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'mws/feeds/client'
@@ -1,82 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'peddler/client'
4
-
5
- module MWS
6
- module Finances
7
- # With the MWS Finances API you can retrieve financial transactions for your
8
- # seller account.
9
- class Client < ::Peddler::Client
10
- self.version = '2015-05-01'
11
- self.path = "/Finances/#{version}"
12
-
13
- # Lists financial events
14
- #
15
- # @see https://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEvents.html
16
- # @param [Hash] opts
17
- # @option opts [Integer] :max_results_per_page
18
- # @option opts [String] :amazon_order_id
19
- # @option opts [String] :financial_event_group_id
20
- # @option opts [String, #iso8601] :posted_after
21
- # @option opts [String, #iso8601] :posted_before
22
- # @return [Peddler::XMLParser]
23
- def list_financial_events(opts = {})
24
- operation('ListFinancialEvents')
25
- .add(opts)
26
-
27
- run
28
- end
29
-
30
- # Lists the next page of financial events
31
- #
32
- # @see https://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventsByNextToken.html
33
- # @param [String] next_token
34
- # @return [Peddler::XMLParser]
35
- def list_financial_events_by_next_token(next_token)
36
- operation('ListFinancialEventsByNextToken')
37
- .add('NextToken' => next_token)
38
-
39
- run
40
- end
41
-
42
- # Lists financial event groups
43
- #
44
- # @see https://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventGroups.html
45
- # @param [String, #iso8601] financial_event_group_started_after
46
- # @param [Hash] opts
47
- # @option opts [Integer] :max_results_per_page
48
- # @option opts [String, #iso8601] :financial_event_group_started_before
49
- # @return [Peddler::XMLParser]
50
- def list_financial_event_groups(financial_event_group_started_after,
51
- opts = {})
52
- operation('ListFinancialEventGroups')
53
- .add(opts)
54
- .add('FinancialEventGroupStartedAfter' =>
55
- financial_event_group_started_after)
56
-
57
- run
58
- end
59
-
60
- # Lists the next page of financial event groups
61
- #
62
- # @see https://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventGroupsByNextToken.html
63
- # @param [String] next_token
64
- # @return [Peddler::XMLParser]
65
- def list_financial_event_groups_by_next_token(next_token)
66
- operation('ListFinancialEventGroupsByNextToken')
67
- .add('NextToken' => next_token)
68
-
69
- run
70
- end
71
-
72
- # Gets API status
73
- #
74
- # @see https://docs.developer.amazonservices.com/en_US/finances/Finances_GetServiceStatus.html
75
- # @return [Peddler::XMLParser]
76
- def get_service_status
77
- operation('GetServiceStatus')
78
- run
79
- end
80
- end
81
- end
82
- end
data/lib/mws/finances.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'mws/finances/client'
@@ -1,388 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'peddler/client'
4
-
5
- module MWS
6
- module FulfillmentInboundShipment
7
- # With the Fulfillment Inbound Shipment API, you can create and update
8
- # inbound shipments of inventory in the Amazon Fulfillment Network. You can
9
- # also request lists of inbound shipments or inbound shipment items based on
10
- # criteria that you specify.
11
- class Client < ::Peddler::Client
12
- self.version = '2010-10-01'
13
- self.path = "/FulfillmentInboundShipment/#{version}"
14
-
15
- # Returns inbound guidance for a list of items by Seller SKU
16
- #
17
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetInboundGuidanceForSKU.html
18
- # @param [String] marketplace_id
19
- # @param [Array<String>] seller_sku_list
20
- # @return [Peddler::XMLParser]
21
- def get_inbound_guidance_for_sku(marketplace_id, *seller_sku_list)
22
- operation('GetInboundGuidanceForSKU')
23
- .add('MarketplaceId' => marketplace_id,
24
- 'SellerSKUList' => seller_sku_list)
25
- .structure!('SellerSKUList', 'Id')
26
-
27
- run
28
- end
29
-
30
- # Returns inbound guidance for a list of items by ASIN
31
- #
32
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetInboundGuidanceForASIN.html
33
- # @param [String] marketplace_id
34
- # @param [Array<String>] asin_list
35
- # @return [Peddler::XMLParser]
36
- def get_inbound_guidance_for_asin(marketplace_id, *asin_list)
37
- operation('GetInboundGuidanceForASIN')
38
- .add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
39
- .structure!('ASINList', 'Id')
40
-
41
- run
42
- end
43
-
44
- # Returns the information required to create an inbound shipment
45
- #
46
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_CreateInboundShipmentPlan.html
47
- # @param [Struct, Hash] ship_from_address
48
- # @param [Array<Struct, Hash>] inbound_shipment_plan_request_items
49
- # @param [Hash] opts
50
- # @option opts [String] :ship_to_country_code
51
- # @option opts [String] :ship_to_country_subdivision_code
52
- # @option opts [String] :label_prep_preference
53
- # @return [Peddler::XMLParser]
54
- def create_inbound_shipment_plan(ship_from_address,
55
- inbound_shipment_plan_request_items,
56
- opts = {})
57
- operation('CreateInboundShipmentPlan')
58
- .add(opts)
59
- .add('ShipFromAddress' => ship_from_address,
60
- 'InboundShipmentPlanRequestItems' =>
61
- inbound_shipment_plan_request_items)
62
- .structure!('InboundShipmentPlanRequestItems', 'member')
63
- .structure!('PrepDetailsList', 'member')
64
-
65
- run
66
- end
67
-
68
- # Creates an inbound shipment
69
- #
70
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_CreateInboundShipment.html
71
- # @param [String] shipment_id
72
- # @param [Struct, Hash] inbound_shipment_header
73
- # @param [Array<Struct, Hash>] :inbound_shipment_items
74
- # @return [Peddler::XMLParser]
75
- def create_inbound_shipment(shipment_id, inbound_shipment_header,
76
- inbound_shipment_items)
77
- build_inbound_shipment_operation('CreateInboundShipment', shipment_id,
78
- inbound_shipment_header,
79
- inbound_shipment_items)
80
-
81
- run
82
- end
83
-
84
- # Updates an existing inbound shipment
85
- #
86
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_UpdateInboundShipment.html
87
- # @param [String] shipment_id
88
- # @param [Struct, Hash] inbound_shipment_header
89
- # @param [Array<Struct, Hash>] :inbound_shipment_items
90
- # @return [Peddler::XMLParser]
91
- def update_inbound_shipment(shipment_id, inbound_shipment_header,
92
- inbound_shipment_items)
93
- build_inbound_shipment_operation('UpdateInboundShipment', shipment_id,
94
- inbound_shipment_header,
95
- inbound_shipment_items)
96
-
97
- run
98
- end
99
-
100
- # Returns pre-order information, including dates
101
- #
102
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPreorderInfo.html
103
- # @param [String] shipment_id
104
- # @return [Peddler::XMLParser]
105
- def get_preorder_info(shipment_id)
106
- operation('GetPreorderInfo')
107
- .add('ShipmentId' => shipment_id)
108
-
109
- run
110
- end
111
-
112
- # Confirms a shipment for pre-order
113
- #
114
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ConfirmPreorder.html
115
- # @param [String] shipment_id
116
- # @param [#iso8601] need_by_date
117
- # @return [Peddler::XMLParser]
118
- def confirm_preorder(shipment_id, need_by_date)
119
- operation('ConfirmPreorder')
120
- .add('ShipmentId' => shipment_id, 'NeedByDate' => need_by_date)
121
-
122
- run
123
- end
124
-
125
- # Returns labeling requirements and item preparation instructions to help
126
- # you prepare items for an inbound shipment
127
- #
128
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPrepInstructionsForSKU.html
129
- # @param [String] ship_to_country_code
130
- # @param [Array<String>] seller_sku_list
131
- # @return [Peddler::XMLParser]
132
- def get_prep_instructions_for_sku(ship_to_country_code, *seller_sku_list)
133
- operation('GetPrepInstructionsForSKU')
134
- .add('SellerSKUList' => seller_sku_list,
135
- 'ShipToCountryCode' => ship_to_country_code)
136
- .structure!('SellerSKUList', 'Id')
137
-
138
- run
139
- end
140
-
141
- # Returns item preparation instructions to help with item sourcing
142
- # decisions
143
- #
144
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPrepInstructionsForASIN.html
145
- # @param [String] ship_to_country_code
146
- # @param [Array<String>] asin_list
147
- # @return [Peddler::XMLParser]
148
- def get_prep_instructions_for_asin(ship_to_country_code, *asin_list)
149
- operation('GetPrepInstructionsForASIN')
150
- .add('ASINList' => asin_list,
151
- 'ShipToCountryCode' => ship_to_country_code)
152
- .structure!('ASINList', 'Id')
153
-
154
- run
155
- # Work around a bug upstream
156
- #
157
- # @see https://github.com/hakanensari/peddler/issues/122
158
- rescue Peddler::Errors::Error => e
159
- raise unless e.message.include?("Value null at 'asinList'")
160
-
161
- get_prep_instructions_for_asin_with_bad_params(ship_to_country_code,
162
- *asin_list)
163
- end
164
-
165
- # Sends transportation information to Amazon about an inbound shipment
166
- #
167
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_PutTransportContent.html
168
- # @param [String] shipment_id
169
- # @param [Boolean] is_partnered
170
- # @param [String] shipment_type
171
- # @param [Struct, Hash] transport_details
172
- # @return [Peddler::XMLParser]
173
- def put_transport_content(shipment_id, is_partnered, shipment_type,
174
- transport_details)
175
- operation('PutTransportContent')
176
- .add('ShipmentId' => shipment_id, 'IsPartnered' => is_partnered,
177
- 'ShipmentType' => shipment_type,
178
- 'TransportDetails' => transport_details)
179
- .structure!('PackageList', 'member')
180
- .structure!('PalletList', 'member')
181
-
182
- run
183
- end
184
-
185
- # Requests an estimate of the shipping cost for an inbound shipment
186
- #
187
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_EstimateTransportRequest.html
188
- # @param [String] shipment_id
189
- # @return [Peddler::XMLParser]
190
- def estimate_transport_request(shipment_id)
191
- operation('EstimateTransportRequest')
192
- .add('ShipmentId' => shipment_id)
193
-
194
- run
195
- end
196
-
197
- # Returns current transportation information about an inbound shipment
198
- #
199
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetTransportContent.html
200
- # @param [String] shipment_id
201
- # @return [Peddler::XMLParser]
202
- def get_transport_content(shipment_id)
203
- operation('GetTransportContent')
204
- .add('ShipmentId' => shipment_id)
205
-
206
- run
207
- end
208
-
209
- # Confirms that you accept the Amazon-partnered shipping estimate and you
210
- # request that the Amazon-partnered carrier ship your inbound shipment
211
- #
212
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ConfirmTransportRequest.html
213
- # @param [String] shipment_id
214
- # @return [Peddler::XMLParser]
215
- def confirm_transport_request(shipment_id)
216
- operation('ConfirmTransportRequest')
217
- .add('ShipmentId' => shipment_id)
218
-
219
- run
220
- end
221
-
222
- # Voids a previously-confirmed request to ship your inbound shipment using
223
- # an Amazon-partnered carrier
224
- #
225
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_VoidTransportRequest.html
226
- # @param [String] shipment_id
227
- # @return [Peddler::XMLParser]
228
- def void_transport_request(shipment_id)
229
- operation('VoidTransportRequest')
230
- .add('ShipmentId' => shipment_id)
231
-
232
- run
233
- end
234
-
235
- # Returns PDF document data for printing package labels for an inbound
236
- # shipment
237
- #
238
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPackageLabels.html
239
- # @param [String] shipment_id
240
- # @param [String] page_type
241
- # @param [Hash] opts
242
- # @option opts [Integer] :number_of_packages
243
- # @return [Peddler::XMLParser]
244
- def get_package_labels(shipment_id, page_type, opts = {})
245
- operation('GetPackageLabels')
246
- .add(opts)
247
- .add('ShipmentId' => shipment_id, 'PageType' => page_type)
248
-
249
- run
250
- end
251
-
252
- # Returns unique package labels for faster and more accurate shipment
253
- # processing at the Amazon fulfillment centre
254
- #
255
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetUniquePackageLabels.html
256
- # @param [String] shipment_id
257
- # @param [String] page_type
258
- # @param [Array<String>] package_labels_to_print
259
- # @return [Peddler::XMLParser]
260
- def get_unique_package_labels(shipment_id, page_type,
261
- package_labels_to_print)
262
- operation('GetUniquePackageLabels')
263
- .add('ShipmentId' => shipment_id, 'PageType' => page_type,
264
- 'PackageLabelsToPrint' => package_labels_to_print)
265
- .structure!('PackageLabelsToPrint', 'member')
266
-
267
- run
268
- end
269
-
270
- # Returns pallet labels
271
- #
272
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPalletLabels.html
273
- # @param [String] shipment_id
274
- # @param [String] page_type
275
- # @param [Integer] number_of_pallets
276
- # @return [Peddler::XMLParser]
277
- def get_pallet_labels(shipment_id, page_type, number_of_pallets)
278
- operation('GetPalletLabels')
279
- .add('ShipmentId' => shipment_id, 'PageType' => page_type,
280
- 'NumberOfPallets' => number_of_pallets)
281
-
282
- run
283
- end
284
-
285
- # Returns PDF document data for printing a bill of lading for an inbound
286
- # shipment
287
- #
288
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetBillOfLading.html
289
- # @param [String] shipment_id
290
- # @return [Peddler::XMLParser]
291
- def get_bill_of_lading(shipment_id)
292
- operation('GetBillOfLading')
293
- .add('ShipmentId' => shipment_id)
294
- run
295
- end
296
-
297
- # Returns a list of inbound shipments based on criteria that you specify
298
- #
299
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipments.html
300
- # @param [Hash] opts
301
- # @option opts [Array<String>] :shipment_status_list
302
- # @option opts [Array<String>] :shipment_id_list
303
- # @option opts [String, #iso8601] :last_updated_after
304
- # @option opts [String, #iso8601] :last_updated_before
305
- # @return [Peddler::XMLParser]
306
- def list_inbound_shipments(opts = {})
307
- operation('ListInboundShipments')
308
- .add(opts)
309
- .structure!('ShipmentStatusList', 'member')
310
- .structure!('ShipmentIdList', 'member')
311
-
312
- run
313
- end
314
-
315
- # Returns the next page of inbound shipments
316
- #
317
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentsByNextToken.html
318
- # @param [String] next_token
319
- # @return [Peddler::XMLParser]
320
- def list_inbound_shipments_by_next_token(next_token)
321
- operation('ListInboundShipmentsByNextToken')
322
- .add('NextToken' => next_token)
323
-
324
- run
325
- end
326
-
327
- # Returns a list of items in a specified inbound shipment, or a list of
328
- # items that were updated within a specified time frame
329
- #
330
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentItems.html
331
- # @param [Hash] opts
332
- # @option opts [String] :shipment_id
333
- # @option opts [String, #iso8601] :last_updated_after
334
- # @option opts [String, #iso8601] :last_updated_before
335
- # @return [Peddler::XMLParser]
336
- def list_inbound_shipment_items(opts = {})
337
- operation('ListInboundShipmentItems')
338
- .add(opts)
339
-
340
- run
341
- end
342
-
343
- # Returns the next page of inbound shipment items
344
- #
345
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentItemsByNextToken.html
346
- # @param [String] next_token
347
- # @return [Peddler::XMLParser]
348
- def list_inbound_shipment_items_by_next_token(next_token)
349
- operation('ListInboundShipmentItemsByNextToken')
350
- .add('NextToken' => next_token)
351
-
352
- run
353
- end
354
-
355
- # Gets the operational status of the API
356
- #
357
- # @see https://docs.developer.amazonservices.com/en_US/fba_inbound/MWS_GetServiceStatus.html
358
- # @return [Peddler::XMLParser]
359
- def get_service_status
360
- operation('GetServiceStatus')
361
- run
362
- end
363
-
364
- private
365
-
366
- def build_inbound_shipment_operation(operation_name, shipment_id,
367
- inbound_shipment_header,
368
- inbound_shipment_items)
369
- operation(operation_name)
370
- .add('ShipmentId' => shipment_id,
371
- 'InboundShipmentHeader' => inbound_shipment_header,
372
- 'InboundShipmentItems' => inbound_shipment_items)
373
- .structure!('InboundShipmentItems', 'member')
374
- .structure!('PrepDetailsList', 'member')
375
- end
376
-
377
- def get_prep_instructions_for_asin_with_bad_params(_ship_to_country_code,
378
- *asin_list)
379
- operation
380
- .add('AsinList' => asin_list)
381
- .structure!('AsinList', 'Id')
382
- .delete_if { |key, _val| key.include?('ASINList') }
383
-
384
- run
385
- end
386
- end
387
- end
388
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'mws/fulfillment_inbound_shipment/client'
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'peddler/client'
4
-
5
- module MWS
6
- module FulfillmentInventory
7
- # The Fulfillment Inventory API can help you stay up-to-date on the
8
- # availability of your inventory in the Amazon Fulfillment Network. The
9
- # Fulfillment Inventory API reports real-time availability information for
10
- # your Amazon Fulfillment Network inventory regardless of whether you are
11
- # selling your inventory on Amazon's retail web site or through other retail
12
- # channels.
13
- class Client < ::Peddler::Client
14
- self.version = '2010-10-01'
15
- self.path = "/FulfillmentInventory/#{version}"
16
-
17
- # Returns information about the availability of a seller's inventory
18
- #
19
- # @see https://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_ListInventorySupply.html
20
- # @param [Hash] opts
21
- # @option opts [Array<String>, String] :seller_skus
22
- # @option opts [String, #iso8601] :query_start_date_time
23
- # @option opts [String] :response_group
24
- # @option opts [String] :marketplace_id
25
- # @return [Peddler::XMLParser]
26
- def list_inventory_supply(opts = {})
27
- operation('ListInventorySupply')
28
- .add(opts)
29
- .structure!('SellerSkus', 'member')
30
-
31
- run
32
- end
33
-
34
- # Returns the next page of information about the availability of a
35
- # seller's inventory
36
- #
37
- # @see https://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_ListInventorySupplyByNextToken.html
38
- # @param [String] next_token
39
- # @return [Peddler::XMLParser]
40
- def list_inventory_supply_by_next_token(next_token)
41
- operation('ListInventorySupplyByNextToken')
42
- .add('NextToken' => next_token)
43
-
44
- run
45
- end
46
-
47
- # Gets the operational status of the API
48
- #
49
- # @see https://docs.developer.amazonservices.com/en_US/fba_inventory/MWS_GetServiceStatus.html
50
- # @return [Peddler::XMLParser]
51
- def get_service_status
52
- operation('GetServiceStatus')
53
- run
54
- end
55
- end
56
- end
57
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'mws/fulfillment_inventory/client'