shipbob-node-sdk 0.0.4 → 0.0.6
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.
- package/README.md +2 -2
- package/dist/index.d.ts +27 -1178
- package/dist/index.js +74 -156
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1427 -0
- package/dist/types.js +87 -0
- package/dist/types.js.map +1 -0
- package/package.json +1 -1
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1427 @@
|
|
|
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
|
+
* Id of the order this shipment belongs to
|
|
380
|
+
*/
|
|
381
|
+
order_id: number;
|
|
382
|
+
/**
|
|
383
|
+
* Client-defined external unique id of the order this shipment belongs to
|
|
384
|
+
*/
|
|
385
|
+
reference_id: string;
|
|
386
|
+
/**
|
|
387
|
+
* Information about the recipient of a shipment
|
|
388
|
+
*/
|
|
389
|
+
recipient: {
|
|
390
|
+
name: string;
|
|
391
|
+
address: Address;
|
|
392
|
+
email: string;
|
|
393
|
+
phone_number: string;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* OrderStateResolver.OrderStatusEnum
|
|
397
|
+
*/
|
|
398
|
+
status: ShipmentStatusType;
|
|
399
|
+
status_details: {
|
|
400
|
+
/**
|
|
401
|
+
* ie: "OutOfStock"
|
|
402
|
+
*/
|
|
403
|
+
name: string;
|
|
404
|
+
/**
|
|
405
|
+
* ie: "No Stock On Hand For Sku"
|
|
406
|
+
*/
|
|
407
|
+
description: string;
|
|
408
|
+
id: number;
|
|
409
|
+
inventory_id: number;
|
|
410
|
+
exception_fulfillment_center_id: number;
|
|
411
|
+
/**
|
|
412
|
+
* Not sure what will be here - have only seen null
|
|
413
|
+
*/
|
|
414
|
+
extra_information: null;
|
|
415
|
+
}[];
|
|
416
|
+
/**
|
|
417
|
+
* Tracking information for a shipment (null on creation)
|
|
418
|
+
*/
|
|
419
|
+
tracking: Nullable<{
|
|
420
|
+
/**
|
|
421
|
+
* Carrier of the shipment
|
|
422
|
+
*/
|
|
423
|
+
carrier: Nullable<string>;
|
|
424
|
+
/**
|
|
425
|
+
* Tracking number of the shipment
|
|
426
|
+
*/
|
|
427
|
+
tracking_number: Nullable<string>;
|
|
428
|
+
/**
|
|
429
|
+
* The carrier's service which was used for this shipment
|
|
430
|
+
*/
|
|
431
|
+
carrier_service: Nullable<string>;
|
|
432
|
+
/**
|
|
433
|
+
* URL to the website where a shipment can be tracked
|
|
434
|
+
*/
|
|
435
|
+
tracking_url: Nullable<string>;
|
|
436
|
+
}>;
|
|
437
|
+
invoice_amount?: number;
|
|
438
|
+
invoice_currency_code?: string;
|
|
439
|
+
insurance_value?: Nullable<number>;
|
|
440
|
+
/**
|
|
441
|
+
* ie: "Ground"
|
|
442
|
+
*/
|
|
443
|
+
ship_option?: string;
|
|
444
|
+
/**
|
|
445
|
+
* ie: "2024-04-09T06:59:59+00:00"
|
|
446
|
+
*/
|
|
447
|
+
estimated_fulfillment_date?: string;
|
|
448
|
+
/**
|
|
449
|
+
* Is this when it was actually delivered?
|
|
450
|
+
* "2024-04-08T11:17:07.122+00:00"
|
|
451
|
+
*/
|
|
452
|
+
actual_fulfillment_date?: string;
|
|
453
|
+
/**
|
|
454
|
+
* ie: "FulfilledOnTime", "Unavailable"
|
|
455
|
+
*/
|
|
456
|
+
estimated_fulfillment_date_status?: string;
|
|
457
|
+
is_tracking_uploaded?: boolean;
|
|
458
|
+
};
|
|
459
|
+
export type Order = {
|
|
460
|
+
/**
|
|
461
|
+
* Unique id of the order
|
|
462
|
+
*/
|
|
463
|
+
id: number;
|
|
464
|
+
/**
|
|
465
|
+
* Date this order was created
|
|
466
|
+
*
|
|
467
|
+
* ISO date. ie: "2019-08-24T14:15:22Z"
|
|
468
|
+
*/
|
|
469
|
+
created_date: string;
|
|
470
|
+
/**
|
|
471
|
+
* Date this order was purchase by the end user
|
|
472
|
+
*
|
|
473
|
+
* ISO date. ie: "2019-08-24T14:15:22Z"
|
|
474
|
+
*/
|
|
475
|
+
purchase_date: Nullable<string>;
|
|
476
|
+
/**
|
|
477
|
+
* Client-defined external unique id of the order
|
|
478
|
+
*/
|
|
479
|
+
reference_id: string;
|
|
480
|
+
/**
|
|
481
|
+
* User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used
|
|
482
|
+
*/
|
|
483
|
+
order_number: string;
|
|
484
|
+
/**
|
|
485
|
+
* ie "Processing" when created. We should be able to get order status updates via webhook
|
|
486
|
+
*
|
|
487
|
+
* ShipBob.Orders.StatusResolver.OrderStatus
|
|
488
|
+
* "Processing" "Exception" "PartiallyFulfilled" "Fulfilled" "Cancelled" "ImportReview"
|
|
489
|
+
*/
|
|
490
|
+
status: OrderStatusType;
|
|
491
|
+
/**
|
|
492
|
+
* Shipbob.Orders.Common.OrderType
|
|
493
|
+
*/
|
|
494
|
+
type: OrderType;
|
|
495
|
+
/**
|
|
496
|
+
* Created by channel metadata
|
|
497
|
+
*/
|
|
498
|
+
channel: {
|
|
499
|
+
id: number;
|
|
500
|
+
/**
|
|
501
|
+
* ie: "ShipBobs-Shopify-Store"
|
|
502
|
+
*/
|
|
503
|
+
name: string;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Client-defined shipping method
|
|
507
|
+
*
|
|
508
|
+
* ie: "Free 2-day Shipping"
|
|
509
|
+
*/
|
|
510
|
+
shipping_method: string;
|
|
511
|
+
/**
|
|
512
|
+
* Information about the recipient of an order
|
|
513
|
+
*/
|
|
514
|
+
recipient: {
|
|
515
|
+
name: string;
|
|
516
|
+
address: Address;
|
|
517
|
+
email: string;
|
|
518
|
+
phone_number: string;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* List of products included in the order
|
|
522
|
+
*
|
|
523
|
+
* ShipBob.Orders.Presentation.ViewModels.ProductInfoViewModel
|
|
524
|
+
*/
|
|
525
|
+
products: {
|
|
526
|
+
/**
|
|
527
|
+
* Unique id of the product
|
|
528
|
+
*/
|
|
529
|
+
id: number;
|
|
530
|
+
/**
|
|
531
|
+
* Unique reference id of the product
|
|
532
|
+
*/
|
|
533
|
+
reference_id: string;
|
|
534
|
+
/**
|
|
535
|
+
* The quantity of this product ordered
|
|
536
|
+
*/
|
|
537
|
+
quantity: number;
|
|
538
|
+
/**
|
|
539
|
+
* Defined standard for measure for an item (each, inner pack, case, pallet). Values: EA, INP, CS and PL
|
|
540
|
+
*/
|
|
541
|
+
quantity_unit_of_measure_code: Nullable<string>;
|
|
542
|
+
/**
|
|
543
|
+
* Stock keeping unit for the product
|
|
544
|
+
*/
|
|
545
|
+
sku: string;
|
|
546
|
+
/**
|
|
547
|
+
* Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1
|
|
548
|
+
*/
|
|
549
|
+
gtin: string;
|
|
550
|
+
/**
|
|
551
|
+
* Universal Product Code - Unique external identifier
|
|
552
|
+
*/
|
|
553
|
+
upc: string;
|
|
554
|
+
/**
|
|
555
|
+
* Price for one item
|
|
556
|
+
*/
|
|
557
|
+
unit_price: number;
|
|
558
|
+
/**
|
|
559
|
+
* Numeric assignment per item. Used as a reference number for multiple purposes such as split orders, split containers, etc.
|
|
560
|
+
*/
|
|
561
|
+
external_line_id: number;
|
|
562
|
+
}[];
|
|
563
|
+
/**
|
|
564
|
+
* Client-defined order tags
|
|
565
|
+
*/
|
|
566
|
+
tags: Record<string, string>;
|
|
567
|
+
/**
|
|
568
|
+
* Shipments affiliated with the order
|
|
569
|
+
* TODO: redo this as it's a union of 2 types.
|
|
570
|
+
* - ShipBob.Orders.Presentation.ViewModels.ShipmentViewModel
|
|
571
|
+
* - ShipBob.Orders.Presentation.ViewModels.InternalShipmentViewModel
|
|
572
|
+
* probably good idea to use what is generated from the OpenAPI and reference here - the generated has lots of TS errors.
|
|
573
|
+
*/
|
|
574
|
+
shipments: OrderShipment[];
|
|
575
|
+
gift_message: string;
|
|
576
|
+
shipping_terms: {
|
|
577
|
+
/**
|
|
578
|
+
* ie: "Parcel"
|
|
579
|
+
*/
|
|
580
|
+
carrier_type: CarrierShipType;
|
|
581
|
+
payment_term: PaymentShipTerm;
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
export type PaymentShipTerm = 'Collect' | 'ThirdParty' | 'Prepaid' | 'MerchantResponsible';
|
|
585
|
+
export type CarrierShipType = 'Parcel' | 'Freight';
|
|
586
|
+
export type PlaceOrderRequest = {
|
|
587
|
+
/**
|
|
588
|
+
* User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used (<= 400 characters)
|
|
589
|
+
*/
|
|
590
|
+
order_number: Nullable<string>;
|
|
591
|
+
recipient: {
|
|
592
|
+
name: string;
|
|
593
|
+
address: Address;
|
|
594
|
+
/**
|
|
595
|
+
* Email address of the recipient
|
|
596
|
+
*/
|
|
597
|
+
email?: Nullable<string>;
|
|
598
|
+
/**
|
|
599
|
+
* Phone number of the recipient (<= 50 characters)
|
|
600
|
+
*/
|
|
601
|
+
phone_number?: Nullable<string>;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Products included in the order. Products identified by reference_id must also include the product name if there is no matching ShipBob product.
|
|
605
|
+
*/
|
|
606
|
+
products: AnyProduct[];
|
|
607
|
+
/**
|
|
608
|
+
* Unique and immutable order identifier from your upstream system.
|
|
609
|
+
*
|
|
610
|
+
* Discussions with Simon. This is a forever unique identifier. ie: cannot be an IC order number like 18888888 - we could not reship.
|
|
611
|
+
*
|
|
612
|
+
* NOTE: reusing generates 422 error: "Cannot insert order with existing ReferenceId"
|
|
613
|
+
*/
|
|
614
|
+
reference_id: string;
|
|
615
|
+
/**
|
|
616
|
+
* Contains properties that needs to be used for fulfilling B2B/Dropship orders.
|
|
617
|
+
*/
|
|
618
|
+
retailer_program_data?: {
|
|
619
|
+
/**
|
|
620
|
+
* First initial documentation sent from buyer to seller with item(s) and quantities.
|
|
621
|
+
*/
|
|
622
|
+
purchase_order_number: string;
|
|
623
|
+
/**
|
|
624
|
+
* Identifies retailer-merchant combination
|
|
625
|
+
*/
|
|
626
|
+
retailer_program_type: string;
|
|
627
|
+
/**
|
|
628
|
+
* Store Number
|
|
629
|
+
*/
|
|
630
|
+
mark_for_store?: Nullable<string>;
|
|
631
|
+
/**
|
|
632
|
+
* Identifies a merchant's store department
|
|
633
|
+
*/
|
|
634
|
+
department?: Nullable<string>;
|
|
635
|
+
/**
|
|
636
|
+
* Expected delivery date
|
|
637
|
+
*/
|
|
638
|
+
delivery_date?: Nullable<string>;
|
|
639
|
+
/**
|
|
640
|
+
* Customer Ticket Number
|
|
641
|
+
*/
|
|
642
|
+
customer_ticket_number?: Nullable<string>;
|
|
643
|
+
/**
|
|
644
|
+
* The date the retailer has requested the order to ship by.
|
|
645
|
+
*/
|
|
646
|
+
shipByDate?: Nullable<string>;
|
|
647
|
+
/**
|
|
648
|
+
* The date the retailer does not want the order shipped by.
|
|
649
|
+
*/
|
|
650
|
+
doNotShipBeforeDate?: Nullable<string>;
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* 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.
|
|
654
|
+
* If they don’t match, we will create a new one and default it to Standard
|
|
655
|
+
* (non-empty)
|
|
656
|
+
* ie: "Standard"
|
|
657
|
+
*/
|
|
658
|
+
shipping_method: string;
|
|
659
|
+
/**
|
|
660
|
+
* Contains shipping properties that need to be used for fulfilling an order.
|
|
661
|
+
*/
|
|
662
|
+
shipping_terms?: {
|
|
663
|
+
/**
|
|
664
|
+
* CarrierShipType: Enum: "Parcel" "Freight"
|
|
665
|
+
*/
|
|
666
|
+
carrier_type: CarrierShipType;
|
|
667
|
+
/**
|
|
668
|
+
* PaymentShipTerm
|
|
669
|
+
*/
|
|
670
|
+
payment_term: PaymentShipTerm;
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* Enum: "DTC" "DropShip" "B2B" "Transportation"
|
|
674
|
+
*/
|
|
675
|
+
type: OrderType;
|
|
676
|
+
};
|
|
677
|
+
export type ShippingMethod = {
|
|
678
|
+
/**
|
|
679
|
+
* Unique id for shipping method
|
|
680
|
+
*/
|
|
681
|
+
id: number;
|
|
682
|
+
/**
|
|
683
|
+
* Indicates if the shipping method is active
|
|
684
|
+
*/
|
|
685
|
+
active: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Indicates the shipping method is a ShipBob default shipping method.
|
|
688
|
+
*/
|
|
689
|
+
default: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Name of the ship method as selected by the merchant and saved in ShipBob’s database (i.e. “ground”).
|
|
692
|
+
*
|
|
693
|
+
* Corresponds to the shipping_method field in the Orders API.
|
|
694
|
+
*/
|
|
695
|
+
name: string;
|
|
696
|
+
/**
|
|
697
|
+
* ShipBob.Orders.Presentation.ViewModels.ServiceLevelDetailViewModel)
|
|
698
|
+
*/
|
|
699
|
+
service_level: {
|
|
700
|
+
/**
|
|
701
|
+
* Unique id for the service level
|
|
702
|
+
*/
|
|
703
|
+
id: number;
|
|
704
|
+
/**
|
|
705
|
+
* The name or title of the service level
|
|
706
|
+
*/
|
|
707
|
+
name: string;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
export type Webhook = {
|
|
711
|
+
id: number;
|
|
712
|
+
/**
|
|
713
|
+
* ISO date format: "2025-02-14T22:21:33.4911731"
|
|
714
|
+
*/
|
|
715
|
+
created_at: string;
|
|
716
|
+
/**
|
|
717
|
+
* The subscription topic for the webhook
|
|
718
|
+
*/
|
|
719
|
+
topic: WebhookTopic;
|
|
720
|
+
/**
|
|
721
|
+
* This is what we provided to them.
|
|
722
|
+
*/
|
|
723
|
+
subscription_url: string;
|
|
724
|
+
};
|
|
725
|
+
export type FulfillmentCenter = {
|
|
726
|
+
id: number;
|
|
727
|
+
/**
|
|
728
|
+
* ie: "Cicero (IL)"
|
|
729
|
+
*/
|
|
730
|
+
name: string;
|
|
731
|
+
/**
|
|
732
|
+
* ie: "Central Standard Time"
|
|
733
|
+
*/
|
|
734
|
+
timezone: string;
|
|
735
|
+
address1: string;
|
|
736
|
+
address2: string;
|
|
737
|
+
city: string;
|
|
738
|
+
/**
|
|
739
|
+
* ie: "IL"
|
|
740
|
+
*/
|
|
741
|
+
state: string;
|
|
742
|
+
/**
|
|
743
|
+
* ie: "USA"
|
|
744
|
+
*/
|
|
745
|
+
country: string;
|
|
746
|
+
zip_code: string;
|
|
747
|
+
phone_number: string;
|
|
748
|
+
email: string;
|
|
749
|
+
};
|
|
750
|
+
export type PackageType = 'Package' | 'Pallet' | 'FloorLoadedContainer';
|
|
751
|
+
export type BoxPackagingType = 'EverythingInOneBox' | 'OneSkuPerBox' | 'MultipleSkuPerBox';
|
|
752
|
+
/**
|
|
753
|
+
* The receiving order to create
|
|
754
|
+
*/
|
|
755
|
+
export type WarehouseReceivingOrderRequest = {
|
|
756
|
+
/**
|
|
757
|
+
* Model containing information that assigns a receiving order to a fulfillment center.
|
|
758
|
+
* If the fulfillment center provided is in a receiving hub region, then the response will be the receiving hub location.
|
|
759
|
+
*/
|
|
760
|
+
fulfillment_center: {
|
|
761
|
+
/**
|
|
762
|
+
* ID of the fulfillment center to assign this receiving order to
|
|
763
|
+
*/
|
|
764
|
+
id: number;
|
|
765
|
+
};
|
|
766
|
+
package_type: PackageType;
|
|
767
|
+
box_packaging_type: BoxPackagingType;
|
|
768
|
+
/**
|
|
769
|
+
* Box shipments to be added to this receiving order
|
|
770
|
+
*/
|
|
771
|
+
boxes: {
|
|
772
|
+
/**
|
|
773
|
+
* Tracking number for the box shipment.
|
|
774
|
+
*
|
|
775
|
+
* The API docs say "string or null", but if you pass null will get a 400: Boxes[...] 'The TrackingNumber field is required.'
|
|
776
|
+
*/
|
|
777
|
+
tracking_number: string;
|
|
778
|
+
/**
|
|
779
|
+
* Items contained in this box
|
|
780
|
+
*/
|
|
781
|
+
box_items: {
|
|
782
|
+
/**
|
|
783
|
+
* Quantity of the items in the box
|
|
784
|
+
*
|
|
785
|
+
* NOTE: integer <int32> [ 1 .. 2147483647 ]. LOL. 2 billion
|
|
786
|
+
*/
|
|
787
|
+
quantity: number;
|
|
788
|
+
/**
|
|
789
|
+
* Unique inventory id of the items in the box
|
|
790
|
+
*/
|
|
791
|
+
inventory_id: number;
|
|
792
|
+
/**
|
|
793
|
+
* Lot number of the items in the box. Must be supplied for products that have lot set, otherwise will be:
|
|
794
|
+
* 422 status code "Wrong Lot Information Provided For Inventory IDs: 8619859,8619860, etc."
|
|
795
|
+
*/
|
|
796
|
+
lot_number?: Nullable<string>;
|
|
797
|
+
/**
|
|
798
|
+
* Lot expiration date for the items in the box
|
|
799
|
+
*/
|
|
800
|
+
lot_date?: Nullable<string>;
|
|
801
|
+
}[];
|
|
802
|
+
}[];
|
|
803
|
+
/**
|
|
804
|
+
* Expected arrival date of all the box shipments in this receiving order
|
|
805
|
+
* ie: ISO date "2019-08-24T14:15:22Z"
|
|
806
|
+
*
|
|
807
|
+
* NOTE: Must be in the future or it will generate a 422 error.
|
|
808
|
+
*/
|
|
809
|
+
expected_arrival_date: string;
|
|
810
|
+
/**
|
|
811
|
+
* Purchase order number for this receiving order,
|
|
812
|
+
*
|
|
813
|
+
* NOTE: Supporting idempotency this must be unique across WROs
|
|
814
|
+
* Otherwise 422: "Request could not be completed, PO reference already exists and must be a unique value"
|
|
815
|
+
*/
|
|
816
|
+
purchase_order_number?: Nullable<string>;
|
|
817
|
+
};
|
|
818
|
+
export type ReceivingStatus = 'Awaiting' | 'Processing' | 'Completed' | 'Cancelled' | 'Incomplete' | 'Arrived' | 'PartiallyArrived' | 'PartiallyArrivedAtHub' | 'ArrivedAtHub' | 'ProcessingAtHub' | 'InternalTransfer';
|
|
819
|
+
export type WarehouseReceivingOrderResponse = {
|
|
820
|
+
id: number;
|
|
821
|
+
/**
|
|
822
|
+
* Not sure what these could be. "Awaiting" is a staging status.
|
|
823
|
+
*/
|
|
824
|
+
status: ReceivingStatus;
|
|
825
|
+
/**
|
|
826
|
+
* What was sent in the request
|
|
827
|
+
*/
|
|
828
|
+
package_type: PackageType;
|
|
829
|
+
/**
|
|
830
|
+
* What was sent in the request
|
|
831
|
+
*/
|
|
832
|
+
box_packaging_type: BoxPackagingType;
|
|
833
|
+
/**
|
|
834
|
+
* What was sent in the request (ISO date)
|
|
835
|
+
*/
|
|
836
|
+
expected_arrival_date: string;
|
|
837
|
+
/**
|
|
838
|
+
* ISO date: "2025-02-18T19:25:13.034265+00:00"
|
|
839
|
+
*/
|
|
840
|
+
insert_date: string;
|
|
841
|
+
/**
|
|
842
|
+
* ISO date
|
|
843
|
+
*/
|
|
844
|
+
last_updated_date: string;
|
|
845
|
+
/**
|
|
846
|
+
* ie: "/2.0/receiving/442945/labels"
|
|
847
|
+
*/
|
|
848
|
+
box_labels_uri: string;
|
|
849
|
+
fulfillment_center: FulfillmentCenter;
|
|
850
|
+
purchase_order_number: Nullable<string>;
|
|
851
|
+
inventory_quantities: {
|
|
852
|
+
inventory_id: number;
|
|
853
|
+
sku: string;
|
|
854
|
+
expected_quantity: number;
|
|
855
|
+
received_quantity: number;
|
|
856
|
+
stowed_quantity: number;
|
|
857
|
+
}[];
|
|
858
|
+
/**
|
|
859
|
+
* The timestamp in UTC when a 3rd party integrator has set in ShipBob system
|
|
860
|
+
*
|
|
861
|
+
* We set this in their receiving-extended API endpoints. Use case is for acknowledging completed orders.
|
|
862
|
+
* Their API has example: "2019-08-24T14:15:22Z"
|
|
863
|
+
*/
|
|
864
|
+
external_sync_timestamp: Nullable<string>;
|
|
865
|
+
};
|
|
866
|
+
/**
|
|
867
|
+
* The simulation will work on our SandBox Environment.
|
|
868
|
+
*/
|
|
869
|
+
export type Simulation = {
|
|
870
|
+
/**
|
|
871
|
+
* Identifies what action to perform on shipment.
|
|
872
|
+
*/
|
|
873
|
+
action: 'ShipOrder' | 'DeliverOrder';
|
|
874
|
+
/**
|
|
875
|
+
* Delay time for action in minutes to be triggered after.
|
|
876
|
+
*
|
|
877
|
+
* NOTE: anything over 2880 will be clamped
|
|
878
|
+
*/
|
|
879
|
+
delay?: Nullable<number>;
|
|
880
|
+
/**
|
|
881
|
+
* Next simulation action to be performed after it.
|
|
882
|
+
*/
|
|
883
|
+
next?: Nullable<SimulateShipmentRequest>;
|
|
884
|
+
};
|
|
885
|
+
export type SimulateShipmentRequest = {
|
|
886
|
+
/**
|
|
887
|
+
* Shipment Id for simulation.
|
|
888
|
+
*/
|
|
889
|
+
shipment_id: number;
|
|
890
|
+
/**
|
|
891
|
+
* Simulation actions object.
|
|
892
|
+
*/
|
|
893
|
+
simulation: Simulation;
|
|
894
|
+
};
|
|
895
|
+
export type SimulateShipmentResponse = {
|
|
896
|
+
/**
|
|
897
|
+
* Simulation id for register simulation request.
|
|
898
|
+
* UUID ie: 439a9dec-9bff-4339-9564-89975d3a8f5c
|
|
899
|
+
*/
|
|
900
|
+
simulation_id: string;
|
|
901
|
+
/**
|
|
902
|
+
* ie: "Simulation registered successfully"
|
|
903
|
+
*/
|
|
904
|
+
message: string;
|
|
905
|
+
};
|
|
906
|
+
export type SimulationDetails = {
|
|
907
|
+
/**
|
|
908
|
+
* Identifies the action that was performed.
|
|
909
|
+
*/
|
|
910
|
+
action: 'ShipOrder' | 'DeliverOrder';
|
|
911
|
+
/**
|
|
912
|
+
* Status of the simulation action.
|
|
913
|
+
*/
|
|
914
|
+
status: 'Success' | 'Failed' | 'Pending' | 'Skipped';
|
|
915
|
+
/**
|
|
916
|
+
* Additional message for the action.
|
|
917
|
+
*
|
|
918
|
+
* ie:
|
|
919
|
+
* - "This simulated action has been completed successfully."
|
|
920
|
+
* - "This simulation action is not executed yet."
|
|
921
|
+
*/
|
|
922
|
+
message: string;
|
|
923
|
+
/**
|
|
924
|
+
* Scheduled time if the action had a delay.
|
|
925
|
+
* ie: ISO date '2025-02-19T00:09:53.77' or NULL
|
|
926
|
+
*/
|
|
927
|
+
schedule_time: Nullable<string>;
|
|
928
|
+
/**
|
|
929
|
+
* Nested object with details of subsequent simulation actions. This value would be null if there is no subsequent action.
|
|
930
|
+
*/
|
|
931
|
+
next: Nullable<SimulationDetails>;
|
|
932
|
+
};
|
|
933
|
+
export type SimulationResponse = {
|
|
934
|
+
/**
|
|
935
|
+
* Simulation id for register simulation request.
|
|
936
|
+
*/
|
|
937
|
+
simulation_id: string;
|
|
938
|
+
/**
|
|
939
|
+
* ID of the entity for which the simulation was registered.
|
|
940
|
+
*/
|
|
941
|
+
entity_id: string;
|
|
942
|
+
/**
|
|
943
|
+
* Type of entity for which the simulation was registered.
|
|
944
|
+
*
|
|
945
|
+
* ie: "Order"
|
|
946
|
+
*/
|
|
947
|
+
entity_type: string;
|
|
948
|
+
/**
|
|
949
|
+
* Object with details of simulation actions
|
|
950
|
+
* type: SimulationDetails (not described in docs)
|
|
951
|
+
*/
|
|
952
|
+
simulation: SimulationDetails;
|
|
953
|
+
};
|
|
954
|
+
/**
|
|
955
|
+
* For each WRO that was supplied, if ExternalSync was updated
|
|
956
|
+
*/
|
|
957
|
+
export type SetExternalSyncResponse = {
|
|
958
|
+
results: {
|
|
959
|
+
id: number;
|
|
960
|
+
action: 'ExternalSync';
|
|
961
|
+
is_success: boolean;
|
|
962
|
+
/**
|
|
963
|
+
* Probably a reason if it didn't succeed. Empty when it does succeed.
|
|
964
|
+
* ie: ""
|
|
965
|
+
*/
|
|
966
|
+
reason: string;
|
|
967
|
+
}[];
|
|
968
|
+
};
|
|
969
|
+
export type BoxStatus = 'Awaiting' | 'Arrived' | 'Completed' | 'Counting' | 'Stowing' | 'Cancelled' | 'InternalTransfer';
|
|
970
|
+
/**
|
|
971
|
+
* Get Warehouse Receiving Order Boxes response
|
|
972
|
+
*/
|
|
973
|
+
export type WarehouseReceivingOrderBoxesResponse = {
|
|
974
|
+
box_id: number;
|
|
975
|
+
/**
|
|
976
|
+
* The number of the box in the receiving order
|
|
977
|
+
*/
|
|
978
|
+
box_number: number;
|
|
979
|
+
box_status: BoxStatus;
|
|
980
|
+
/**
|
|
981
|
+
* Date the box arrived
|
|
982
|
+
*/
|
|
983
|
+
arrived_date: Nullable<string>;
|
|
984
|
+
/**
|
|
985
|
+
* Date the box was received
|
|
986
|
+
*/
|
|
987
|
+
received_date: Nullable<string>;
|
|
988
|
+
/**
|
|
989
|
+
* Date counting of the box's inventory items started
|
|
990
|
+
*/
|
|
991
|
+
counting_started_date: Nullable<string>;
|
|
992
|
+
/**
|
|
993
|
+
* Tracking number of the box shipment
|
|
994
|
+
*/
|
|
995
|
+
tracking_number: Nullable<string>;
|
|
996
|
+
/**
|
|
997
|
+
* type: BoxItemViewModel
|
|
998
|
+
*/
|
|
999
|
+
box_items: {
|
|
1000
|
+
/**
|
|
1001
|
+
* Quantity of the item included
|
|
1002
|
+
*/
|
|
1003
|
+
quantity: number;
|
|
1004
|
+
/**
|
|
1005
|
+
* Quantity of the item that was received after processing the receiving order
|
|
1006
|
+
*/
|
|
1007
|
+
received_quantity: number;
|
|
1008
|
+
/**
|
|
1009
|
+
* Quantity of the item that has been stowed
|
|
1010
|
+
*/
|
|
1011
|
+
stowed_quantity: number;
|
|
1012
|
+
/**
|
|
1013
|
+
* Unique identifier of the inventory item
|
|
1014
|
+
*/
|
|
1015
|
+
inventory_id: number;
|
|
1016
|
+
/**
|
|
1017
|
+
* Lot number the item belongs to
|
|
1018
|
+
*/
|
|
1019
|
+
lot_number: Nullable<string>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Expiration date of the item's lot
|
|
1022
|
+
*/
|
|
1023
|
+
lot_date: Nullable<string>;
|
|
1024
|
+
}[];
|
|
1025
|
+
}[];
|
|
1026
|
+
export declare enum PackagingRequirement {
|
|
1027
|
+
'No Requirements' = 1,
|
|
1028
|
+
Fragile = 2,
|
|
1029
|
+
'Is Foldable' = 3,
|
|
1030
|
+
'Is Media (Media mail)' = 4,
|
|
1031
|
+
'Is Book' = 5,
|
|
1032
|
+
'Is Poster' = 6,
|
|
1033
|
+
'Is Apparel' = 7,
|
|
1034
|
+
'Is Packaging Material (for custom boxes, marketing inserts, etc)' = 8,
|
|
1035
|
+
'Ship In Own Container' = 9
|
|
1036
|
+
}
|
|
1037
|
+
export declare enum PackagingMaterial {
|
|
1038
|
+
'Box' = 1,
|
|
1039
|
+
'Bubble Mailer' = 2,
|
|
1040
|
+
'Poly Mailer' = 3,
|
|
1041
|
+
'Poster Tube' = 5,
|
|
1042
|
+
'Custom Box' = 6,
|
|
1043
|
+
'Bookfold' = 7,
|
|
1044
|
+
'Ship In Own Container' = 8,
|
|
1045
|
+
'Custom Bubble Mailer' = 9,
|
|
1046
|
+
'Custom Poly Mailer' = 10
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Restock (1)
|
|
1050
|
+
* Quarantine (2)
|
|
1051
|
+
* Dispose (3)
|
|
1052
|
+
*/
|
|
1053
|
+
export declare enum ReturnAction {
|
|
1054
|
+
/**
|
|
1055
|
+
* Restock (1)
|
|
1056
|
+
*/
|
|
1057
|
+
Restock = 1,
|
|
1058
|
+
/**
|
|
1059
|
+
* Quarantine (2)
|
|
1060
|
+
*/
|
|
1061
|
+
Quarantine = 2,
|
|
1062
|
+
/**
|
|
1063
|
+
* Dispose (3)
|
|
1064
|
+
*/
|
|
1065
|
+
Dispose = 3
|
|
1066
|
+
}
|
|
1067
|
+
export type VariantRequestProductExperimental = Omit<VariantRequestProduct2_0, 'barcode'> & {
|
|
1068
|
+
barcodes: {
|
|
1069
|
+
value: string;
|
|
1070
|
+
sticker_url: Nullable<string>;
|
|
1071
|
+
}[];
|
|
1072
|
+
};
|
|
1073
|
+
export type VariantRequestProduct2_0 = {
|
|
1074
|
+
/**
|
|
1075
|
+
* Required for updates
|
|
1076
|
+
*/
|
|
1077
|
+
id?: number;
|
|
1078
|
+
name?: string;
|
|
1079
|
+
sku?: string;
|
|
1080
|
+
/**
|
|
1081
|
+
* will serialize as a number
|
|
1082
|
+
*/
|
|
1083
|
+
packaging_requirement_id?: PackagingRequirement;
|
|
1084
|
+
/**
|
|
1085
|
+
* will serialize as a number
|
|
1086
|
+
*/
|
|
1087
|
+
packaging_material_type_id?: PackagingMaterial;
|
|
1088
|
+
barcode?: string;
|
|
1089
|
+
upc?: string;
|
|
1090
|
+
gtin?: string;
|
|
1091
|
+
customs?: {
|
|
1092
|
+
/**
|
|
1093
|
+
* 2 character country code
|
|
1094
|
+
*/
|
|
1095
|
+
country_code_of_origin: 'US';
|
|
1096
|
+
/**
|
|
1097
|
+
* The customs code (6 digit)
|
|
1098
|
+
* ie: “6103.22”
|
|
1099
|
+
*/
|
|
1100
|
+
hs_tariff_code: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Value of object for customs (in USD)
|
|
1103
|
+
* ie: “15”
|
|
1104
|
+
*/
|
|
1105
|
+
value: string;
|
|
1106
|
+
/**
|
|
1107
|
+
* Description of product for customs purposes
|
|
1108
|
+
*/
|
|
1109
|
+
description: string;
|
|
1110
|
+
};
|
|
1111
|
+
/**
|
|
1112
|
+
* Not sure if these can be partially supplied.
|
|
1113
|
+
*/
|
|
1114
|
+
return_preferences?: {
|
|
1115
|
+
primary_action_id: Nullable<ReturnAction>;
|
|
1116
|
+
backup_action_id: null;
|
|
1117
|
+
/**
|
|
1118
|
+
* Cannot be set when "primary_action_id" has certain values (ie: Quarantine)
|
|
1119
|
+
* error: variants.return_preferences.instructions cannot be set for the selected primary action
|
|
1120
|
+
*/
|
|
1121
|
+
instructions: Nullable<string>;
|
|
1122
|
+
return_to_sender_primary_action_id: Nullable<ReturnAction>;
|
|
1123
|
+
return_to_sender_backup_action_id: Nullable<ReturnAction>;
|
|
1124
|
+
};
|
|
1125
|
+
lot_information: {
|
|
1126
|
+
/**
|
|
1127
|
+
* If the product should use lot date based picking
|
|
1128
|
+
*/
|
|
1129
|
+
is_lot: boolean;
|
|
1130
|
+
minimum_shelf_life_days: Nullable<number>;
|
|
1131
|
+
};
|
|
1132
|
+
};
|
|
1133
|
+
export type GetProductQueryStrings = Partial<{
|
|
1134
|
+
Page: number;
|
|
1135
|
+
Limit: number;
|
|
1136
|
+
/**
|
|
1137
|
+
* Regular product (1) or Bundle (2)
|
|
1138
|
+
*/
|
|
1139
|
+
productTypeId: 1 | 2;
|
|
1140
|
+
/**
|
|
1141
|
+
* Active (1) or Inactive (2)
|
|
1142
|
+
*/
|
|
1143
|
+
variantStatus: 1 | 2;
|
|
1144
|
+
/**
|
|
1145
|
+
* True -> at least one variant is digital
|
|
1146
|
+
* False -> at least one variant is not-digital
|
|
1147
|
+
*/
|
|
1148
|
+
hasDigitalVariants: boolean;
|
|
1149
|
+
/**
|
|
1150
|
+
* Search by one or more Product Ids (comma separated) to return multiple products
|
|
1151
|
+
*/
|
|
1152
|
+
Ids: string;
|
|
1153
|
+
/**
|
|
1154
|
+
* Search by one or more Variant Ids (comma separated) to return multiple products
|
|
1155
|
+
*/
|
|
1156
|
+
VariantIds: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* Search by product barcode
|
|
1159
|
+
*/
|
|
1160
|
+
barcode: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* Search by an exact sku
|
|
1163
|
+
*/
|
|
1164
|
+
sku: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* Search for products that vary or non-varying products
|
|
1167
|
+
*/
|
|
1168
|
+
hasVariants: boolean;
|
|
1169
|
+
/**
|
|
1170
|
+
* Search by one or more InventoryIds (comma separated) to return multiple barcodes
|
|
1171
|
+
*/
|
|
1172
|
+
InventoryId: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* Search by Variant Name.
|
|
1175
|
+
* NOTE: Query parameters should be URL encoded such as "Green%20Shirt"
|
|
1176
|
+
*/
|
|
1177
|
+
Name: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* Search by matching Taxonomy (category) of the product (comma separated)
|
|
1180
|
+
*/
|
|
1181
|
+
TaxonomyIds: string;
|
|
1182
|
+
}>;
|
|
1183
|
+
export type GetOrdersQueryStrings = {
|
|
1184
|
+
Page: number;
|
|
1185
|
+
Limit: number;
|
|
1186
|
+
/**
|
|
1187
|
+
* order ids to filter by, comma separated
|
|
1188
|
+
*/
|
|
1189
|
+
Ids: string;
|
|
1190
|
+
/**
|
|
1191
|
+
* Reference ids to filter by, comma separated
|
|
1192
|
+
*/
|
|
1193
|
+
ReferenceIds: string;
|
|
1194
|
+
/**
|
|
1195
|
+
* Start date to filter orders inserted later than
|
|
1196
|
+
*/
|
|
1197
|
+
StartDate: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* End date to filter orders inserted earlier than
|
|
1200
|
+
*/
|
|
1201
|
+
EndDate: string;
|
|
1202
|
+
/**
|
|
1203
|
+
* Order to sort results in
|
|
1204
|
+
*/
|
|
1205
|
+
SortOrder: 'Newest' | 'Oldest';
|
|
1206
|
+
/**
|
|
1207
|
+
* Has any portion of this order been assigned a tracking number
|
|
1208
|
+
*/
|
|
1209
|
+
HasTracking: boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* Start date to filter orders updated later than
|
|
1212
|
+
*/
|
|
1213
|
+
LastUpdateStartDate: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* End date to filter orders updated later than
|
|
1216
|
+
*/
|
|
1217
|
+
LastUpdateEndDate: string;
|
|
1218
|
+
/**
|
|
1219
|
+
* Filter orders that their tracking information was fully uploaded
|
|
1220
|
+
*/
|
|
1221
|
+
IsTrackingUploaded: boolean;
|
|
1222
|
+
/**
|
|
1223
|
+
* Start date to filter orders with tracking updates later than the supplied date. Will only return orders that have tracking information
|
|
1224
|
+
*/
|
|
1225
|
+
LastTrackingUpdateStartDate: string;
|
|
1226
|
+
/**
|
|
1227
|
+
* End date to filter orders updated later than the supplied date. Will only return orders that have tracking information
|
|
1228
|
+
*/
|
|
1229
|
+
LastTrackingUpdateEndDate: string;
|
|
1230
|
+
};
|
|
1231
|
+
export type ExperimentalPagedResult<T> = {
|
|
1232
|
+
/**
|
|
1233
|
+
* Will be null when there are no items
|
|
1234
|
+
*/
|
|
1235
|
+
first: Nullable<string>;
|
|
1236
|
+
next: Nullable<string>;
|
|
1237
|
+
items: T[];
|
|
1238
|
+
prev: Nullable<string>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Will be null when there are no items.
|
|
1241
|
+
*/
|
|
1242
|
+
last: Nullable<string>;
|
|
1243
|
+
};
|
|
1244
|
+
export type ListInventoryQueryStrings = {
|
|
1245
|
+
/**
|
|
1246
|
+
* Page of inventory items to get
|
|
1247
|
+
*/
|
|
1248
|
+
Page: number;
|
|
1249
|
+
/**
|
|
1250
|
+
* Amount of inventory items per page to request
|
|
1251
|
+
*/
|
|
1252
|
+
Limit: number;
|
|
1253
|
+
IsActive: boolean;
|
|
1254
|
+
IsDigital: boolean;
|
|
1255
|
+
IDs: number[];
|
|
1256
|
+
/**
|
|
1257
|
+
* 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
|
|
1258
|
+
*
|
|
1259
|
+
* NOTE: if you sort a non-valid field will be a 422. ie: on_hand is not an available sort property
|
|
1260
|
+
*
|
|
1261
|
+
* NOTE: their API is a mix of pascalCase and snake_case.
|
|
1262
|
+
*/
|
|
1263
|
+
Sort: string;
|
|
1264
|
+
/**
|
|
1265
|
+
* Search is available for 2 fields, Inventory ID and Name -
|
|
1266
|
+
*
|
|
1267
|
+
* Expected behavior for search by Inventory ID is exact match
|
|
1268
|
+
* 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.
|
|
1269
|
+
*/
|
|
1270
|
+
Search: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* LocationType is valid for hub, spoke, or lts. LocationType will default to all locations.
|
|
1273
|
+
*/
|
|
1274
|
+
LocationType: string;
|
|
1275
|
+
};
|
|
1276
|
+
export type GetInventory1_0Result = {
|
|
1277
|
+
id: number;
|
|
1278
|
+
name: string;
|
|
1279
|
+
is_digital: boolean;
|
|
1280
|
+
is_case_pick: boolean;
|
|
1281
|
+
is_lot: boolean;
|
|
1282
|
+
dimensions: {
|
|
1283
|
+
weight: number;
|
|
1284
|
+
length: number;
|
|
1285
|
+
width: number;
|
|
1286
|
+
depth: number;
|
|
1287
|
+
};
|
|
1288
|
+
/**
|
|
1289
|
+
* Total fulfillable quantity of this inventory item
|
|
1290
|
+
*/
|
|
1291
|
+
total_fulfillable_quantity: number;
|
|
1292
|
+
/**
|
|
1293
|
+
* Total onhand quantity of this inventory item
|
|
1294
|
+
*/
|
|
1295
|
+
total_onhand_quantity: number;
|
|
1296
|
+
/**
|
|
1297
|
+
* Total committed quantity of this inventory item
|
|
1298
|
+
*/
|
|
1299
|
+
total_committed_quantity: number;
|
|
1300
|
+
/**
|
|
1301
|
+
* Total quantity that can be sold without overselling the inventory item. This is calculated by subtracting the total exception quantity from the fulfillable quantity.
|
|
1302
|
+
*/
|
|
1303
|
+
total_sellable_quantity: number;
|
|
1304
|
+
/**
|
|
1305
|
+
* Total quantity in unreceived receiving orders for this inventory item
|
|
1306
|
+
*/
|
|
1307
|
+
total_awaiting_quantity: number;
|
|
1308
|
+
/**
|
|
1309
|
+
* 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.
|
|
1310
|
+
*/
|
|
1311
|
+
total_exception_quantity: number;
|
|
1312
|
+
/**
|
|
1313
|
+
* 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.
|
|
1314
|
+
*/
|
|
1315
|
+
total_internal_transfer_quantity: number;
|
|
1316
|
+
/**
|
|
1317
|
+
* 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.
|
|
1318
|
+
*/
|
|
1319
|
+
total_backordered_quantity: number;
|
|
1320
|
+
/**
|
|
1321
|
+
* Whether the inventory is active or not
|
|
1322
|
+
*/
|
|
1323
|
+
is_active: boolean;
|
|
1324
|
+
/**
|
|
1325
|
+
* Fulfillable quantity of this inventory item broken down by fulfillment center location
|
|
1326
|
+
*/
|
|
1327
|
+
fulfillable_quantity_by_fulfillment_center: {
|
|
1328
|
+
id: number;
|
|
1329
|
+
name: string;
|
|
1330
|
+
fulfillable_quantity: number;
|
|
1331
|
+
onhand_quantity: number;
|
|
1332
|
+
committed_quantity: number;
|
|
1333
|
+
awaiting_quantity: number;
|
|
1334
|
+
internal_transfer_quantity: number;
|
|
1335
|
+
}[];
|
|
1336
|
+
/**
|
|
1337
|
+
* Fulfillable quantity of this inventory item broken down by lot
|
|
1338
|
+
*/
|
|
1339
|
+
fulfillable_quantity_by_lot: {
|
|
1340
|
+
lot_number: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* ie: "2019-08-24T14:15:22Z"
|
|
1343
|
+
*/
|
|
1344
|
+
expiration_date: string;
|
|
1345
|
+
fulfillable_quantity: number;
|
|
1346
|
+
onhand_quantity: number;
|
|
1347
|
+
committed_quantity: number;
|
|
1348
|
+
awaiting_quantity: number;
|
|
1349
|
+
internal_transfer_quantity: number;
|
|
1350
|
+
fulfillable_quantity_by_fulfillment_center: {
|
|
1351
|
+
id: number;
|
|
1352
|
+
name: string;
|
|
1353
|
+
fulfillable_quantity: number;
|
|
1354
|
+
onhand_quantity: number;
|
|
1355
|
+
committed_quantity: number;
|
|
1356
|
+
awaiting_quantity: number;
|
|
1357
|
+
internal_transfer_quantity: number;
|
|
1358
|
+
}[];
|
|
1359
|
+
}[];
|
|
1360
|
+
/**
|
|
1361
|
+
* ie: "None" "Fragile" "Foldable" "Stackable" "Book" "CustomPackaging" "CustomDunnage" "MarketingInsert" or "Poster"
|
|
1362
|
+
*/
|
|
1363
|
+
packaging_attribute: 'None' | 'Fragile' | 'Foldable' | 'Stackable' | 'Book' | 'CustomPackaging' | 'CustomDunnage' | 'MarketingInsert' | 'Poster';
|
|
1364
|
+
};
|
|
1365
|
+
/**
|
|
1366
|
+
* The Topic and SubsciptionId are passed in the HTTP header of the webhook notification, with the names:
|
|
1367
|
+
* - shipbob-topic
|
|
1368
|
+
* - shipbob-subscription-id
|
|
1369
|
+
*/
|
|
1370
|
+
export declare enum WebhookTopic {
|
|
1371
|
+
/**
|
|
1372
|
+
* Sends the full order payload when the label is purchased, printed, and placed on box for carrier pickup.
|
|
1373
|
+
* While the tracking # will be available, there may be a delay while carriers scan in the package.
|
|
1374
|
+
* If the order is split into multiple shipments, this will fire for each shipment that is part of the order.
|
|
1375
|
+
*/
|
|
1376
|
+
OrderShipped = "order_shipped",
|
|
1377
|
+
/**
|
|
1378
|
+
* Sends the full shipment payload when a shipment is delivered by the carrier to the customer.
|
|
1379
|
+
* If the order is split into multiple shipments, this will fire for each shipment.
|
|
1380
|
+
*/
|
|
1381
|
+
ShipmentDelivered = "shipment_delivered",
|
|
1382
|
+
/**
|
|
1383
|
+
* Sends the full shipment payload when a shipment moves to exception status.
|
|
1384
|
+
* Shipments are moved into exception because ShipBob is unable to fulfill the shipment.
|
|
1385
|
+
* Shipments are moved into exception status largely because one or more items in the shipment is out of stock.
|
|
1386
|
+
*/
|
|
1387
|
+
ShipmentException = "shipment_exception",
|
|
1388
|
+
/**
|
|
1389
|
+
* Sends the full shipment payload when a shipment moves to On-Hold status.
|
|
1390
|
+
* Shipments are moved into On-Hold status by ShipBob when we are missing key information like Address or Packaging preferences.
|
|
1391
|
+
* Shipments can also be moved to On-Hold in the Merchant Dashboard. On-Hold Shipments will not be fulfilled.
|
|
1392
|
+
*/
|
|
1393
|
+
ShipmentOnHold = "shipment_onhold",
|
|
1394
|
+
/**
|
|
1395
|
+
* Sends the full shipment payload when a shipment moves to cancelled status.
|
|
1396
|
+
* This webhook subcription will NOT notify you of cancelled split, copied, manual, and excel imported orders.
|
|
1397
|
+
* This functionality will be available on this webhook at a later point.
|
|
1398
|
+
*/
|
|
1399
|
+
ShipmentCancelled = "shipment_cancelled"
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* This can be used to lookup a webhook content based on the supplier "shipbob-topic" header.
|
|
1403
|
+
*/
|
|
1404
|
+
export type WebhookResponsesByTopic = {
|
|
1405
|
+
topic: 'order_shipped';
|
|
1406
|
+
payload: Order;
|
|
1407
|
+
} | {
|
|
1408
|
+
topic: 'shipment_delivered';
|
|
1409
|
+
payload: Omit<OrderShipment, 'status'> & {
|
|
1410
|
+
status: 'Completed';
|
|
1411
|
+
};
|
|
1412
|
+
} | {
|
|
1413
|
+
topic: 'shipment_exception';
|
|
1414
|
+
payload: Omit<OrderShipment, 'status'> & {
|
|
1415
|
+
status: 'Exception';
|
|
1416
|
+
};
|
|
1417
|
+
} | {
|
|
1418
|
+
topic: 'shipment_onhold';
|
|
1419
|
+
payload: Omit<OrderShipment, 'status'> & {
|
|
1420
|
+
status: 'OnHold';
|
|
1421
|
+
};
|
|
1422
|
+
} | {
|
|
1423
|
+
topic: 'shipment_cancelled';
|
|
1424
|
+
payload: Omit<OrderShipment, 'status'> & {
|
|
1425
|
+
status: 'Cancelled';
|
|
1426
|
+
};
|
|
1427
|
+
};
|