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