-
Notifications
You must be signed in to change notification settings - Fork 60
/
fba_inbound_api.rb
1094 lines (953 loc) · 74.5 KB
/
fba_inbound_api.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
=begin
#Selling Partner API for Fulfillment Inbound
#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.24
=end
module AmzSpApi::FulfillmentInboundApiModel
class FbaInboundApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Returns information needed to confirm a shipment for pre-order. Call this operation after calling the getPreorderInfo operation to get the NeedByDate value and other pre-order information about the shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param need_by_date Date that the shipment must arrive at the Amazon fulfillment center to avoid delivery promise breaks for pre-ordered items. Must be in YYYY-MM-DD format. The response to the getPreorderInfo operation returns this value.
# @param marketplace_id A marketplace identifier. Specifies the marketplace the shipment is tied to.
# @param [Hash] opts the optional parameters
# @return [ConfirmPreorderResponse]
def confirm_preorder(shipment_id, need_by_date, marketplace_id, opts = {})
data, _status_code, _headers = confirm_preorder_with_http_info(shipment_id, need_by_date, marketplace_id, opts)
data
end
# Returns information needed to confirm a shipment for pre-order. Call this operation after calling the getPreorderInfo operation to get the NeedByDate value and other pre-order information about the shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param need_by_date Date that the shipment must arrive at the Amazon fulfillment center to avoid delivery promise breaks for pre-ordered items. Must be in YYYY-MM-DD format. The response to the getPreorderInfo operation returns this value.
# @param marketplace_id A marketplace identifier. Specifies the marketplace the shipment is tied to.
# @param [Hash] opts the optional parameters
# @return [Array<(ConfirmPreorderResponse, Integer, Hash)>] ConfirmPreorderResponse data, response status code and response headers
def confirm_preorder_with_http_info(shipment_id, need_by_date, marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.confirm_preorder ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.confirm_preorder"
end
# verify the required parameter 'need_by_date' is set
if @api_client.config.client_side_validation && need_by_date.nil?
fail ArgumentError, "Missing the required parameter 'need_by_date' when calling FbaInboundApi.confirm_preorder"
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.confirm_preorder"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/preorder/confirm'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
query_params[:'NeedByDate'] = need_by_date
query_params[:'MarketplaceId'] = marketplace_id
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'ConfirmPreorderResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#confirm_preorder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Confirms that the seller accepts the Amazon-partnered shipping estimate, agrees to allow Amazon to charge their account for the shipping cost, and requests that the Amazon-partnered carrier ship the inbound shipment. Prior to calling the confirmTransport operation, you should call the getTransportDetails operation to get the Amazon-partnered shipping estimate. Important: After confirming the transportation request, if the seller decides that they do not want the Amazon-partnered carrier to ship the inbound shipment, you can call the voidTransport operation to cancel the transportation request. Note that for a Small Parcel shipment, the seller has 24 hours after confirming a transportation request to void the transportation request. For a Less Than Truckload/Full Truckload (LTL/FTL) shipment, the seller has one hour after confirming a transportation request to void it. After the grace period has expired the seller's account will be charged for the shipping cost. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [ConfirmTransportResponse]
def confirm_transport(shipment_id, opts = {})
data, _status_code, _headers = confirm_transport_with_http_info(shipment_id, opts)
data
end
# Confirms that the seller accepts the Amazon-partnered shipping estimate, agrees to allow Amazon to charge their account for the shipping cost, and requests that the Amazon-partnered carrier ship the inbound shipment. Prior to calling the confirmTransport operation, you should call the getTransportDetails operation to get the Amazon-partnered shipping estimate. Important: After confirming the transportation request, if the seller decides that they do not want the Amazon-partnered carrier to ship the inbound shipment, you can call the voidTransport operation to cancel the transportation request. Note that for a Small Parcel shipment, the seller has 24 hours after confirming a transportation request to void the transportation request. For a Less Than Truckload/Full Truckload (LTL/FTL) shipment, the seller has one hour after confirming a transportation request to void it. After the grace period has expired the seller's account will be charged for the shipping cost. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(ConfirmTransportResponse, Integer, Hash)>] ConfirmTransportResponse data, response status code and response headers
def confirm_transport_with_http_info(shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.confirm_transport ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.confirm_transport"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/transport/confirm'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'ConfirmTransportResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#confirm_transport\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a new inbound shipment based on the specified shipmentId that was returned by the createInboundShipmentPlan operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [InboundShipmentResponse]
def create_inbound_shipment(body, shipment_id, opts = {})
data, _status_code, _headers = create_inbound_shipment_with_http_info(body, shipment_id, opts)
data
end
# Returns a new inbound shipment based on the specified shipmentId that was returned by the createInboundShipmentPlan operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(InboundShipmentResponse, Integer, Hash)>] InboundShipmentResponse data, response status code and response headers
def create_inbound_shipment_with_http_info(body, shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.create_inbound_shipment ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FbaInboundApi.create_inbound_shipment"
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.create_inbound_shipment"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(body)
return_type = opts[:return_type] || 'InboundShipmentResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#create_inbound_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns one or more inbound shipment plans, which provide the information you need to create one or more inbound shipments for a set of items that you specify. Multiple inbound shipment plans might be required so that items can be optimally placed in Amazon's fulfillment network—for example, positioning inventory closer to the customer. Alternatively, two inbound shipment plans might be created with the same Amazon fulfillment center destination if the two shipment plans require different processing—for example, items that require labels must be shipped separately from stickerless, commingled inventory. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param [Hash] opts the optional parameters
# @return [CreateInboundShipmentPlanResponse]
def create_inbound_shipment_plan(body, opts = {})
data, _status_code, _headers = create_inbound_shipment_plan_with_http_info(body, opts)
data
end
# Returns one or more inbound shipment plans, which provide the information you need to create one or more inbound shipments for a set of items that you specify. Multiple inbound shipment plans might be required so that items can be optimally placed in Amazon's fulfillment network—for example, positioning inventory closer to the customer. Alternatively, two inbound shipment plans might be created with the same Amazon fulfillment center destination if the two shipment plans require different processing—for example, items that require labels must be shipped separately from stickerless, commingled inventory. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param [Hash] opts the optional parameters
# @return [Array<(CreateInboundShipmentPlanResponse, Integer, Hash)>] CreateInboundShipmentPlanResponse data, response status code and response headers
def create_inbound_shipment_plan_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.create_inbound_shipment_plan ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FbaInboundApi.create_inbound_shipment_plan"
end
# resource path
local_var_path = '/fba/inbound/v0/plans'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(body)
return_type = opts[:return_type] || 'CreateInboundShipmentPlanResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#create_inbound_shipment_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Initiates the process of estimating the shipping cost for an inbound shipment by an Amazon-partnered carrier. Prior to calling the estimateTransport operation, you must call the putTransportDetails operation to provide Amazon with the transportation information for the inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [EstimateTransportResponse]
def estimate_transport(shipment_id, opts = {})
data, _status_code, _headers = estimate_transport_with_http_info(shipment_id, opts)
data
end
# Initiates the process of estimating the shipping cost for an inbound shipment by an Amazon-partnered carrier. Prior to calling the estimateTransport operation, you must call the putTransportDetails operation to provide Amazon with the transportation information for the inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(EstimateTransportResponse, Integer, Hash)>] EstimateTransportResponse data, response status code and response headers
def estimate_transport_with_http_info(shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.estimate_transport ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.estimate_transport"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/transport/estimate'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'EstimateTransportResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#estimate_transport\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [GetBillOfLadingResponse]
def get_bill_of_lading(shipment_id, opts = {})
data, _status_code, _headers = get_bill_of_lading_with_http_info(shipment_id, opts)
data
end
# Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(GetBillOfLadingResponse, Integer, Hash)>] GetBillOfLadingResponse data, response status code and response headers
def get_bill_of_lading_with_http_info(shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_bill_of_lading ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_bill_of_lading"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/billOfLading'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetBillOfLadingResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_bill_of_lading\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns information that lets a seller know if Amazon recommends sending an item to a given marketplace. In some cases, Amazon provides guidance for why a given SellerSKU or ASIN is not recommended for shipment to Amazon's fulfillment network. Sellers may still ship items that are not recommended, at their discretion. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want inbound guidance for shipment to Amazon's fulfillment network. Note: SellerSKU is qualified by the SellerId, which is included with every Selling Partner API operation that you submit. If you specify a SellerSKU that identifies a variation parent ASIN, this operation returns an error. A variation parent ASIN represents a generic product that cannot be sold. Variation child ASINs represent products that have specific characteristics (such as size and color) and can be sold.
# @option opts [Array<String>] :asin_list A list of ASIN values. Used to identify items for which you want inbound guidance for shipment to Amazon's fulfillment network. Note: If you specify a ASIN that identifies a variation parent ASIN, this operation returns an error. A variation parent ASIN represents a generic product that cannot be sold. Variation child ASINs represent products that have specific characteristics (such as size and color) and can be sold.
# @return [GetInboundGuidanceResponse]
def get_inbound_guidance(marketplace_id, opts = {})
data, _status_code, _headers = get_inbound_guidance_with_http_info(marketplace_id, opts)
data
end
# Returns information that lets a seller know if Amazon recommends sending an item to a given marketplace. In some cases, Amazon provides guidance for why a given SellerSKU or ASIN is not recommended for shipment to Amazon's fulfillment network. Sellers may still ship items that are not recommended, at their discretion. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want inbound guidance for shipment to Amazon's fulfillment network. Note: SellerSKU is qualified by the SellerId, which is included with every Selling Partner API operation that you submit. If you specify a SellerSKU that identifies a variation parent ASIN, this operation returns an error. A variation parent ASIN represents a generic product that cannot be sold. Variation child ASINs represent products that have specific characteristics (such as size and color) and can be sold.
# @option opts [Array<String>] :asin_list A list of ASIN values. Used to identify items for which you want inbound guidance for shipment to Amazon's fulfillment network. Note: If you specify a ASIN that identifies a variation parent ASIN, this operation returns an error. A variation parent ASIN represents a generic product that cannot be sold. Variation child ASINs represent products that have specific characteristics (such as size and color) and can be sold.
# @return [Array<(GetInboundGuidanceResponse, Integer, Hash)>] GetInboundGuidanceResponse data, response status code and response headers
def get_inbound_guidance_with_http_info(marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_inbound_guidance ...'
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_inbound_guidance"
end
# resource path
local_var_path = '/fba/inbound/v0/itemsGuidance'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'MarketplaceId'] = marketplace_id
query_params[:'SellerSKUList'] = @api_client.build_collection_param(opts[:'seller_sku_list'], :csv) if !opts[:'seller_sku_list'].nil?
query_params[:'ASINList'] = @api_client.build_collection_param(opts[:'asin_list'], :csv) if !opts[:'asin_list'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetInboundGuidanceResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_inbound_guidance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param page_type The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error.
# @param label_type The type of labels requested.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :number_of_packages The number of packages in the shipment.
# @option opts [Array<String>] :package_labels_to_print A list of identifiers that specify packages for which you want package labels printed. Must match CartonId values previously passed using the FBA Inbound Shipment Carton Information Feed. If not, the operation returns the IncorrectPackageIdentifier error code.
# @option opts [Integer] :number_of_pallets The number of pallets in the shipment. This returns four identical labels for each pallet.
# @option opts [Integer] :page_size The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000.
# @option opts [Integer] :page_start_index The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments.
# @return [GetLabelsResponse]
def get_labels(shipment_id, page_type, label_type, opts = {})
data, _status_code, _headers = get_labels_with_http_info(shipment_id, page_type, label_type, opts)
data
end
# Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param page_type The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error.
# @param label_type The type of labels requested.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :number_of_packages The number of packages in the shipment.
# @option opts [Array<String>] :package_labels_to_print A list of identifiers that specify packages for which you want package labels printed. Must match CartonId values previously passed using the FBA Inbound Shipment Carton Information Feed. If not, the operation returns the IncorrectPackageIdentifier error code.
# @option opts [Integer] :number_of_pallets The number of pallets in the shipment. This returns four identical labels for each pallet.
# @option opts [Integer] :page_size The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000.
# @option opts [Integer] :page_start_index The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments.
# @return [Array<(GetLabelsResponse, Integer, Hash)>] GetLabelsResponse data, response status code and response headers
def get_labels_with_http_info(shipment_id, page_type, label_type, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_labels ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_labels"
end
# verify the required parameter 'page_type' is set
if @api_client.config.client_side_validation && page_type.nil?
fail ArgumentError, "Missing the required parameter 'page_type' when calling FbaInboundApi.get_labels"
end
# verify enum value
if @api_client.config.client_side_validation && !['PackageLabel_Letter_2', 'PackageLabel_Letter_4', 'PackageLabel_Letter_6', 'PackageLabel_Letter_6_CarrierLeft', 'PackageLabel_A4_2', 'PackageLabel_A4_4', 'PackageLabel_Plain_Paper', 'PackageLabel_Plain_Paper_CarrierBottom', 'PackageLabel_Thermal', 'PackageLabel_Thermal_Unified', 'PackageLabel_Thermal_NonPCP', 'PackageLabel_Thermal_No_Carrier_Rotation'].include?(page_type)
fail ArgumentError, "invalid value for 'page_type', must be one of PackageLabel_Letter_2, PackageLabel_Letter_4, PackageLabel_Letter_6, PackageLabel_Letter_6_CarrierLeft, PackageLabel_A4_2, PackageLabel_A4_4, PackageLabel_Plain_Paper, PackageLabel_Plain_Paper_CarrierBottom, PackageLabel_Thermal, PackageLabel_Thermal_Unified, PackageLabel_Thermal_NonPCP, PackageLabel_Thermal_No_Carrier_Rotation"
end
# verify the required parameter 'label_type' is set
if @api_client.config.client_side_validation && label_type.nil?
fail ArgumentError, "Missing the required parameter 'label_type' when calling FbaInboundApi.get_labels"
end
# verify enum value
if @api_client.config.client_side_validation && !['BARCODE_2D', 'UNIQUE', 'PALLET'].include?(label_type)
fail ArgumentError, "invalid value for 'label_type', must be one of BARCODE_2D, UNIQUE, PALLET"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/labels'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
query_params[:'PageType'] = page_type
query_params[:'LabelType'] = label_type
query_params[:'NumberOfPackages'] = opts[:'number_of_packages'] if !opts[:'number_of_packages'].nil?
query_params[:'PackageLabelsToPrint'] = @api_client.build_collection_param(opts[:'package_labels_to_print'], :csv) if !opts[:'package_labels_to_print'].nil?
query_params[:'NumberOfPallets'] = opts[:'number_of_pallets'] if !opts[:'number_of_pallets'].nil?
query_params[:'PageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
query_params[:'PageStartIndex'] = opts[:'page_start_index'] if !opts[:'page_start_index'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetLabelsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns pre-order information, including dates, that a seller needs before confirming a shipment for pre-order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param marketplace_id A marketplace identifier. Specifies the marketplace the shipment is tied to.
# @param [Hash] opts the optional parameters
# @return [GetPreorderInfoResponse]
def get_preorder_info(shipment_id, marketplace_id, opts = {})
data, _status_code, _headers = get_preorder_info_with_http_info(shipment_id, marketplace_id, opts)
data
end
# Returns pre-order information, including dates, that a seller needs before confirming a shipment for pre-order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param marketplace_id A marketplace identifier. Specifies the marketplace the shipment is tied to.
# @param [Hash] opts the optional parameters
# @return [Array<(GetPreorderInfoResponse, Integer, Hash)>] GetPreorderInfoResponse data, response status code and response headers
def get_preorder_info_with_http_info(shipment_id, marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_preorder_info ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_preorder_info"
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_preorder_info"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/preorder'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
query_params[:'MarketplaceId'] = marketplace_id
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetPreorderInfoResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_preorder_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param ship_to_country_code The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response.
# @option opts [Array<String>] :asin_list A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers.
# @return [GetPrepInstructionsResponse]
def get_prep_instructions(ship_to_country_code, opts = {})
data, _status_code, _headers = get_prep_instructions_with_http_info(ship_to_country_code, opts)
data
end
# Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param ship_to_country_code The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :seller_sku_list A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response.
# @option opts [Array<String>] :asin_list A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers.
# @return [Array<(GetPrepInstructionsResponse, Integer, Hash)>] GetPrepInstructionsResponse data, response status code and response headers
def get_prep_instructions_with_http_info(ship_to_country_code, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_prep_instructions ...'
end
# verify the required parameter 'ship_to_country_code' is set
if @api_client.config.client_side_validation && ship_to_country_code.nil?
fail ArgumentError, "Missing the required parameter 'ship_to_country_code' when calling FbaInboundApi.get_prep_instructions"
end
# resource path
local_var_path = '/fba/inbound/v0/prepInstructions'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ShipToCountryCode'] = ship_to_country_code
query_params[:'SellerSKUList'] = @api_client.build_collection_param(opts[:'seller_sku_list'], :csv) if !opts[:'seller_sku_list'].nil?
query_params[:'ASINList'] = @api_client.build_collection_param(opts[:'asin_list'], :csv) if !opts[:'asin_list'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetPrepInstructionsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_prep_instructions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param query_type Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :last_updated_after A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [DateTime] :last_updated_before A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [String] :next_token A string token returned in the response to your previous request.
# @return [GetShipmentItemsResponse]
def get_shipment_items(query_type, marketplace_id, opts = {})
data, _status_code, _headers = get_shipment_items_with_http_info(query_type, marketplace_id, opts)
data
end
# Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param query_type Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :last_updated_after A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [DateTime] :last_updated_before A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [String] :next_token A string token returned in the response to your previous request.
# @return [Array<(GetShipmentItemsResponse, Integer, Hash)>] GetShipmentItemsResponse data, response status code and response headers
def get_shipment_items_with_http_info(query_type, marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipment_items ...'
end
# verify the required parameter 'query_type' is set
if @api_client.config.client_side_validation && query_type.nil?
fail ArgumentError, "Missing the required parameter 'query_type' when calling FbaInboundApi.get_shipment_items"
end
# verify enum value
if @api_client.config.client_side_validation && !['DATE_RANGE', 'NEXT_TOKEN'].include?(query_type)
fail ArgumentError, "invalid value for 'query_type', must be one of DATE_RANGE, NEXT_TOKEN"
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_shipment_items"
end
# resource path
local_var_path = '/fba/inbound/v0/shipmentItems'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'QueryType'] = query_type
query_params[:'MarketplaceId'] = marketplace_id
query_params[:'LastUpdatedAfter'] = opts[:'last_updated_after'] if !opts[:'last_updated_after'].nil?
query_params[:'LastUpdatedBefore'] = opts[:'last_updated_before'] if !opts[:'last_updated_before'].nil?
query_params[:'NextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetShipmentItemsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_shipment_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of items in a specified inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier used for selecting items in a specific inbound shipment.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @return [GetShipmentItemsResponse]
def get_shipment_items_by_shipment_id(shipment_id, marketplace_id, opts = {})
data, _status_code, _headers = get_shipment_items_by_shipment_id_with_http_info(shipment_id, marketplace_id, opts)
data
end
# Returns a list of items in a specified inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier used for selecting items in a specific inbound shipment.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @return [Array<(GetShipmentItemsResponse, Integer, Hash)>] GetShipmentItemsResponse data, response status code and response headers
def get_shipment_items_by_shipment_id_with_http_info(shipment_id, marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipment_items_by_shipment_id ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_shipment_items_by_shipment_id"
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_shipment_items_by_shipment_id"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/items'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
query_params[:'MarketplaceId'] = marketplace_id
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetShipmentItemsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_shipment_items_by_shipment_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of inbound shipments based on criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param query_type Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :shipment_status_list A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify.
# @option opts [Array<String>] :shipment_id_list A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned.
# @option opts [DateTime] :last_updated_after A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [DateTime] :last_updated_before A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [String] :next_token A string token returned in the response to your previous request.
# @return [GetShipmentsResponse]
def get_shipments(query_type, marketplace_id, opts = {})
data, _status_code, _headers = get_shipments_with_http_info(query_type, marketplace_id, opts)
data
end
# Returns a list of inbound shipments based on criteria that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param query_type Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request.
# @param marketplace_id A marketplace identifier. Specifies the marketplace where the product would be stored.
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :shipment_status_list A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify.
# @option opts [Array<String>] :shipment_id_list A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned.
# @option opts [DateTime] :last_updated_after A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [DateTime] :last_updated_before A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
# @option opts [String] :next_token A string token returned in the response to your previous request.
# @return [Array<(GetShipmentsResponse, Integer, Hash)>] GetShipmentsResponse data, response status code and response headers
def get_shipments_with_http_info(query_type, marketplace_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_shipments ...'
end
# verify the required parameter 'query_type' is set
if @api_client.config.client_side_validation && query_type.nil?
fail ArgumentError, "Missing the required parameter 'query_type' when calling FbaInboundApi.get_shipments"
end
# verify enum value
if @api_client.config.client_side_validation && !['SHIPMENT', 'DATE_RANGE', 'NEXT_TOKEN'].include?(query_type)
fail ArgumentError, "invalid value for 'query_type', must be one of SHIPMENT, DATE_RANGE, NEXT_TOKEN"
end
# verify the required parameter 'marketplace_id' is set
if @api_client.config.client_side_validation && marketplace_id.nil?
fail ArgumentError, "Missing the required parameter 'marketplace_id' when calling FbaInboundApi.get_shipments"
end
if @api_client.config.client_side_validation && opts[:'shipment_status_list'] && !opts[:'shipment_status_list'].all? { |item| ['WORKING', 'SHIPPED', 'RECEIVING', 'CANCELLED', 'DELETED', 'CLOSED', 'ERROR', 'IN_TRANSIT', 'DELIVERED', 'CHECKED_IN'].include?(item) }
fail ArgumentError, 'invalid value for "shipment_status_list", must include one of WORKING, SHIPPED, RECEIVING, CANCELLED, DELETED, CLOSED, ERROR, IN_TRANSIT, DELIVERED, CHECKED_IN'
end
# resource path
local_var_path = '/fba/inbound/v0/shipments'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'QueryType'] = query_type
query_params[:'MarketplaceId'] = marketplace_id
query_params[:'ShipmentStatusList'] = @api_client.build_collection_param(opts[:'shipment_status_list'], :csv) if !opts[:'shipment_status_list'].nil?
query_params[:'ShipmentIdList'] = @api_client.build_collection_param(opts[:'shipment_id_list'], :csv) if !opts[:'shipment_id_list'].nil?
query_params[:'LastUpdatedAfter'] = opts[:'last_updated_after'] if !opts[:'last_updated_after'].nil?
query_params[:'LastUpdatedBefore'] = opts[:'last_updated_before'] if !opts[:'last_updated_before'].nil?
query_params[:'NextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetShipmentsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_shipments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns current transportation information about an inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [GetTransportDetailsResponse]
def get_transport_details(shipment_id, opts = {})
data, _status_code, _headers = get_transport_details_with_http_info(shipment_id, opts)
data
end
# Returns current transportation information about an inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(GetTransportDetailsResponse, Integer, Hash)>] GetTransportDetailsResponse data, response status code and response headers
def get_transport_details_with_http_info(shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.get_transport_details ...'
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.get_transport_details"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/transport'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
return_type = opts[:return_type] || 'GetTransportDetailsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#get_transport_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Sends transportation information to Amazon about an inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [PutTransportDetailsResponse]
def put_transport_details(body, shipment_id, opts = {})
data, _status_code, _headers = put_transport_details_with_http_info(body, shipment_id, opts)
data
end
# Sends transportation information to Amazon about an inbound shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(PutTransportDetailsResponse, Integer, Hash)>] PutTransportDetailsResponse data, response status code and response headers
def put_transport_details_with_http_info(body, shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.put_transport_details ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FbaInboundApi.put_transport_details"
end
# verify the required parameter 'shipment_id' is set
if @api_client.config.client_side_validation && shipment_id.nil?
fail ArgumentError, "Missing the required parameter 'shipment_id' when calling FbaInboundApi.put_transport_details"
end
# resource path
local_var_path = '/fba/inbound/v0/shipments/{shipmentId}/transport'.sub('{' + 'shipmentId' + '}', shipment_id.to_s)
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(body)
return_type = opts[:return_type] || 'PutTransportDetailsResponse'
auth_names = opts[:auth_names] || []
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: FbaInboundApi#put_transport_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Updates or removes items from the inbound shipment identified by the specified shipment identifier. Adding new items is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [InboundShipmentResponse]
def update_inbound_shipment(body, shipment_id, opts = {})
data, _status_code, _headers = update_inbound_shipment_with_http_info(body, shipment_id, opts)
data
end
# Updates or removes items from the inbound shipment identified by the specified shipment identifier. Adding new items is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
# @param body
# @param shipment_id A shipment identifier originally returned by the createInboundShipmentPlan operation.
# @param [Hash] opts the optional parameters
# @return [Array<(InboundShipmentResponse, Integer, Hash)>] InboundShipmentResponse data, response status code and response headers
def update_inbound_shipment_with_http_info(body, shipment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FbaInboundApi.update_inbound_shipment ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling FbaInboundApi.update_inbound_shipment"
end
# verify the required parameter 'shipment_id' is set