shipbob-node-sdk 0.0.3 → 0.0.4
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 +85 -58
- package/dist/index.d.ts +444 -230
- package/dist/index.js +155 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/docs/Product Catalog API Examples.pdf +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,21 @@ export type DataResponse<T> = ({
|
|
|
26
26
|
*/
|
|
27
27
|
data: object | string;
|
|
28
28
|
}) & {
|
|
29
|
+
headers: Record<string, string>;
|
|
29
30
|
statusCode: number;
|
|
31
|
+
rateLimit: {
|
|
32
|
+
/**
|
|
33
|
+
* There are 150 calls in a sliding window of 1 minute.
|
|
34
|
+
*
|
|
35
|
+
* Retrieved from x-remaining-calls header in response.
|
|
36
|
+
* null when not found.
|
|
37
|
+
*/
|
|
38
|
+
remainingCalls: Nullable<number>;
|
|
39
|
+
/**
|
|
40
|
+
* Seconds remaining in sliding window once rate limit has been exhausted.
|
|
41
|
+
*/
|
|
42
|
+
retryAfter: Nullable<number>;
|
|
43
|
+
};
|
|
30
44
|
};
|
|
31
45
|
export type ChannelsResponse = {
|
|
32
46
|
id: number;
|
|
@@ -81,209 +95,222 @@ export type GetProduct1_0Result = {
|
|
|
81
95
|
};
|
|
82
96
|
export type ActionName = 'Dispose' | 'Restock' | 'Quarantine';
|
|
83
97
|
export type ProductType = 'Regular' | 'Bundle';
|
|
84
|
-
|
|
85
|
-
* This is just some guessing based on a response
|
|
86
|
-
*/
|
|
87
|
-
export type GetProduct2_0Result = {
|
|
98
|
+
type GetProduct2_0Variant = {
|
|
88
99
|
/**
|
|
89
|
-
*
|
|
100
|
+
* The expected barcode to be found on the item and checked during the pick process
|
|
90
101
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
category: Nullable<unknown>;
|
|
98
|
-
sub_category: Nullable<unknown>;
|
|
99
|
-
user_id: number;
|
|
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[];
|
|
100
108
|
created_on: string;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* null | ?
|
|
104
|
-
*/
|
|
105
|
-
taxonomy: null;
|
|
106
|
-
variants: {
|
|
109
|
+
customs: {
|
|
107
110
|
/**
|
|
108
|
-
* The
|
|
111
|
+
* The customs code (6 digit)
|
|
109
112
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* ie: "UserEntry"
|
|
148
|
-
*/
|
|
149
|
-
source: string;
|
|
150
|
-
};
|
|
151
|
-
fulfillment_settings: {
|
|
152
|
-
/**
|
|
153
|
-
* If the product requires a prop65 label in the box
|
|
154
|
-
*/
|
|
155
|
-
requires_prop65: false;
|
|
156
|
-
serial_scan: {
|
|
157
|
-
/**
|
|
158
|
-
* Indicates if a Serial Scan is required during the pack process.
|
|
159
|
-
* Note: Serial scan requires either a prefix or a suffix to be defined
|
|
160
|
-
*/
|
|
161
|
-
is_enabled: false;
|
|
162
|
-
/**
|
|
163
|
-
* The prefix expected on the serial number
|
|
164
|
-
*/
|
|
165
|
-
prefix: string;
|
|
166
|
-
/**
|
|
167
|
-
* The suffix expected on the serial number
|
|
168
|
-
*/
|
|
169
|
-
suffix: string;
|
|
170
|
-
/**
|
|
171
|
-
* The exact number of characters expected in the serial number
|
|
172
|
-
*/
|
|
173
|
-
exact_character_length: Nullable<number>;
|
|
174
|
-
};
|
|
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: {
|
|
175
149
|
/**
|
|
176
|
-
*
|
|
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
|
|
177
152
|
*/
|
|
178
|
-
|
|
153
|
+
is_enabled: false;
|
|
179
154
|
/**
|
|
180
|
-
*
|
|
181
|
-
* Note: should be populated by ShipBob system via the UI, should not reference a URL outside of the ShipBob domain
|
|
155
|
+
* The prefix expected on the serial number
|
|
182
156
|
*/
|
|
183
|
-
|
|
157
|
+
prefix: string;
|
|
184
158
|
/**
|
|
185
|
-
*
|
|
159
|
+
* The suffix expected on the serial number
|
|
186
160
|
*/
|
|
187
|
-
|
|
161
|
+
suffix: string;
|
|
188
162
|
/**
|
|
189
|
-
*
|
|
163
|
+
* The exact number of characters expected in the serial number
|
|
190
164
|
*/
|
|
191
|
-
|
|
165
|
+
exact_character_length: Nullable<number>;
|
|
192
166
|
};
|
|
193
167
|
/**
|
|
194
|
-
*
|
|
168
|
+
* If the product needs to classified as a hazmat product with the shipping carrier
|
|
195
169
|
*/
|
|
196
|
-
|
|
170
|
+
dangerous_goods: false;
|
|
197
171
|
/**
|
|
198
|
-
*
|
|
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
|
|
199
174
|
*/
|
|
200
|
-
|
|
201
|
-
inventory: {
|
|
202
|
-
inventory_id: number;
|
|
203
|
-
on_hand_qty: number;
|
|
204
|
-
};
|
|
205
|
-
is_digital: boolean;
|
|
206
|
-
lot_information: {
|
|
207
|
-
/**
|
|
208
|
-
* If the product should use lot date based picking
|
|
209
|
-
*/
|
|
210
|
-
is_lot: boolean;
|
|
211
|
-
minimum_shelf_life_days: Nullable<number>;
|
|
212
|
-
};
|
|
175
|
+
msds_url: string;
|
|
213
176
|
/**
|
|
214
|
-
*
|
|
177
|
+
* If the product should be picked as an entire case
|
|
215
178
|
*/
|
|
216
|
-
|
|
179
|
+
is_case_pick: boolean;
|
|
217
180
|
/**
|
|
218
|
-
*
|
|
181
|
+
* Is Bound Printed Matter, must be set by the ShipBob internal team
|
|
219
182
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
227
|
/**
|
|
228
|
-
*
|
|
228
|
+
* Restock (1) Quarantine (2) Dispose (3)
|
|
229
229
|
*/
|
|
230
|
-
|
|
230
|
+
primary_action: Nullable<{
|
|
231
231
|
id: number;
|
|
232
|
-
name:
|
|
233
|
-
}
|
|
234
|
-
return_preferences: {
|
|
235
|
-
/**
|
|
236
|
-
* Restock (1) Quarantine (2) Dispose (3)
|
|
237
|
-
*/
|
|
238
|
-
primary_action: Nullable<{
|
|
239
|
-
id: number;
|
|
240
|
-
name: ActionName;
|
|
241
|
-
}>;
|
|
242
|
-
/**
|
|
243
|
-
* Restock (1) Quarantine (2) Dispose (3)
|
|
244
|
-
*/
|
|
245
|
-
backup_action: Nullable<{
|
|
246
|
-
id: number;
|
|
247
|
-
name: ActionName;
|
|
248
|
-
}>;
|
|
249
|
-
/**
|
|
250
|
-
* Instructions for inspecting returns
|
|
251
|
-
*/
|
|
252
|
-
instructions: Nullable<string>;
|
|
253
|
-
return_to_sender_primary_action: Nullable<{
|
|
254
|
-
id: number;
|
|
255
|
-
name: ActionName;
|
|
256
|
-
}>;
|
|
257
|
-
return_to_sender_backup_action: Nullable<{
|
|
258
|
-
id: number;
|
|
259
|
-
name: ActionName;
|
|
260
|
-
}>;
|
|
261
|
-
};
|
|
232
|
+
name: ActionName;
|
|
233
|
+
}>;
|
|
262
234
|
/**
|
|
263
|
-
*
|
|
235
|
+
* Restock (1) Quarantine (2) Dispose (3)
|
|
264
236
|
*/
|
|
265
|
-
|
|
237
|
+
backup_action: Nullable<{
|
|
238
|
+
id: number;
|
|
239
|
+
name: ActionName;
|
|
240
|
+
}>;
|
|
266
241
|
/**
|
|
267
|
-
*
|
|
242
|
+
* Instructions for inspecting returns
|
|
268
243
|
*/
|
|
269
|
-
|
|
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
270
|
/**
|
|
271
|
-
*
|
|
271
|
+
* ie: "oz"
|
|
272
272
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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>;
|
|
285
306
|
}[];
|
|
286
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
|
+
};
|
|
287
314
|
export type OrderType = 'DTC' | 'DropShip' | 'B2B' | 'Transportation';
|
|
288
315
|
export type AnyProduct = ({
|
|
289
316
|
/**
|
|
@@ -522,6 +549,39 @@ export type PlaceOrderRequest = {
|
|
|
522
549
|
*/
|
|
523
550
|
type: OrderType;
|
|
524
551
|
};
|
|
552
|
+
export type ShippingMethod = {
|
|
553
|
+
/**
|
|
554
|
+
* Unique id for shipping method
|
|
555
|
+
*/
|
|
556
|
+
id: number;
|
|
557
|
+
/**
|
|
558
|
+
* Indicates if the shipping method is active
|
|
559
|
+
*/
|
|
560
|
+
active: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* Indicates the shipping method is a ShipBob default shipping method.
|
|
563
|
+
*/
|
|
564
|
+
default: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Name of the ship method as selected by the merchant and saved in ShipBob’s database (i.e. “ground”).
|
|
567
|
+
*
|
|
568
|
+
* Corresponds to the shipping_method field in the Orders API.
|
|
569
|
+
*/
|
|
570
|
+
name: string;
|
|
571
|
+
/**
|
|
572
|
+
* ShipBob.Orders.Presentation.ViewModels.ServiceLevelDetailViewModel)
|
|
573
|
+
*/
|
|
574
|
+
service_level: {
|
|
575
|
+
/**
|
|
576
|
+
* Unique id for the service level
|
|
577
|
+
*/
|
|
578
|
+
id: number;
|
|
579
|
+
/**
|
|
580
|
+
* The name or title of the service level
|
|
581
|
+
*/
|
|
582
|
+
name: string;
|
|
583
|
+
};
|
|
584
|
+
};
|
|
525
585
|
export type Webhook = {
|
|
526
586
|
id: number;
|
|
527
587
|
/**
|
|
@@ -605,7 +665,8 @@ export type WarehouseReceivingOrderRequest = {
|
|
|
605
665
|
*/
|
|
606
666
|
inventory_id: number;
|
|
607
667
|
/**
|
|
608
|
-
* Lot number of the items in the box
|
|
668
|
+
* Lot number of the items in the box. Must be supplied for products that have lot set, otherwise will be:
|
|
669
|
+
* 422 status code "Wrong Lot Information Provided For Inventory IDs: 8619859,8619860, etc."
|
|
609
670
|
*/
|
|
610
671
|
lot_number?: Nullable<string>;
|
|
611
672
|
/**
|
|
@@ -617,6 +678,8 @@ export type WarehouseReceivingOrderRequest = {
|
|
|
617
678
|
/**
|
|
618
679
|
* Expected arrival date of all the box shipments in this receiving order
|
|
619
680
|
* ie: ISO date "2019-08-24T14:15:22Z"
|
|
681
|
+
*
|
|
682
|
+
* NOTE: Must be in the future or it will generate a 422 error.
|
|
620
683
|
*/
|
|
621
684
|
expected_arrival_date: string;
|
|
622
685
|
/**
|
|
@@ -876,7 +939,13 @@ export declare enum ReturnAction {
|
|
|
876
939
|
*/
|
|
877
940
|
Dispose = 3
|
|
878
941
|
}
|
|
879
|
-
export type
|
|
942
|
+
export type VariantRequestProductExperimental = Omit<VariantRequestProduct2_0, 'barcode'> & {
|
|
943
|
+
barcodes: {
|
|
944
|
+
value: string;
|
|
945
|
+
sticker_url: Nullable<string>;
|
|
946
|
+
}[];
|
|
947
|
+
};
|
|
948
|
+
export type VariantRequestProduct2_0 = {
|
|
880
949
|
/**
|
|
881
950
|
* Required for updates
|
|
882
951
|
*/
|
|
@@ -920,6 +989,10 @@ export type ProductVariantRequest = {
|
|
|
920
989
|
return_preferences?: {
|
|
921
990
|
primary_action_id: Nullable<ReturnAction>;
|
|
922
991
|
backup_action_id: null;
|
|
992
|
+
/**
|
|
993
|
+
* Cannot be set when "primary_action_id" has certain values (ie: Quarantine)
|
|
994
|
+
* error: variants.return_preferences.instructions cannot be set for the selected primary action
|
|
995
|
+
*/
|
|
923
996
|
instructions: Nullable<string>;
|
|
924
997
|
return_to_sender_primary_action_id: Nullable<ReturnAction>;
|
|
925
998
|
return_to_sender_backup_action_id: Nullable<ReturnAction>;
|
|
@@ -932,6 +1005,158 @@ export type ProductVariantRequest = {
|
|
|
932
1005
|
minimum_shelf_life_days: Nullable<number>;
|
|
933
1006
|
};
|
|
934
1007
|
};
|
|
1008
|
+
export type GetProductQueryStrings = {
|
|
1009
|
+
Page: number;
|
|
1010
|
+
Limit: number;
|
|
1011
|
+
/**
|
|
1012
|
+
* Regular product (1) or Bundle (2)
|
|
1013
|
+
*/
|
|
1014
|
+
productTypeId: 1 | 2;
|
|
1015
|
+
/**
|
|
1016
|
+
* Active (1) or Inactive (2)
|
|
1017
|
+
*/
|
|
1018
|
+
variantStatus: 1 | 2;
|
|
1019
|
+
/**
|
|
1020
|
+
* True -> at least one variant is digital
|
|
1021
|
+
* False -> at least one variant is not-digital
|
|
1022
|
+
*/
|
|
1023
|
+
hasDigitalVariants: boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* Search by one or more Product Ids (comma separated) to return multiple products
|
|
1026
|
+
*/
|
|
1027
|
+
Ids: string;
|
|
1028
|
+
/**
|
|
1029
|
+
* Search by one or more Variant Ids (comma separated) to return multiple products
|
|
1030
|
+
*/
|
|
1031
|
+
VariantIds: string;
|
|
1032
|
+
/**
|
|
1033
|
+
* Search by product barcode
|
|
1034
|
+
*/
|
|
1035
|
+
barcode: string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Search by an exact sku
|
|
1038
|
+
*/
|
|
1039
|
+
sku: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Search for products that vary or non-varying products
|
|
1042
|
+
*/
|
|
1043
|
+
hasVariants: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Search by one or more InventoryIds (comma separated) to return multiple barcodes
|
|
1046
|
+
*/
|
|
1047
|
+
InventoryId: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* Search by Variant Name.
|
|
1050
|
+
* NOTE: Query parameters should be URL encoded such as "Green%20Shirt"
|
|
1051
|
+
*/
|
|
1052
|
+
Name: string;
|
|
1053
|
+
/**
|
|
1054
|
+
* Search by matching Taxonomy (category) of the product (comma separated)
|
|
1055
|
+
*/
|
|
1056
|
+
TaxonomyIds: string;
|
|
1057
|
+
};
|
|
1058
|
+
export type ExperimentalPagedResult<T> = {
|
|
1059
|
+
/**
|
|
1060
|
+
* Will be null when there are no items
|
|
1061
|
+
*/
|
|
1062
|
+
first: Nullable<string>;
|
|
1063
|
+
next: Nullable<string>;
|
|
1064
|
+
items: T[];
|
|
1065
|
+
prev: Nullable<string>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Will be null when there are no items.
|
|
1068
|
+
*/
|
|
1069
|
+
last: Nullable<string>;
|
|
1070
|
+
};
|
|
1071
|
+
export type GetInventory1_0Result = {
|
|
1072
|
+
id: number;
|
|
1073
|
+
name: string;
|
|
1074
|
+
is_digital: boolean;
|
|
1075
|
+
is_case_pick: boolean;
|
|
1076
|
+
is_lot: boolean;
|
|
1077
|
+
dimensions: {
|
|
1078
|
+
weight: number;
|
|
1079
|
+
length: number;
|
|
1080
|
+
width: number;
|
|
1081
|
+
depth: number;
|
|
1082
|
+
};
|
|
1083
|
+
/**
|
|
1084
|
+
* Total fulfillable quantity of this inventory item
|
|
1085
|
+
*/
|
|
1086
|
+
total_fulfillable_quantity: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* Total onhand quantity of this inventory item
|
|
1089
|
+
*/
|
|
1090
|
+
total_onhand_quantity: number;
|
|
1091
|
+
/**
|
|
1092
|
+
* Total committed quantity of this inventory item
|
|
1093
|
+
*/
|
|
1094
|
+
total_committed_quantity: number;
|
|
1095
|
+
/**
|
|
1096
|
+
* Total quantity that can be sold without overselling the inventory item. This is calculated by subtracting the total exception quantity from the fulfillable quantity.
|
|
1097
|
+
*/
|
|
1098
|
+
total_sellable_quantity: number;
|
|
1099
|
+
/**
|
|
1100
|
+
* Total quantity in unreceived receiving orders for this inventory item
|
|
1101
|
+
*/
|
|
1102
|
+
total_awaiting_quantity: number;
|
|
1103
|
+
/**
|
|
1104
|
+
* 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.
|
|
1105
|
+
*/
|
|
1106
|
+
total_exception_quantity: number;
|
|
1107
|
+
/**
|
|
1108
|
+
* 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.
|
|
1109
|
+
*/
|
|
1110
|
+
total_internal_transfer_quantity: number;
|
|
1111
|
+
/**
|
|
1112
|
+
* 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.
|
|
1113
|
+
*/
|
|
1114
|
+
total_backordered_quantity: number;
|
|
1115
|
+
/**
|
|
1116
|
+
* Whether the inventory is active or not
|
|
1117
|
+
*/
|
|
1118
|
+
is_active: boolean;
|
|
1119
|
+
/**
|
|
1120
|
+
* Fulfillable quantity of this inventory item broken down by fulfillment center location
|
|
1121
|
+
*/
|
|
1122
|
+
fulfillable_quantity_by_fulfillment_center: {
|
|
1123
|
+
id: number;
|
|
1124
|
+
name: string;
|
|
1125
|
+
fulfillable_quantity: number;
|
|
1126
|
+
onhand_quantity: number;
|
|
1127
|
+
committed_quantity: number;
|
|
1128
|
+
awaiting_quantity: number;
|
|
1129
|
+
internal_transfer_quantity: number;
|
|
1130
|
+
}[];
|
|
1131
|
+
/**
|
|
1132
|
+
* Fulfillable quantity of this inventory item broken down by lot
|
|
1133
|
+
*/
|
|
1134
|
+
fulfillable_quantity_by_lot: {
|
|
1135
|
+
lot_number: string;
|
|
1136
|
+
/**
|
|
1137
|
+
* ie: "2019-08-24T14:15:22Z"
|
|
1138
|
+
*/
|
|
1139
|
+
expiration_date: string;
|
|
1140
|
+
fulfillable_quantity: number;
|
|
1141
|
+
onhand_quantity: number;
|
|
1142
|
+
committed_quantity: number;
|
|
1143
|
+
awaiting_quantity: number;
|
|
1144
|
+
internal_transfer_quantity: number;
|
|
1145
|
+
fulfillable_quantity_by_fulfillment_center: {
|
|
1146
|
+
id: number;
|
|
1147
|
+
name: string;
|
|
1148
|
+
fulfillable_quantity: number;
|
|
1149
|
+
onhand_quantity: number;
|
|
1150
|
+
committed_quantity: number;
|
|
1151
|
+
awaiting_quantity: number;
|
|
1152
|
+
internal_transfer_quantity: number;
|
|
1153
|
+
}[];
|
|
1154
|
+
}[];
|
|
1155
|
+
/**
|
|
1156
|
+
* ie: "None" "Fragile" "Foldable" "Stackable" "Book" "CustomPackaging" "CustomDunnage" "MarketingInsert" or "Poster"
|
|
1157
|
+
*/
|
|
1158
|
+
packaging_attribute: 'None' | 'Fragile' | 'Foldable' | 'Stackable' | 'Book' | 'CustomPackaging' | 'CustomDunnage' | 'MarketingInsert' | 'Poster';
|
|
1159
|
+
};
|
|
935
1160
|
/**
|
|
936
1161
|
* Create API with PAT (personal access token) - defaults to sandbox endpoints and "SMA" channel.
|
|
937
1162
|
*
|
|
@@ -942,9 +1167,16 @@ export type ProductVariantRequest = {
|
|
|
942
1167
|
* @param personalAccessToken passing *undefined* or empty string has a guar clause that will throw
|
|
943
1168
|
* @param apiBaseUrl
|
|
944
1169
|
* @param channelApplicationName
|
|
1170
|
+
* @param options
|
|
945
1171
|
* @returns
|
|
946
1172
|
*/
|
|
947
|
-
export declare const createShipBobApi: (personalAccessToken: string | undefined, apiBaseUrl?: string, channelApplicationName?: string
|
|
1173
|
+
export declare const createShipBobApi: (personalAccessToken: string | undefined, apiBaseUrl?: string, channelApplicationName?: string, options?: {
|
|
1174
|
+
logTraffic: boolean;
|
|
1175
|
+
}) => Promise<{
|
|
1176
|
+
/**
|
|
1177
|
+
* You would need a product id on your side. Not sure how useful this is in all practicality unless
|
|
1178
|
+
* you maintain the association on your side.
|
|
1179
|
+
*/
|
|
948
1180
|
getProductById: (productId: number) => Promise<DataResponse<GetProduct1_0Result>>;
|
|
949
1181
|
getProducts1_0: (query: Partial<{
|
|
950
1182
|
ReferenceIds: string;
|
|
@@ -956,10 +1188,20 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
956
1188
|
BundleStatus: "Any" | "Bundle" | "NotBundle";
|
|
957
1189
|
}>) => Promise<DataResponse<GetProduct1_0Result[]>>;
|
|
958
1190
|
/**
|
|
1191
|
+
* NOTE: you need to use the headers (part of this client response) to page the results.
|
|
1192
|
+
* page-number='1'
|
|
1193
|
+
* page-size='50'
|
|
1194
|
+
* total-count='1'
|
|
1195
|
+
* total-pages='1'
|
|
1196
|
+
*
|
|
959
1197
|
* NOTE: we can probably pass more than "variants" prop. We could on the /1.0/product endpoint
|
|
960
1198
|
* NOTE: This PATCH functionality will be available in the next version available in ShipBob next large release January 2025, it may require extra scope.
|
|
961
1199
|
*/
|
|
962
|
-
|
|
1200
|
+
updateProduct2_0: (productId: number, variants: VariantRequestProduct2_0[]) => Promise<DataResponse<AddProductResponse>>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Unsure how this is different from /2.0/product except for "barcode" -> "barcodes"
|
|
1203
|
+
*/
|
|
1204
|
+
updateProductExperimental: (productId: number, variants: VariantRequestProductExperimental[]) => Promise<DataResponse<AddProductResponse>>;
|
|
963
1205
|
/**
|
|
964
1206
|
* Not supported here, but:
|
|
965
1207
|
* Some search filters allow for operators (equals, not equals, starts with, ends with, contains, etc) to get more exact values. When filtering with an operator, the query string will look like the below:
|
|
@@ -967,56 +1209,11 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
967
1209
|
* Example: /product?sku=any:shirt-a,shirt-b,shirt-c Find products that match any of these SKUs
|
|
968
1210
|
* Example: /product?onHandQuantity=gt:0 Find products where OnHandQty greater than 0
|
|
969
1211
|
*/
|
|
970
|
-
getProducts2_0: (query: Partial<
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
*/
|
|
976
|
-
productTypeId: 1 | 2;
|
|
977
|
-
/**
|
|
978
|
-
* Active (1) or Inactive (2)
|
|
979
|
-
*/
|
|
980
|
-
variantStatus: 1 | 2;
|
|
981
|
-
/**
|
|
982
|
-
* True -> at least one variant is digital
|
|
983
|
-
* False -> at least one variant is not-digital
|
|
984
|
-
*/
|
|
985
|
-
hasDigitalVariants: boolean;
|
|
986
|
-
/**
|
|
987
|
-
* Search by one or more Product Ids (comma separated) to return multiple products
|
|
988
|
-
*/
|
|
989
|
-
Ids: string;
|
|
990
|
-
/**
|
|
991
|
-
* Search by one or more Variant Ids (comma separated) to return multiple products
|
|
992
|
-
*/
|
|
993
|
-
VariantIds: string;
|
|
994
|
-
/**
|
|
995
|
-
* Search by product barcode
|
|
996
|
-
*/
|
|
997
|
-
barcode: string;
|
|
998
|
-
/**
|
|
999
|
-
* Search by an exact sku
|
|
1000
|
-
*/
|
|
1001
|
-
sku: string;
|
|
1002
|
-
/**
|
|
1003
|
-
* Search for products that vary or non-varying products
|
|
1004
|
-
*/
|
|
1005
|
-
hasVariants: boolean;
|
|
1006
|
-
/**
|
|
1007
|
-
* Search by one or more InventoryIds (comma separated) to return multiple barcodes
|
|
1008
|
-
*/
|
|
1009
|
-
InventoryId: string;
|
|
1010
|
-
/**
|
|
1011
|
-
* Search by Variant Name.
|
|
1012
|
-
* NOTE: Query parameters should be URL encoded such as "Green%20Shirt"
|
|
1013
|
-
*/
|
|
1014
|
-
Name: string;
|
|
1015
|
-
/**
|
|
1016
|
-
* Search by matching Taxonomy (category) of the product (comma separated)
|
|
1017
|
-
*/
|
|
1018
|
-
TaxonomyIds: string;
|
|
1019
|
-
}>) => Promise<DataResponse<GetProduct2_0Result[]>>;
|
|
1212
|
+
getProducts2_0: (query: Partial<GetProductQueryStrings>) => Promise<DataResponse<GetProduct2_0Response[]>>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Note sure how this is different from /2.0/product. Only notable difference is "barcodes" type from string to object.
|
|
1215
|
+
*/
|
|
1216
|
+
getProductsExperimental: (query: Partial<GetProductQueryStrings>) => Promise<DataResponse<ExperimentalPagedResult<GetProductExperimentalResponse>>>;
|
|
1020
1217
|
createProduct1_0: (product: {
|
|
1021
1218
|
reference_id: string;
|
|
1022
1219
|
sku: string;
|
|
@@ -1027,11 +1224,17 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
1027
1224
|
* The request part for variant is not accurate. This is just for testing - there are no official docs.
|
|
1028
1225
|
*/
|
|
1029
1226
|
createProduct2_0: (product: {
|
|
1030
|
-
reference_id: string;
|
|
1031
|
-
sku: string;
|
|
1032
1227
|
type_id: number;
|
|
1033
1228
|
name: string;
|
|
1034
|
-
variants:
|
|
1229
|
+
variants: VariantRequestProduct2_0[];
|
|
1230
|
+
}) => Promise<DataResponse<AddProductResponse>>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Unsure how this is different from '2.0/product' except for "barcode" -> "barcodes"
|
|
1233
|
+
*/
|
|
1234
|
+
createProductExperimental: (product: {
|
|
1235
|
+
type_id: number;
|
|
1236
|
+
name: string;
|
|
1237
|
+
variants: VariantRequestProductExperimental[];
|
|
1035
1238
|
}) => Promise<DataResponse<AddProductResponse>>;
|
|
1036
1239
|
placeOrder: (order: PlaceOrderRequest) => Promise<DataResponse<PlaceOrderResponse>>;
|
|
1037
1240
|
/**
|
|
@@ -1040,8 +1243,18 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
1040
1243
|
* @param orderId The order Id to cancel
|
|
1041
1244
|
*/
|
|
1042
1245
|
cancelSingleOrderByOrderId: (orderId: number) => Promise<DataResponse<CancelOrderResponse>>;
|
|
1043
|
-
|
|
1044
|
-
|
|
1246
|
+
getShippingMethods: () => Promise<DataResponse<ShippingMethod[]>>;
|
|
1247
|
+
getWebhooks: () => Promise<DataResponse<Webhook[]>>;
|
|
1248
|
+
/**
|
|
1249
|
+
* NOTE: can consider option to add without providing channel id (would need matching unregister)
|
|
1250
|
+
*/
|
|
1251
|
+
registerWebhookSubscription: (webhook: Omit<Webhook, "id" | "created_at">) => Promise<DataResponse<Webhook>>;
|
|
1252
|
+
/**
|
|
1253
|
+
* Can generate 500 response with data: "The wait operation timed out." If so, check your channel id matches.
|
|
1254
|
+
*
|
|
1255
|
+
* NOTE: can consider option to add without providing channel id (would need matching register)
|
|
1256
|
+
*/
|
|
1257
|
+
unregisterWebhookSubscription: (id: number) => Promise<DataResponse<Webhook>>;
|
|
1045
1258
|
getFulfillmentCenters: () => Promise<DataResponse<FulfillmentCenter[]>>;
|
|
1046
1259
|
createWarehouseReceivingOrder: (request: WarehouseReceivingOrderRequest) => Promise<DataResponse<WarehouseReceivingOrderResponse>>;
|
|
1047
1260
|
getWarehouseReceivingOrder: (orderId: number) => Promise<DataResponse<WarehouseReceivingOrderResponse>>;
|
|
@@ -1095,7 +1308,7 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
1095
1308
|
* LocationType is valid for hub, spoke, or lts. LocationType will default to all locations.
|
|
1096
1309
|
*/
|
|
1097
1310
|
LocationType: string;
|
|
1098
|
-
}>) => Promise<DataResponse<
|
|
1311
|
+
}>) => Promise<DataResponse<GetInventory1_0Result[]>>;
|
|
1099
1312
|
/**
|
|
1100
1313
|
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
1101
1314
|
*
|
|
@@ -1110,3 +1323,4 @@ export declare const createShipBobApi: (personalAccessToken: string | undefined,
|
|
|
1110
1323
|
*/
|
|
1111
1324
|
getSimulationStatus: (simulationId: string) => Promise<DataResponse<SimulationResponse>>;
|
|
1112
1325
|
}>;
|
|
1326
|
+
export {};
|