1 get:
2 operationId: GetInventoryItems
3 summary: List Inventory Items
4 description: >-
5 Retrieve a list of inventory items. The inventory items can be filtered by
6 fields such as `id`. The inventory items can also be sorted or paginated.
7 x-authenticated: true
8 parameters:
9 - name: fields
10 in: query
11 description: >-
12 Comma-separated fields that should be included in the returned data. if
13 a field is prefixed with `+` it will be added to the default fields,
14 using `-` will remove it from the default fields. without prefix it will
15 replace the entire default fields.
16 required: false
17 schema:
18 type: string
19 title: fields
20 description: >-
21 Comma-separated fields that should be included in the returned data.
22 if a field is prefixed with `+` it will be added to the default
23 fields, using `-` will remove it from the default fields. without
24 prefix it will replace the entire default fields.
25 externalDocs:
26 url: '#select-fields-and-relations'
27 - name: offset
28 in: query
29 description: The number of items to skip when retrieving a list.
30 required: false
31 schema:
32 type: number
33 title: offset
34 description: The number of items to skip when retrieving a list.
35 externalDocs:
36 url: '#pagination'
37 - name: limit
38 in: query
39 description: Limit the number of items returned in the list.
40 required: false
41 schema:
42 type: number
43 title: limit
44 description: Limit the number of items returned in the list.
45 externalDocs:
46 url: '#pagination'
47 - name: order
48 in: query
49 description: >-
50 The field to sort the data by. By default, the sort order is ascending.
51 To change the order to descending, prefix the field name with `-`.
52 required: false
53 schema:
54 type: string
55 title: order
56 description: >-
57 The field to sort the data by. By default, the sort order is
58 ascending. To change the order to descending, prefix the field name
59 with `-`.
60 - name: q
61 in: query
62 description: The inventory item's q.
63 required: false
64 schema:
65 type: string
66 title: q
67 description: The inventory item's q.
68 - name: id
69 in: query
70 required: false
71 schema:
72 oneOf:
73 - type: string
74 title: id
75 description: The inventory item's ID.
76 - type: array
77 description: The inventory item's ID.
78 items:
79 type: string
80 title: id
81 description: The id's ID.
82 - name: sku
83 in: query
84 required: false
85 schema:
86 oneOf:
87 - type: string
88 title: sku
89 description: The inventory item's sku.
90 - type: array
91 description: The inventory item's sku.
92 items:
93 type: string
94 title: sku
95 description: The sku's details.
96 - name: origin_country
97 in: query
98 required: false
99 schema:
100 oneOf:
101 - type: string
102 title: origin_country
103 description: The inventory item's origin country.
104 - type: array
105 description: The inventory item's origin country.
106 items:
107 type: string
108 title: origin_country
109 description: The origin country's details.
110 - name: mid_code
111 in: query
112 required: false
113 schema:
114 oneOf:
115 - type: string
116 title: mid_code
117 description: The inventory item's mid code.
118 - type: array
119 description: The inventory item's mid code.
120 items:
121 type: string
122 title: mid_code
123 description: The mid code's details.
124 - name: hs_code
125 in: query
126 required: false
127 schema:
128 oneOf:
129 - type: string
130 title: hs_code
131 description: The inventory item's hs code.
132 - type: array
133 description: The inventory item's hs code.
134 items:
135 type: string
136 title: hs_code
137 description: The hs code's details.
138 - name: material
139 in: query
140 required: false
141 schema:
142 oneOf:
143 - type: string
144 title: material
145 description: The inventory item's material.
146 - type: array
147 description: The inventory item's material.
148 items:
149 type: string
150 title: material
151 description: The material's details.
152 - name: requires_shipping
153 in: query
154 description: The inventory item's requires shipping.
155 required: false
156 schema:
157 type: boolean
158 title: requires_shipping
159 description: The inventory item's requires shipping.
160 - name: weight
161 in: query
162 description: Filter the inventory item's weight.
163 required: false
164 schema:
165 description: Filter the inventory item's weight.
166 properties:
167 $eq:
168 type: string
169 description: Filter by an exact match.
170 $ne:
171 type: string
172 description: Filter by values not matching this parameter.
173 $in:
174 type: array
175 description: Filter by values in this array's items.
176 items:
177 type: string
178 $nin:
179 type: array
180 description: Filter by values not in this array's items.
181 items:
182 type: string
183 $like:
184 type: string
185 description: Apply a `like` filter. Useful for strings only.
186 $ilike:
187 type: string
188 description: Apply a case-insensitive `like` filter. Useful for strings only.
189 $re:
190 type: string
191 description: Apply a regex filter. Useful for strings only.
192 $contains:
193 type: array
194 description: Filter arrays that contain some of the values of this parameter.
195 items:
196 type: string
197 $gt:
198 type: string
199 description: >-
200 Filter by values greater than this parameter. Useful for numbers
201 and dates only.
202 $gte:
203 type: string
204 description: >-
205 Filter by values greater than or equal to this parameter. Useful
206 for numbers and dates only.
207 $lt:
208 type: string
209 description: >-
210 Filter by values less than this parameter. Useful for numbers and
211 dates only.
212 $lte:
213 type: string
214 description: >-
215 Filter by values less than or equal to this parameter. Useful for
216 numbers and dates only.
217 - name: length
218 in: query
219 description: Filter the inventory item's length.
220 required: false
221 schema:
222 description: Filter the inventory item's length.
223 properties:
224 $eq:
225 type: string
226 description: Filter by an exact match.
227 $ne:
228 type: string
229 description: Filter by values not matching this parameter.
230 $in:
231 type: array
232 description: Filter by values in this array's items.
233 items:
234 type: string
235 $nin:
236 type: array
237 description: Filter by values not in this array's items.
238 items:
239 type: string
240 $like:
241 type: string
242 description: Apply a `like` filter. Useful for strings only.
243 $ilike:
244 type: string
245 description: Apply a case-insensitive `like` filter. Useful for strings only.
246 $re:
247 type: string
248 description: Apply a regex filter. Useful for strings only.
249 $contains:
250 type: array
251 description: Filter arrays that contain some of the values of this parameter.
252 items:
253 type: string
254 $gt:
255 type: string
256 description: >-
257 Filter by values greater than this parameter. Useful for numbers
258 and dates only.
259 $gte:
260 type: string
261 description: >-
262 Filter by values greater than or equal to this parameter. Useful
263 for numbers and dates only.
264 $lt:
265 type: string
266 description: >-
267 Filter by values less than this parameter. Useful for numbers and
268 dates only.
269 $lte:
270 type: string
271 description: >-
272 Filter by values less than or equal to this parameter. Useful for
273 numbers and dates only.
274 - name: height
275 in: query
276 description: Filter by the inventory item's height.
277 required: false
278 schema:
279 description: Filter by the inventory item's height.
280 properties:
281 $eq:
282 type: string
283 description: Filter by an exact match.
284 $ne:
285 type: string
286 description: Filter by values not matching this parameter.
287 $in:
288 type: array
289 description: Filter by values in this array's items.
290 items:
291 type: string
292 $nin:
293 type: array
294 description: Filter by values not in this array's items.
295 items:
296 type: string
297 $like:
298 type: string
299 description: Apply a `like` filter. Useful for strings only.
300 $ilike:
301 type: string
302 description: Apply a case-insensitive `like` filter. Useful for strings only.
303 $re:
304 type: string
305 description: Apply a regex filter. Useful for strings only.
306 $contains:
307 type: array
308 description: Filter arrays that contain some of the values of this parameter.
309 items:
310 type: string
311 $gt:
312 type: string
313 description: >-
314 Filter by values greater than this parameter. Useful for numbers
315 and dates only.
316 $gte:
317 type: string
318 description: >-
319 Filter by values greater than or equal to this parameter. Useful
320 for numbers and dates only.
321 $lt:
322 type: string
323 description: >-
324 Filter by values less than this parameter. Useful for numbers and
325 dates only.
326 $lte:
327 type: string
328 description: >-
329 Filter by values less than or equal to this parameter. Useful for
330 numbers and dates only.
331 - name: width
332 in: query
333 description: Filter by the inventory item's width.
334 required: false
335 schema:
336 description: Filter by the inventory item's width.
337 properties:
338 $eq:
339 type: string
340 description: Filter by an exact match.
341 $ne:
342 type: string
343 description: Filter by values not matching this parameter.
344 $in:
345 type: array
346 description: Filter by values in this array's items.
347 items:
348 type: string
349 $nin:
350 type: array
351 description: Filter by values not in this array's items.
352 items:
353 type: string
354 $like:
355 type: string
356 description: Apply a `like` filter. Useful for strings only.
357 $ilike:
358 type: string
359 description: Apply a case-insensitive `like` filter. Useful for strings only.
360 $re:
361 type: string
362 description: Apply a regex filter. Useful for strings only.
363 $contains:
364 type: array
365 description: Filter arrays that contain some of the values of this parameter.
366 items:
367 type: string
368 $gt:
369 type: string
370 description: >-
371 Filter by values greater than this parameter. Useful for numbers
372 and dates only.
373 $gte:
374 type: string
375 description: >-
376 Filter by values greater than or equal to this parameter. Useful
377 for numbers and dates only.
378 $lt:
379 type: string
380 description: >-
381 Filter by values less than this parameter. Useful for numbers and
382 dates only.
383 $lte:
384 type: string
385 description: >-
386 Filter by values less than or equal to this parameter. Useful for
387 numbers and dates only.
388 - name: location_levels
389 in: query
390 description: Filter by the inventory item's associated location IDs.
391 required: false
392 schema:
393 type: object
394 description: Filter by the inventory item's associated location IDs.
395 properties:
396 location_id:
397 oneOf:
398 - type: string
399 title: location_id
400 description: The associated location's ID.
401 - type: array
402 description: >-
403 The location IDs to retrieve inventory items associated with
404 them.
405 items:
406 type: string
407 title: location_id
408 description: A location's ID.
409 - name: $and
410 in: query
411 required: false
412 schema:
413 type: array
414 description: >-
415 Join query parameters with an AND condition. Each object's content is
416 the same type as the expected query parameters.
417 items:
418 type: object
419 title: $and
420 - name: $or
421 in: query
422 required: false
423 schema:
424 type: array
425 description: >-
426 Join query parameters with an OR condition. Each object's content is
427 the same type as the expected query parameters.
428 items:
429 type: object
430 title: $or
431 - name: with_deleted
432 in: query
433 description: Whether to include deleted records in the result.
434 required: false
435 schema:
436 type: boolean
437 title: with_deleted
438 description: Whether to include deleted records in the result.
439 security:
440 - api_token: []
441 - cookie_auth: []
442 - jwt_token: []
443 x-codeSamples:
444 - lang: JavaScript
445 label: JS SDK
446 source:
447 $ref: ../code_samples/JavaScript/admin_inventory-items/get.js
448 - lang: Shell
449 label: cURL
450 source:
451 $ref: ../code_samples/Shell/admin_inventory-items/get.sh
452 tags:
453 - Inventory Items
454 responses:
455 '200':
456 description: OK
457 content:
458 application/json:
459 schema:
460 allOf:
461 - type: object
462 description: The paginated list of inventory items.
463 required:
464 - limit
465 - offset
466 - count
467 properties:
468 limit:
469 type: number
470 title: limit
471 description: The maximum number of items returned.
472 offset:
473 type: number
474 title: offset
475 description: >-
476 The number of items skipped before retrieving the returned
477 items.
478 count:
479 type: number
480 title: count
481 description: The total number of items.
482 - type: object
483 description: The paginated list of inventory items.
484 required:
485 - inventory_items
486 properties:
487 inventory_items:
488 type: array
489 description: The inventory item's inventory items.
490 items:
491 $ref: ../components/schemas/AdminInventoryItem.yaml
492 '400':
493 $ref: ../components/responses/400_error.yaml
494 '401':
495 $ref: ../components/responses/unauthorized.yaml
496 '404':
497 $ref: ../components/responses/not_found_error.yaml
498 '409':
499 $ref: ../components/responses/invalid_state_error.yaml
500 '422':
501 $ref: ../components/responses/invalid_request_error.yaml
502 '500':
503 $ref: ../components/responses/500_error.yaml
504 post:
505 operationId: PostInventoryItems
506 summary: Create Inventory Item
507 description: Create an inventory item.
508 x-authenticated: true
509 parameters:
510 - name: fields
511 in: query
512 description: >-
513 Comma-separated fields that should be included in the returned data. if
514 a field is prefixed with `+` it will be added to the default fields,
515 using `-` will remove it from the default fields. without prefix it will
516 replace the entire default fields.
517 required: false
518 schema:
519 type: string
520 title: fields
521 description: >-
522 Comma-separated fields that should be included in the returned data.
523 if a field is prefixed with `+` it will be added to the default
524 fields, using `-` will remove it from the default fields. without
525 prefix it will replace the entire default fields.
526 externalDocs:
527 url: '#select-fields-and-relations'
528 security:
529 - api_token: []
530 - cookie_auth: []
531 - jwt_token: []
532 requestBody:
533 content:
534 application/json:
535 schema:
536 $ref: ../components/schemas/AdminCreateInventoryItem.yaml
537 x-codeSamples:
538 - lang: JavaScript
539 label: JS SDK
540 source:
541 $ref: ../code_samples/JavaScript/admin_inventory-items/post.js
542 - lang: Shell
543 label: cURL
544 source:
545 $ref: ../code_samples/Shell/admin_inventory-items/post.sh
546 tags:
547 - Inventory Items
548 responses:
549 '200':
550 description: OK
551 content:
552 application/json:
553 schema:
554 $ref: ../components/schemas/AdminInventoryItemResponse.yaml
555 '400':
556 $ref: ../components/responses/400_error.yaml
557 '401':
558 $ref: ../components/responses/unauthorized.yaml
559 '404':
560 $ref: ../components/responses/not_found_error.yaml
561 '409':
562 $ref: ../components/responses/invalid_state_error.yaml
563 '422':
564 $ref: ../components/responses/invalid_request_error.yaml
565 '500':
566 $ref: ../components/responses/500_error.yaml
567 x-workflow: createInventoryItemsWorkflow
568 x-events:
569 - name: inventory-item.created
570 payload: |-
571 ```ts
572 {
573 id, // The ID of the inventory item
574 }
575 ```
576 description: Emitted when inventory items are created.
577 deprecated: false
578 since: 2.18.0
579 - name: inventory-level.created
580 payload: |-
581 ```ts
582 {
583 id, // The ID of the inventory level
584 }
585 ```
586 description: Emitted when inventory levels are created.
587 deprecated: false
588 since: 2.18.0