shipbob-node-sdk 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1434 @@
1
+ import type { Nullable } from '.';
2
+ export type ChannelsResponse = {
3
+ id: number;
4
+ name: string;
5
+ application_name: string;
6
+ scopes: string[];
7
+ }[];
8
+ export type Address = {
9
+ /**
10
+ * First line of the address
11
+ */
12
+ address1: string;
13
+ /**
14
+ * Second line of the address
15
+ */
16
+ address2?: Nullable<string>;
17
+ /**
18
+ * Name of the company receiving the shipment
19
+ */
20
+ company_name?: Nullable<string>;
21
+ /**
22
+ * The city
23
+ */
24
+ city: Required<string>;
25
+ /**
26
+ * The state or province
27
+ * Not required, but not all countries have state/province
28
+ */
29
+ state: Nullable<string>;
30
+ /**
31
+ * The country (Must be ISO Alpha-2 for estimates)
32
+ */
33
+ country: string;
34
+ /**
35
+ * The zip code or postal code
36
+ */
37
+ zip_code: string;
38
+ };
39
+ /**
40
+ * Returns also everything else including onhand, etc. Stuff that makes no sense at this point.
41
+ */
42
+ export type AddProductResponse = {
43
+ id: number;
44
+ reference_id: string;
45
+ };
46
+ export type GetProducts1_0QueryString = Partial<{
47
+ ReferenceIds: string;
48
+ Page: number;
49
+ Limit: number;
50
+ IDs: string;
51
+ Search: string;
52
+ ActiveStatus: 'Any' | 'Active' | 'Inactive';
53
+ BundleStatus: 'Any' | 'Bundle' | 'NotBundle';
54
+ }>;
55
+ /**
56
+ * This is missing practically all fields of actual result.
57
+ */
58
+ export type GetProduct1_0Result = {
59
+ id: number;
60
+ reference_id: string;
61
+ };
62
+ export type ActionName = 'Dispose' | 'Restock' | 'Quarantine';
63
+ export type ProductType = 'Regular' | 'Bundle';
64
+ export type GetProduct2_0Variant = {
65
+ /**
66
+ * The expected barcode to be found on the item and checked during the pick process
67
+ */
68
+ barcode: string;
69
+ barcode_sticker_url: Nullable<string>;
70
+ channel_metadata: unknown[];
71
+ reviews_pending: unknown[];
72
+ associated_bundles: unknown[];
73
+ bundle_definition: unknown[];
74
+ created_on: string;
75
+ customs: {
76
+ /**
77
+ * The customs code (6 digit)
78
+ */
79
+ hs_tariff_code: string;
80
+ /**
81
+ * 2 character country code
82
+ */
83
+ country_code_of_origin: string;
84
+ /**
85
+ * Value of object for customs (in USD)
86
+ */
87
+ value: Nullable<string>;
88
+ currency: 'USD';
89
+ /**
90
+ * Description of product for customs purposes
91
+ */
92
+ description: string;
93
+ is321_eligible: boolean;
94
+ };
95
+ dimension: {
96
+ length: number;
97
+ width: number;
98
+ height: number;
99
+ /**
100
+ * "inch"
101
+ */
102
+ unit: string;
103
+ is_locked: boolean;
104
+ /**
105
+ * ie: "UserEntry"
106
+ */
107
+ source: string;
108
+ };
109
+ fulfillment_settings: {
110
+ /**
111
+ * If the product requires a prop65 label in the box
112
+ */
113
+ requires_prop65: false;
114
+ serial_scan: {
115
+ /**
116
+ * Indicates if a Serial Scan is required during the pack process.
117
+ * Note: Serial scan requires either a prefix or a suffix to be defined
118
+ */
119
+ is_enabled: false;
120
+ /**
121
+ * The prefix expected on the serial number
122
+ */
123
+ prefix: string;
124
+ /**
125
+ * The suffix expected on the serial number
126
+ */
127
+ suffix: string;
128
+ /**
129
+ * The exact number of characters expected in the serial number
130
+ */
131
+ exact_character_length: Nullable<number>;
132
+ };
133
+ /**
134
+ * If the product needs to classified as a hazmat product with the shipping carrier
135
+ */
136
+ dangerous_goods: false;
137
+ /**
138
+ * URL of the Safety Data Sheet for this product.
139
+ * Note: should be populated by ShipBob system via the UI, should not reference a URL outside of the ShipBob domain
140
+ */
141
+ msds_url: string;
142
+ /**
143
+ * If the product should be picked as an entire case
144
+ */
145
+ is_case_pick: boolean;
146
+ /**
147
+ * Is Bound Printed Matter, must be set by the ShipBob internal team
148
+ */
149
+ is_bpm_parcel: boolean;
150
+ };
151
+ /**
152
+ * Global Trade Item Number
153
+ */
154
+ gtin: string;
155
+ /**
156
+ * Variant Id (used to alter product lot, packaging, etc.)
157
+ */
158
+ id: number;
159
+ inventory: {
160
+ inventory_id: number;
161
+ on_hand_qty: number;
162
+ };
163
+ is_digital: boolean;
164
+ lot_information: {
165
+ /**
166
+ * If the product should use lot date based picking
167
+ */
168
+ is_lot: boolean;
169
+ minimum_shelf_life_days: Nullable<number>;
170
+ };
171
+ /**
172
+ * Name of the Variant (should match the Product name if a non-varying product)
173
+ */
174
+ name: string;
175
+ /**
176
+ * PDf has wrong field: The specific material to package the product in (box, poly mailer, bubble mailer, etc_
177
+ */
178
+ packaging_material_type: {
179
+ id: number;
180
+ /**
181
+ * Not sure what else can be here
182
+ */
183
+ name: 'Box';
184
+ };
185
+ /**
186
+ * PDF has wrong field. int The id of the packaging_requirement (No requirement, fragile, ship in own container, etc)
187
+ */
188
+ packaging_requirement: {
189
+ id: number;
190
+ name: 'NoRequirements' | 'Fragile';
191
+ };
192
+ return_preferences: {
193
+ /**
194
+ * Restock (1) Quarantine (2) Dispose (3)
195
+ */
196
+ primary_action: Nullable<{
197
+ id: number;
198
+ name: ActionName;
199
+ }>;
200
+ /**
201
+ * Restock (1) Quarantine (2) Dispose (3)
202
+ */
203
+ backup_action: Nullable<{
204
+ id: number;
205
+ name: ActionName;
206
+ }>;
207
+ /**
208
+ * Instructions for inspecting returns
209
+ */
210
+ instructions: Nullable<string>;
211
+ return_to_sender_primary_action: Nullable<{
212
+ id: number;
213
+ name: ActionName;
214
+ }>;
215
+ return_to_sender_backup_action: Nullable<{
216
+ id: number;
217
+ name: ActionName;
218
+ }>;
219
+ };
220
+ /**
221
+ * The SKU of the product. This is a required field and must be unique.
222
+ */
223
+ sku: string;
224
+ /**
225
+ * PDF is incorrect - it describes in int. Active (1) or Inactive (2)
226
+ */
227
+ status: 'Active' | 'Inactive';
228
+ /**
229
+ * Universal Product Code
230
+ */
231
+ upc: string;
232
+ is_image_uploaded: false;
233
+ updated_on: string;
234
+ weight: {
235
+ weight: number;
236
+ /**
237
+ * ie: "oz"
238
+ */
239
+ unit: string;
240
+ };
241
+ additional_hazmat_attributes: Nullable<unknown>;
242
+ merge_children: [];
243
+ };
244
+ /**
245
+ * This is just some guessing based on found responses
246
+ */
247
+ export type GetProduct2_0Response = {
248
+ /**
249
+ * Product Id
250
+ */
251
+ id: number;
252
+ /**
253
+ * Product Name
254
+ */
255
+ name: string;
256
+ type: ProductType;
257
+ category: Nullable<unknown>;
258
+ sub_category: Nullable<unknown>;
259
+ user_id: number;
260
+ created_on: string;
261
+ updated_on: string;
262
+ /**
263
+ * null | ?
264
+ */
265
+ taxonomy: null;
266
+ variants: GetProduct2_0Variant[];
267
+ };
268
+ export type GetProductExperimentalVariant = Omit<GetProduct2_0Variant, 'barcode'> & {
269
+ barcodes: {
270
+ value: string;
271
+ sticker_url: Nullable<string>;
272
+ }[];
273
+ };
274
+ /**
275
+ * Just the barcode -> barcodes on the variant seems like the only difference so far.
276
+ */
277
+ export type GetProductExperimentalResponse = Omit<GetProduct2_0Response, 'variants'> & {
278
+ variants: GetProductExperimentalVariant[];
279
+ };
280
+ export type OrderType = 'DTC' | 'DropShip' | 'B2B' | 'Transportation';
281
+ export type AnyProduct = ({
282
+ /**
283
+ * Unique reference id of the product
284
+ */
285
+ reference_id: string;
286
+ /**
287
+ * Name of the product. Required if there is not an existing ShipBob product with a matching reference_id value.
288
+ */
289
+ name?: Nullable<string>;
290
+ /**
291
+ * Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1 (0-50 chars)
292
+ */
293
+ gtin?: Nullable<string>;
294
+ /**
295
+ * Universal Product Code - Unique external identifier
296
+ */
297
+ upc?: Nullable<string>;
298
+ /**
299
+ * Price for one item
300
+ */
301
+ unit_price?: Nullable<number>;
302
+ /**
303
+ * Product SKU
304
+ */
305
+ sku?: Nullable<string>;
306
+ } & {
307
+ /**
308
+ * Unique Id of the product. Not sure who would track **their** product ids..
309
+ */
310
+ id: number;
311
+ }) | {
312
+ /**
313
+ * Numeric assignment per item. Used as a reference number for multiple purposes such as split orders, split containers, etc.
314
+ */
315
+ external_line_id?: number;
316
+ /**
317
+ * The quantity of this product ordered
318
+ * (< 2147483647 LOL)
319
+ */
320
+ quantity: number;
321
+ /**
322
+ * Defined standard for measure for an item (each, inner pack, case, pallet). Values: EA, INP, CS and PL
323
+ */
324
+ quantity_unit_of_measure_code?: Nullable<string>;
325
+ required_lot?: {
326
+ lot_number: Nullable<string>;
327
+ /**
328
+ * string or null <date-time>
329
+ * Manually specified lot date
330
+ */
331
+ lot_date: Nullable<string>;
332
+ };
333
+ };
334
+ export type CancelOrderResponse = {
335
+ order_id: number;
336
+ order: {
337
+ id: number;
338
+ reference_id: string;
339
+ order_number: string;
340
+ status: string;
341
+ };
342
+ /**
343
+ * ie: "Success"
344
+ */
345
+ status: string;
346
+ canceled_shipment_results: {
347
+ /**
348
+ * ie: "Cancel". The docs are wrong. This is actually a number like 6.
349
+ */
350
+ action: number;
351
+ shipment_id: number;
352
+ is_success: boolean;
353
+ /**
354
+ * ie: "Order cancelled"
355
+ */
356
+ reason: string;
357
+ }[];
358
+ };
359
+ /**
360
+ * ShipBob.Orders.StatusResolver.OrderStatus
361
+ */
362
+ export type OrderStatusType = 'Processing' | 'Exception' | 'PartiallyFulfilled' | 'Fulfilled' | 'Cancelled' | 'ImportReview';
363
+ /**
364
+ * Shipbob.CoreModels.OrderStateResolver.OrderStatusEnum
365
+ */
366
+ export type ShipmentStatusType = 'None' | 'Processing' | 'Completed' | 'Exception' | 'OnHold' | 'Cancelled' | 'CleanSweeped' | 'LabeledCreated' | 'ImportReview';
367
+ export type OrderShipment = {
368
+ /**
369
+ * The datetime of Shipment delivered to customer.
370
+ *
371
+ * set is order_delivered webhook. ie: "2025-02-19T03:11:00+00:00"
372
+ */
373
+ delivery_date: Nullable<string>;
374
+ /**
375
+ * Unique id of the shipment
376
+ */
377
+ id: number;
378
+ /**
379
+ * order_shipped has no actual information on when the label was printed (unlike the UI)
380
+ * so, then to use this as a best guess (not always available)
381
+ */
382
+ last_update_at: Nullable<string>;
383
+ /**
384
+ * Id of the order this shipment belongs to
385
+ */
386
+ order_id: number;
387
+ /**
388
+ * Client-defined external unique id of the order this shipment belongs to
389
+ */
390
+ reference_id: string;
391
+ /**
392
+ * Information about the recipient of a shipment
393
+ */
394
+ recipient: {
395
+ name: string;
396
+ address: Address;
397
+ email: string;
398
+ phone_number: string;
399
+ };
400
+ /**
401
+ * OrderStateResolver.OrderStatusEnum
402
+ */
403
+ status: ShipmentStatusType;
404
+ status_details: {
405
+ /**
406
+ * ie: "OutOfStock"
407
+ */
408
+ name: string;
409
+ /**
410
+ * ie: "No Stock On Hand For Sku"
411
+ */
412
+ description: string;
413
+ id: number;
414
+ inventory_id: number;
415
+ exception_fulfillment_center_id: number;
416
+ /**
417
+ * Not sure what will be here - have only seen null
418
+ */
419
+ extra_information: null;
420
+ }[];
421
+ /**
422
+ * Tracking information for a shipment (null on creation)
423
+ */
424
+ tracking: Nullable<{
425
+ /**
426
+ * Carrier of the shipment
427
+ */
428
+ carrier: Nullable<string>;
429
+ /**
430
+ * Tracking number of the shipment
431
+ */
432
+ tracking_number: Nullable<string>;
433
+ /**
434
+ * The carrier's service which was used for this shipment
435
+ */
436
+ carrier_service: Nullable<string>;
437
+ /**
438
+ * URL to the website where a shipment can be tracked
439
+ */
440
+ tracking_url: Nullable<string>;
441
+ }[]>;
442
+ invoice_amount?: number;
443
+ invoice_currency_code?: string;
444
+ insurance_value?: Nullable<number>;
445
+ /**
446
+ * ie: "Ground"
447
+ */
448
+ ship_option?: string;
449
+ /**
450
+ * ie: "2024-04-09T06:59:59+00:00"
451
+ */
452
+ estimated_fulfillment_date?: string;
453
+ /**
454
+ * Is this when it was actually delivered?
455
+ * "2024-04-08T11:17:07.122+00:00"
456
+ */
457
+ actual_fulfillment_date?: string;
458
+ /**
459
+ * ie: "FulfilledOnTime", "Unavailable"
460
+ */
461
+ estimated_fulfillment_date_status?: string;
462
+ is_tracking_uploaded?: boolean;
463
+ };
464
+ export type Order = {
465
+ /**
466
+ * Unique id of the order
467
+ */
468
+ id: number;
469
+ /**
470
+ * Date this order was created
471
+ *
472
+ * ISO date. ie: "2019-08-24T14:15:22Z"
473
+ */
474
+ created_date: string;
475
+ /**
476
+ * Date this order was purchase by the end user
477
+ *
478
+ * ISO date. ie: "2019-08-24T14:15:22Z"
479
+ */
480
+ purchase_date: Nullable<string>;
481
+ /**
482
+ * Client-defined external unique id of the order
483
+ */
484
+ reference_id: string;
485
+ /**
486
+ * User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used
487
+ */
488
+ order_number: string;
489
+ /**
490
+ * ie "Processing" when created. We should be able to get order status updates via webhook
491
+ *
492
+ * ShipBob.Orders.StatusResolver.OrderStatus
493
+ * "Processing" "Exception" "PartiallyFulfilled" "Fulfilled" "Cancelled" "ImportReview"
494
+ */
495
+ status: OrderStatusType;
496
+ /**
497
+ * Shipbob.Orders.Common.OrderType
498
+ */
499
+ type: OrderType;
500
+ /**
501
+ * Created by channel metadata
502
+ */
503
+ channel: {
504
+ id: number;
505
+ /**
506
+ * ie: "ShipBobs-Shopify-Store"
507
+ */
508
+ name: string;
509
+ };
510
+ /**
511
+ * Client-defined shipping method
512
+ *
513
+ * ie: "Free 2-day Shipping"
514
+ */
515
+ shipping_method: string;
516
+ /**
517
+ * Information about the recipient of an order
518
+ */
519
+ recipient: {
520
+ name: string;
521
+ address: Address;
522
+ email: string;
523
+ phone_number: string;
524
+ };
525
+ /**
526
+ * List of products included in the order
527
+ *
528
+ * ShipBob.Orders.Presentation.ViewModels.ProductInfoViewModel
529
+ */
530
+ products: {
531
+ /**
532
+ * Unique id of the product
533
+ */
534
+ id: number;
535
+ /**
536
+ * Unique reference id of the product
537
+ */
538
+ reference_id: string;
539
+ /**
540
+ * The quantity of this product ordered
541
+ */
542
+ quantity: number;
543
+ /**
544
+ * Defined standard for measure for an item (each, inner pack, case, pallet). Values: EA, INP, CS and PL
545
+ */
546
+ quantity_unit_of_measure_code: Nullable<string>;
547
+ /**
548
+ * Stock keeping unit for the product
549
+ */
550
+ sku: string;
551
+ /**
552
+ * Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1
553
+ */
554
+ gtin: string;
555
+ /**
556
+ * Universal Product Code - Unique external identifier
557
+ */
558
+ upc: string;
559
+ /**
560
+ * Price for one item
561
+ */
562
+ unit_price: number;
563
+ /**
564
+ * Numeric assignment per item. Used as a reference number for multiple purposes such as split orders, split containers, etc.
565
+ */
566
+ external_line_id: number;
567
+ }[];
568
+ /**
569
+ * Client-defined order tags
570
+ */
571
+ tags: Record<string, string>;
572
+ /**
573
+ * Shipments affiliated with the order
574
+ * TODO: redo this as it's a union of 2 types.
575
+ * - ShipBob.Orders.Presentation.ViewModels.ShipmentViewModel
576
+ * - ShipBob.Orders.Presentation.ViewModels.InternalShipmentViewModel
577
+ * probably good idea to use what is generated from the OpenAPI and reference here - the generated has lots of TS errors.
578
+ */
579
+ shipments: OrderShipment[];
580
+ gift_message: string;
581
+ shipping_terms: {
582
+ /**
583
+ * ie: "Parcel"
584
+ */
585
+ carrier_type: CarrierShipType;
586
+ payment_term: PaymentShipTerm;
587
+ };
588
+ };
589
+ export type PaymentShipTerm = 'Collect' | 'ThirdParty' | 'Prepaid' | 'MerchantResponsible';
590
+ export type CarrierShipType = 'Parcel' | 'Freight';
591
+ export type PlaceOrderRequest = {
592
+ /**
593
+ * User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used (<= 400 characters)
594
+ */
595
+ order_number: Nullable<string>;
596
+ recipient: {
597
+ name: string;
598
+ address: Address;
599
+ /**
600
+ * Email address of the recipient
601
+ */
602
+ email?: Nullable<string>;
603
+ /**
604
+ * Phone number of the recipient (<= 50 characters)
605
+ */
606
+ phone_number?: Nullable<string>;
607
+ };
608
+ /**
609
+ * Products included in the order. Products identified by reference_id must also include the product name if there is no matching ShipBob product.
610
+ */
611
+ products: AnyProduct[];
612
+ /**
613
+ * Unique and immutable order identifier from your upstream system.
614
+ *
615
+ * Discussions with Simon. This is a forever unique identifier. ie: cannot be an IC order number like 18888888 - we could not reship.
616
+ *
617
+ * NOTE: reusing generates 422 error: "Cannot insert order with existing ReferenceId"
618
+ */
619
+ reference_id: string;
620
+ /**
621
+ * Contains properties that needs to be used for fulfilling B2B/Dropship orders.
622
+ */
623
+ retailer_program_data?: {
624
+ /**
625
+ * First initial documentation sent from buyer to seller with item(s) and quantities.
626
+ */
627
+ purchase_order_number: string;
628
+ /**
629
+ * Identifies retailer-merchant combination
630
+ */
631
+ retailer_program_type: string;
632
+ /**
633
+ * Store Number
634
+ */
635
+ mark_for_store?: Nullable<string>;
636
+ /**
637
+ * Identifies a merchant's store department
638
+ */
639
+ department?: Nullable<string>;
640
+ /**
641
+ * Expected delivery date
642
+ */
643
+ delivery_date?: Nullable<string>;
644
+ /**
645
+ * Customer Ticket Number
646
+ */
647
+ customer_ticket_number?: Nullable<string>;
648
+ /**
649
+ * The date the retailer has requested the order to ship by.
650
+ */
651
+ shipByDate?: Nullable<string>;
652
+ /**
653
+ * The date the retailer does not want the order shipped by.
654
+ */
655
+ doNotShipBeforeDate?: Nullable<string>;
656
+ };
657
+ /**
658
+ * Client-defined shipping method matching what the user has listed as the shipping method on the Ship Option Mapping setup page in the ShipBob Merchant Portal.
659
+ * If they don’t match, we will create a new one and default it to Standard
660
+ * (non-empty)
661
+ * ie: "Standard"
662
+ */
663
+ shipping_method: string;
664
+ /**
665
+ * Contains shipping properties that need to be used for fulfilling an order.
666
+ */
667
+ shipping_terms?: {
668
+ /**
669
+ * CarrierShipType: Enum: "Parcel" "Freight"
670
+ */
671
+ carrier_type: CarrierShipType;
672
+ /**
673
+ * PaymentShipTerm
674
+ */
675
+ payment_term: PaymentShipTerm;
676
+ };
677
+ /**
678
+ * Enum: "DTC" "DropShip" "B2B" "Transportation"
679
+ */
680
+ type: OrderType;
681
+ };
682
+ export type ShippingMethod = {
683
+ /**
684
+ * Unique id for shipping method
685
+ */
686
+ id: number;
687
+ /**
688
+ * Indicates if the shipping method is active
689
+ */
690
+ active: boolean;
691
+ /**
692
+ * Indicates the shipping method is a ShipBob default shipping method.
693
+ */
694
+ default: boolean;
695
+ /**
696
+ * Name of the ship method as selected by the merchant and saved in ShipBob’s database (i.e. “ground”).
697
+ *
698
+ * Corresponds to the shipping_method field in the Orders API.
699
+ */
700
+ name: string;
701
+ /**
702
+ * ShipBob.Orders.Presentation.ViewModels.ServiceLevelDetailViewModel)
703
+ */
704
+ service_level: {
705
+ /**
706
+ * Unique id for the service level
707
+ */
708
+ id: number;
709
+ /**
710
+ * The name or title of the service level
711
+ */
712
+ name: string;
713
+ };
714
+ };
715
+ export type Webhook = {
716
+ id: number;
717
+ /**
718
+ * ISO date format: "2025-02-14T22:21:33.4911731"
719
+ */
720
+ created_at: string;
721
+ /**
722
+ * The subscription topic for the webhook
723
+ */
724
+ topic: WebhookTopic;
725
+ /**
726
+ * This is what we provided to them.
727
+ */
728
+ subscription_url: string;
729
+ };
730
+ export type FulfillmentCenter = {
731
+ id: number;
732
+ /**
733
+ * ie: "Cicero (IL)"
734
+ */
735
+ name: string;
736
+ /**
737
+ * ie: "Central Standard Time"
738
+ */
739
+ timezone: string;
740
+ address1: string;
741
+ address2: string;
742
+ city: string;
743
+ /**
744
+ * ie: "IL"
745
+ */
746
+ state: string;
747
+ /**
748
+ * ie: "USA"
749
+ */
750
+ country: string;
751
+ zip_code: string;
752
+ phone_number: string;
753
+ email: string;
754
+ };
755
+ export type PackageType = 'Package' | 'Pallet' | 'FloorLoadedContainer';
756
+ export type BoxPackagingType = 'EverythingInOneBox' | 'OneSkuPerBox' | 'MultipleSkuPerBox';
757
+ /**
758
+ * The receiving order to create
759
+ */
760
+ export type WarehouseReceivingOrderRequest = {
761
+ /**
762
+ * Model containing information that assigns a receiving order to a fulfillment center.
763
+ * If the fulfillment center provided is in a receiving hub region, then the response will be the receiving hub location.
764
+ */
765
+ fulfillment_center: {
766
+ /**
767
+ * ID of the fulfillment center to assign this receiving order to
768
+ */
769
+ id: number;
770
+ };
771
+ package_type: PackageType;
772
+ box_packaging_type: BoxPackagingType;
773
+ /**
774
+ * Box shipments to be added to this receiving order
775
+ */
776
+ boxes: {
777
+ /**
778
+ * Tracking number for the box shipment.
779
+ *
780
+ * The API docs say "string or null", but if you pass null will get a 400: Boxes[...] 'The TrackingNumber field is required.'
781
+ */
782
+ tracking_number: string;
783
+ /**
784
+ * Items contained in this box
785
+ */
786
+ box_items: {
787
+ /**
788
+ * Quantity of the items in the box
789
+ *
790
+ * NOTE: integer <int32> [ 1 .. 2147483647 ]. LOL. 2 billion
791
+ */
792
+ quantity: number;
793
+ /**
794
+ * Unique inventory id of the items in the box
795
+ */
796
+ inventory_id: number;
797
+ /**
798
+ * Lot number of the items in the box. Must be supplied for products that have lot set, otherwise will be:
799
+ * 422 status code "Wrong Lot Information Provided For Inventory IDs: 8619859,8619860, etc."
800
+ */
801
+ lot_number?: Nullable<string>;
802
+ /**
803
+ * Lot expiration date for the items in the box
804
+ */
805
+ lot_date?: Nullable<string>;
806
+ }[];
807
+ }[];
808
+ /**
809
+ * Expected arrival date of all the box shipments in this receiving order
810
+ * ie: ISO date "2019-08-24T14:15:22Z"
811
+ *
812
+ * NOTE: Must be in the future or it will generate a 422 error.
813
+ */
814
+ expected_arrival_date: string;
815
+ /**
816
+ * Purchase order number for this receiving order
817
+ *
818
+ * NOTE: If you have characters other than /^[A-Za-z0-9 ]*$/ this will fail downstream for ShipBob. It will create the WRO ok though.
819
+ * NOTE: Supporting idempotency this must be unique across WROs
820
+ * Otherwise 422: "Request could not be completed, PO reference already exists and must be a unique value"
821
+ */
822
+ purchase_order_number?: Nullable<string>;
823
+ };
824
+ export type ReceivingStatus = 'Awaiting' | 'Processing' | 'Completed' | 'Cancelled' | 'Incomplete' | 'Arrived' | 'PartiallyArrived' | 'PartiallyArrivedAtHub' | 'ArrivedAtHub' | 'ProcessingAtHub' | 'InternalTransfer';
825
+ export type WarehouseReceivingOrderResponse = {
826
+ id: number;
827
+ /**
828
+ * Not sure what these could be. "Awaiting" is a staging status.
829
+ */
830
+ status: ReceivingStatus;
831
+ /**
832
+ * What was sent in the request
833
+ */
834
+ package_type: PackageType;
835
+ /**
836
+ * What was sent in the request
837
+ */
838
+ box_packaging_type: BoxPackagingType;
839
+ /**
840
+ * What was sent in the request (ISO date)
841
+ */
842
+ expected_arrival_date: string;
843
+ /**
844
+ * ISO date: "2025-02-18T19:25:13.034265+00:00"
845
+ */
846
+ insert_date: string;
847
+ /**
848
+ * ISO date
849
+ */
850
+ last_updated_date: string;
851
+ /**
852
+ * ie: "/2.0/receiving/442945/labels"
853
+ */
854
+ box_labels_uri: string;
855
+ fulfillment_center: FulfillmentCenter;
856
+ purchase_order_number: Nullable<string>;
857
+ inventory_quantities: {
858
+ inventory_id: number;
859
+ sku: string;
860
+ expected_quantity: number;
861
+ received_quantity: number;
862
+ stowed_quantity: number;
863
+ }[];
864
+ /**
865
+ * The timestamp in UTC when a 3rd party integrator has set in ShipBob system
866
+ *
867
+ * We set this in their receiving-extended API endpoints. Use case is for acknowledging completed orders.
868
+ * Their API has example: "2019-08-24T14:15:22Z"
869
+ */
870
+ external_sync_timestamp: Nullable<string>;
871
+ };
872
+ /**
873
+ * The simulation will work on our SandBox Environment.
874
+ */
875
+ export type Simulation = {
876
+ /**
877
+ * Identifies what action to perform on shipment.
878
+ */
879
+ action: 'ShipOrder' | 'DeliverOrder';
880
+ /**
881
+ * Delay time for action in minutes to be triggered after.
882
+ *
883
+ * NOTE: anything over 2880 will be clamped
884
+ */
885
+ delay?: Nullable<number>;
886
+ /**
887
+ * Next simulation action to be performed after it.
888
+ */
889
+ next?: Nullable<SimulateShipmentRequest>;
890
+ };
891
+ export type SimulateShipmentRequest = {
892
+ /**
893
+ * Shipment Id for simulation.
894
+ */
895
+ shipment_id: number;
896
+ /**
897
+ * Simulation actions object.
898
+ */
899
+ simulation: Simulation;
900
+ };
901
+ export type SimulateShipmentResponse = {
902
+ /**
903
+ * Simulation id for register simulation request.
904
+ * UUID ie: 439a9dec-9bff-4339-9564-89975d3a8f5c
905
+ */
906
+ simulation_id: string;
907
+ /**
908
+ * ie: "Simulation registered successfully"
909
+ */
910
+ message: string;
911
+ };
912
+ export type SimulationDetails = {
913
+ /**
914
+ * Identifies the action that was performed.
915
+ */
916
+ action: 'ShipOrder' | 'DeliverOrder';
917
+ /**
918
+ * Status of the simulation action.
919
+ */
920
+ status: 'Success' | 'Failed' | 'Pending' | 'Skipped';
921
+ /**
922
+ * Additional message for the action.
923
+ *
924
+ * ie:
925
+ * - "This simulated action has been completed successfully."
926
+ * - "This simulation action is not executed yet."
927
+ */
928
+ message: string;
929
+ /**
930
+ * Scheduled time if the action had a delay.
931
+ * ie: ISO date '2025-02-19T00:09:53.77' or NULL
932
+ */
933
+ schedule_time: Nullable<string>;
934
+ /**
935
+ * Nested object with details of subsequent simulation actions. This value would be null if there is no subsequent action.
936
+ */
937
+ next: Nullable<SimulationDetails>;
938
+ };
939
+ export type SimulationResponse = {
940
+ /**
941
+ * Simulation id for register simulation request.
942
+ */
943
+ simulation_id: string;
944
+ /**
945
+ * ID of the entity for which the simulation was registered.
946
+ */
947
+ entity_id: string;
948
+ /**
949
+ * Type of entity for which the simulation was registered.
950
+ *
951
+ * ie: "Order"
952
+ */
953
+ entity_type: string;
954
+ /**
955
+ * Object with details of simulation actions
956
+ * type: SimulationDetails (not described in docs)
957
+ */
958
+ simulation: SimulationDetails;
959
+ };
960
+ /**
961
+ * For each WRO that was supplied, if ExternalSync was updated
962
+ */
963
+ export type SetExternalSyncResponse = {
964
+ results: {
965
+ id: number;
966
+ action: 'ExternalSync';
967
+ is_success: boolean;
968
+ /**
969
+ * Probably a reason if it didn't succeed. Empty when it does succeed.
970
+ * ie: ""
971
+ */
972
+ reason: string;
973
+ }[];
974
+ };
975
+ export type BoxStatus = 'Awaiting' | 'Arrived' | 'Completed' | 'Counting' | 'Stowing' | 'Cancelled' | 'InternalTransfer';
976
+ /**
977
+ * Get Warehouse Receiving Order Boxes response
978
+ */
979
+ export type WarehouseReceivingOrderBoxesResponse = {
980
+ box_id: number;
981
+ /**
982
+ * The number of the box in the receiving order
983
+ */
984
+ box_number: number;
985
+ box_status: BoxStatus;
986
+ /**
987
+ * Date the box arrived
988
+ */
989
+ arrived_date: Nullable<string>;
990
+ /**
991
+ * Date the box was received
992
+ */
993
+ received_date: Nullable<string>;
994
+ /**
995
+ * Date counting of the box's inventory items started
996
+ */
997
+ counting_started_date: Nullable<string>;
998
+ /**
999
+ * Tracking number of the box shipment
1000
+ */
1001
+ tracking_number: Nullable<string>;
1002
+ /**
1003
+ * type: BoxItemViewModel
1004
+ */
1005
+ box_items: {
1006
+ /**
1007
+ * Quantity of the item included
1008
+ */
1009
+ quantity: number;
1010
+ /**
1011
+ * Quantity of the item that was received after processing the receiving order
1012
+ */
1013
+ received_quantity: number;
1014
+ /**
1015
+ * Quantity of the item that has been stowed
1016
+ */
1017
+ stowed_quantity: number;
1018
+ /**
1019
+ * Unique identifier of the inventory item
1020
+ */
1021
+ inventory_id: number;
1022
+ /**
1023
+ * Lot number the item belongs to
1024
+ */
1025
+ lot_number: Nullable<string>;
1026
+ /**
1027
+ * Expiration date of the item's lot
1028
+ */
1029
+ lot_date: Nullable<string>;
1030
+ }[];
1031
+ }[];
1032
+ export declare enum PackagingRequirement {
1033
+ 'No Requirements' = 1,
1034
+ Fragile = 2,
1035
+ 'Is Foldable' = 3,
1036
+ 'Is Media (Media mail)' = 4,
1037
+ 'Is Book' = 5,
1038
+ 'Is Poster' = 6,
1039
+ 'Is Apparel' = 7,
1040
+ 'Is Packaging Material (for custom boxes, marketing inserts, etc)' = 8,
1041
+ 'Ship In Own Container' = 9
1042
+ }
1043
+ export declare enum PackagingMaterial {
1044
+ 'Box' = 1,
1045
+ 'Bubble Mailer' = 2,
1046
+ 'Poly Mailer' = 3,
1047
+ 'Poster Tube' = 5,
1048
+ 'Custom Box' = 6,
1049
+ 'Bookfold' = 7,
1050
+ 'Ship In Own Container' = 8,
1051
+ 'Custom Bubble Mailer' = 9,
1052
+ 'Custom Poly Mailer' = 10
1053
+ }
1054
+ /**
1055
+ * Restock (1)
1056
+ * Quarantine (2)
1057
+ * Dispose (3)
1058
+ */
1059
+ export declare enum ReturnAction {
1060
+ /**
1061
+ * Restock (1)
1062
+ */
1063
+ Restock = 1,
1064
+ /**
1065
+ * Quarantine (2)
1066
+ */
1067
+ Quarantine = 2,
1068
+ /**
1069
+ * Dispose (3)
1070
+ */
1071
+ Dispose = 3
1072
+ }
1073
+ export type VariantRequestProductExperimental = Omit<VariantRequestProduct2_0, 'barcode'> & {
1074
+ barcodes: {
1075
+ value: string;
1076
+ sticker_url: Nullable<string>;
1077
+ }[];
1078
+ };
1079
+ export type VariantRequestProduct2_0 = {
1080
+ /**
1081
+ * Required for updates
1082
+ */
1083
+ id?: number;
1084
+ name?: string;
1085
+ sku?: string;
1086
+ /**
1087
+ * will serialize as a number
1088
+ */
1089
+ packaging_requirement_id?: PackagingRequirement;
1090
+ /**
1091
+ * will serialize as a number
1092
+ */
1093
+ packaging_material_type_id?: PackagingMaterial;
1094
+ barcode?: string;
1095
+ upc?: string;
1096
+ gtin?: string;
1097
+ customs?: {
1098
+ /**
1099
+ * 2 character country code
1100
+ */
1101
+ country_code_of_origin: 'US';
1102
+ /**
1103
+ * The customs code (6 digit)
1104
+ * ie: “6103.22”
1105
+ */
1106
+ hs_tariff_code: string;
1107
+ /**
1108
+ * Value of object for customs (in USD)
1109
+ * ie: “15”
1110
+ */
1111
+ value: string;
1112
+ /**
1113
+ * Description of product for customs purposes
1114
+ */
1115
+ description: string;
1116
+ };
1117
+ /**
1118
+ * Not sure if these can be partially supplied.
1119
+ */
1120
+ return_preferences?: {
1121
+ primary_action_id: Nullable<ReturnAction>;
1122
+ backup_action_id: null;
1123
+ /**
1124
+ * Cannot be set when "primary_action_id" has certain values (ie: Quarantine)
1125
+ * error: variants.return_preferences.instructions cannot be set for the selected primary action
1126
+ */
1127
+ instructions: Nullable<string>;
1128
+ return_to_sender_primary_action_id: Nullable<ReturnAction>;
1129
+ return_to_sender_backup_action_id: Nullable<ReturnAction>;
1130
+ };
1131
+ lot_information: {
1132
+ /**
1133
+ * If the product should use lot date based picking
1134
+ */
1135
+ is_lot: boolean;
1136
+ minimum_shelf_life_days: Nullable<number>;
1137
+ };
1138
+ };
1139
+ export type GetProductQueryStrings = Partial<{
1140
+ Page: number;
1141
+ Limit: number;
1142
+ /**
1143
+ * Regular product (1) or Bundle (2)
1144
+ */
1145
+ productTypeId: 1 | 2;
1146
+ /**
1147
+ * Active (1) or Inactive (2)
1148
+ */
1149
+ variantStatus: 1 | 2;
1150
+ /**
1151
+ * True -> at least one variant is digital
1152
+ * False -> at least one variant is not-digital
1153
+ */
1154
+ hasDigitalVariants: boolean;
1155
+ /**
1156
+ * Search by one or more Product Ids (comma separated) to return multiple products
1157
+ */
1158
+ Ids: string;
1159
+ /**
1160
+ * Search by one or more Variant Ids (comma separated) to return multiple products
1161
+ */
1162
+ VariantIds: string;
1163
+ /**
1164
+ * Search by product barcode
1165
+ */
1166
+ barcode: string;
1167
+ /**
1168
+ * Search by an exact sku
1169
+ */
1170
+ sku: string;
1171
+ /**
1172
+ * Search for products that vary or non-varying products
1173
+ */
1174
+ hasVariants: boolean;
1175
+ /**
1176
+ * Search by one or more InventoryIds (comma separated) to return multiple barcodes
1177
+ */
1178
+ InventoryId: string;
1179
+ /**
1180
+ * Search by Variant Name.
1181
+ * NOTE: Query parameters should be URL encoded such as "Green%20Shirt"
1182
+ */
1183
+ Name: string;
1184
+ /**
1185
+ * Search by matching Taxonomy (category) of the product (comma separated)
1186
+ */
1187
+ TaxonomyIds: string;
1188
+ }>;
1189
+ export type GetOrdersQueryStrings = {
1190
+ Page: number;
1191
+ Limit: number;
1192
+ /**
1193
+ * order ids to filter by, comma separated
1194
+ */
1195
+ Ids: string;
1196
+ /**
1197
+ * Reference ids to filter by, comma separated
1198
+ */
1199
+ ReferenceIds: string;
1200
+ /**
1201
+ * Start date to filter orders inserted later than
1202
+ */
1203
+ StartDate: string;
1204
+ /**
1205
+ * End date to filter orders inserted earlier than
1206
+ */
1207
+ EndDate: string;
1208
+ /**
1209
+ * Order to sort results in
1210
+ */
1211
+ SortOrder: 'Newest' | 'Oldest';
1212
+ /**
1213
+ * Has any portion of this order been assigned a tracking number
1214
+ */
1215
+ HasTracking: boolean;
1216
+ /**
1217
+ * Start date to filter orders updated later than
1218
+ */
1219
+ LastUpdateStartDate: string;
1220
+ /**
1221
+ * End date to filter orders updated later than
1222
+ */
1223
+ LastUpdateEndDate: string;
1224
+ /**
1225
+ * Filter orders that their tracking information was fully uploaded
1226
+ */
1227
+ IsTrackingUploaded: boolean;
1228
+ /**
1229
+ * Start date to filter orders with tracking updates later than the supplied date. Will only return orders that have tracking information
1230
+ */
1231
+ LastTrackingUpdateStartDate: string;
1232
+ /**
1233
+ * End date to filter orders updated later than the supplied date. Will only return orders that have tracking information
1234
+ */
1235
+ LastTrackingUpdateEndDate: string;
1236
+ };
1237
+ export type ExperimentalPagedResult<T> = {
1238
+ /**
1239
+ * Will be null when there are no items
1240
+ */
1241
+ first: Nullable<string>;
1242
+ next: Nullable<string>;
1243
+ items: T[];
1244
+ prev: Nullable<string>;
1245
+ /**
1246
+ * Will be null when there are no items.
1247
+ */
1248
+ last: Nullable<string>;
1249
+ };
1250
+ export type ListInventoryQueryStrings = {
1251
+ /**
1252
+ * Page of inventory items to get
1253
+ */
1254
+ Page: number;
1255
+ /**
1256
+ * Amount of inventory items per page to request
1257
+ * ie: [1 .. 250]
1258
+ */
1259
+ Limit: number;
1260
+ IsActive: boolean;
1261
+ IsDigital: boolean;
1262
+ IDs: number[];
1263
+ /**
1264
+ * Sort will default to ascending order for each field. To sort in descending order please pass a "-" in front of the field name. For example, Sort=-onHand,name will sort by onHand descending
1265
+ *
1266
+ * NOTE: if you sort a non-valid field will be a 422. ie: on_hand is not an available sort property
1267
+ *
1268
+ * NOTE: their API is a mix of pascalCase and snake_case.
1269
+ */
1270
+ Sort: string;
1271
+ /**
1272
+ * Search is available for 2 fields, Inventory ID and Name -
1273
+ *
1274
+ * Expected behavior for search by Inventory ID is exact match
1275
+ * Expected behavior for search by Inventory Name is partial match, i.e. does not have to be start of word, but must be consecutive characters. This is not case sensitive.
1276
+ */
1277
+ Search: string;
1278
+ /**
1279
+ * LocationType is valid for hub, spoke, or lts. LocationType will default to all locations.
1280
+ */
1281
+ LocationType: string;
1282
+ };
1283
+ export type GetInventory1_0Result = {
1284
+ id: number;
1285
+ name: string;
1286
+ is_digital: boolean;
1287
+ is_case_pick: boolean;
1288
+ is_lot: boolean;
1289
+ dimensions: {
1290
+ weight: number;
1291
+ length: number;
1292
+ width: number;
1293
+ depth: number;
1294
+ };
1295
+ /**
1296
+ * Total fulfillable quantity of this inventory item
1297
+ */
1298
+ total_fulfillable_quantity: number;
1299
+ /**
1300
+ * Total onhand quantity of this inventory item
1301
+ */
1302
+ total_onhand_quantity: number;
1303
+ /**
1304
+ * Total committed quantity of this inventory item
1305
+ */
1306
+ total_committed_quantity: number;
1307
+ /**
1308
+ * Total quantity that can be sold without overselling the inventory item. This is calculated by subtracting the total exception quantity from the fulfillable quantity.
1309
+ */
1310
+ total_sellable_quantity: number;
1311
+ /**
1312
+ * Total quantity in unreceived receiving orders for this inventory item
1313
+ */
1314
+ total_awaiting_quantity: number;
1315
+ /**
1316
+ * The total quantity of all items that are contained within orders that are in exception/out of stock status. Out of stock orders have not been processed and therefore do not have lot or fulfillment centers assigned.
1317
+ */
1318
+ total_exception_quantity: number;
1319
+ /**
1320
+ * The total quantity of all items that are in the process of internal transit between ShipBob fulfillment centers. These items are not pickable or fulfillable until they have been received and moved to the "On Hand" quantity of the destination FC. Internal transit quantities for each FC represent the incoming transfer stock for that specific location.
1321
+ */
1322
+ total_internal_transfer_quantity: number;
1323
+ /**
1324
+ * The amount of the item you need to send to ShipBob to fulfill all exception orders containing the item. This is the exception_quantity less the fulfillable_quantity of the item.
1325
+ */
1326
+ total_backordered_quantity: number;
1327
+ /**
1328
+ * Whether the inventory is active or not
1329
+ */
1330
+ is_active: boolean;
1331
+ /**
1332
+ * Fulfillable quantity of this inventory item broken down by fulfillment center location
1333
+ */
1334
+ fulfillable_quantity_by_fulfillment_center: {
1335
+ id: number;
1336
+ name: string;
1337
+ fulfillable_quantity: number;
1338
+ onhand_quantity: number;
1339
+ committed_quantity: number;
1340
+ awaiting_quantity: number;
1341
+ internal_transfer_quantity: number;
1342
+ }[];
1343
+ /**
1344
+ * Fulfillable quantity of this inventory item broken down by lot
1345
+ */
1346
+ fulfillable_quantity_by_lot: {
1347
+ lot_number: string;
1348
+ /**
1349
+ * ie: "2019-08-24T14:15:22Z"
1350
+ */
1351
+ expiration_date: string;
1352
+ fulfillable_quantity: number;
1353
+ onhand_quantity: number;
1354
+ committed_quantity: number;
1355
+ awaiting_quantity: number;
1356
+ internal_transfer_quantity: number;
1357
+ fulfillable_quantity_by_fulfillment_center: {
1358
+ id: number;
1359
+ name: string;
1360
+ fulfillable_quantity: number;
1361
+ onhand_quantity: number;
1362
+ committed_quantity: number;
1363
+ awaiting_quantity: number;
1364
+ internal_transfer_quantity: number;
1365
+ }[];
1366
+ }[];
1367
+ /**
1368
+ * ie: "None" "Fragile" "Foldable" "Stackable" "Book" "CustomPackaging" "CustomDunnage" "MarketingInsert" or "Poster"
1369
+ */
1370
+ packaging_attribute: 'None' | 'Fragile' | 'Foldable' | 'Stackable' | 'Book' | 'CustomPackaging' | 'CustomDunnage' | 'MarketingInsert' | 'Poster';
1371
+ };
1372
+ /**
1373
+ * The Topic and SubsciptionId are passed in the HTTP header of the webhook notification, with the names:
1374
+ * - shipbob-topic
1375
+ * - shipbob-subscription-id
1376
+ */
1377
+ export declare enum WebhookTopic {
1378
+ /**
1379
+ * Sends the full order payload when the label is purchased, printed, and placed on box for carrier pickup.
1380
+ * While the tracking # will be available, there may be a delay while carriers scan in the package.
1381
+ * If the order is split into multiple shipments, this will fire for each shipment that is part of the order.
1382
+ */
1383
+ OrderShipped = "order_shipped",
1384
+ /**
1385
+ * Sends the full shipment payload when a shipment is delivered by the carrier to the customer.
1386
+ * If the order is split into multiple shipments, this will fire for each shipment.
1387
+ */
1388
+ ShipmentDelivered = "shipment_delivered",
1389
+ /**
1390
+ * Sends the full shipment payload when a shipment moves to exception status.
1391
+ * Shipments are moved into exception because ShipBob is unable to fulfill the shipment.
1392
+ * Shipments are moved into exception status largely because one or more items in the shipment is out of stock.
1393
+ */
1394
+ ShipmentException = "shipment_exception",
1395
+ /**
1396
+ * Sends the full shipment payload when a shipment moves to On-Hold status.
1397
+ * Shipments are moved into On-Hold status by ShipBob when we are missing key information like Address or Packaging preferences.
1398
+ * Shipments can also be moved to On-Hold in the Merchant Dashboard. On-Hold Shipments will not be fulfilled.
1399
+ */
1400
+ ShipmentOnHold = "shipment_onhold",
1401
+ /**
1402
+ * Sends the full shipment payload when a shipment moves to cancelled status.
1403
+ * This webhook subcription will NOT notify you of cancelled split, copied, manual, and excel imported orders.
1404
+ * This functionality will be available on this webhook at a later point.
1405
+ */
1406
+ ShipmentCancelled = "shipment_cancelled"
1407
+ }
1408
+ /**
1409
+ * This can be used to lookup a webhook content based on the supplier "shipbob-topic" header.
1410
+ */
1411
+ export type WebhookResponsesByTopic = {
1412
+ topic: 'order_shipped';
1413
+ payload: Order;
1414
+ } | {
1415
+ topic: 'shipment_delivered';
1416
+ payload: Omit<OrderShipment, 'status'> & {
1417
+ status: 'Completed';
1418
+ };
1419
+ } | {
1420
+ topic: 'shipment_exception';
1421
+ payload: Omit<OrderShipment, 'status'> & {
1422
+ status: 'Exception';
1423
+ };
1424
+ } | {
1425
+ topic: 'shipment_onhold';
1426
+ payload: Omit<OrderShipment, 'status'> & {
1427
+ status: 'OnHold';
1428
+ };
1429
+ } | {
1430
+ topic: 'shipment_cancelled';
1431
+ payload: Omit<OrderShipment, 'status'> & {
1432
+ status: 'Cancelled';
1433
+ };
1434
+ };