1 get:
2 operationId: GetProductVariants
3 summary: List Product Variants
4 description: >-
5 Retrieve a list of product variants. The product variants can be filtered by
6 fields such as `id`. The product variants 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: Search term to filter the product variant's searchable properties.
63 required: false
64 schema:
65 type: string
66 title: q
67 description: Search term to filter the product variant's searchable properties.
68 - name: id
69 in: query
70 required: false
71 schema:
72 oneOf:
73 - type: string
74 title: id
75 description: Filter by a variant's ID.
76 - type: array
77 description: Filter by variant IDs.
78 items:
79 type: string
80 title: id
81 description: A variant's ID.
82 - name: manage_inventory
83 in: query
84 description: Filter by whether a variant's `manage_inventory` is enabled.
85 required: false
86 schema:
87 type: boolean
88 title: manage_inventory
89 description: Filter by whether a variant's `manage_inventory` is enabled.
90 - name: allow_backorder
91 in: query
92 description: Filter by whether backorder is allowed for a variant.
93 required: false
94 schema:
95 type: boolean
96 title: allow_backorder
97 description: Filter by whether backorder is allowed for a variant.
98 - name: created_at
99 in: query
100 description: Filter by the product variant's creation date.
101 required: false
102 schema:
103 type: object
104 description: Filter by the product variant's creation date.
105 properties:
106 $and:
107 type: array
108 description: >-
109 Join query parameters with an AND condition. Each object's content
110 is the same type as the expected query parameters.
111 items:
112 type: object
113 title: $and
114 $or:
115 type: array
116 description: >-
117 Join query parameters with an OR condition. Each object's content
118 is the same type as the expected query parameters.
119 items:
120 type: object
121 title: $or
122 $eq:
123 oneOf:
124 - type: string
125 title: $eq
126 description: Filter by an exact match.
127 - type: array
128 description: Filter by an exact match.
129 items:
130 type: string
131 title: $eq
132 description: Filter by an exact match.
133 $ne:
134 type: string
135 title: $ne
136 description: Filter by values not equal to this parameter.
137 $in:
138 type: array
139 description: Filter by values in this array.
140 items:
141 type: string
142 title: $in
143 description: Filter by values in this array.
144 $nin:
145 type: array
146 description: Filter by values not in this array.
147 items:
148 type: string
149 title: $nin
150 description: Filter by values not in this array.
151 $not:
152 oneOf:
153 - type: string
154 title: $not
155 description: >-
156 Filter by values not matching the conditions in this
157 parameter.
158 - type: object
159 description: >-
160 Filter by values not matching the conditions in this
161 parameter.
162 - type: array
163 description: >-
164 Filter by values not matching the conditions in this
165 parameter.
166 items:
167 type: string
168 title: $not
169 description: >-
170 Filter by values not matching the conditions in this
171 parameter.
172 $gt:
173 type: string
174 title: $gt
175 description: >-
176 Filter by values greater than this parameter. Useful for numbers
177 and dates only.
178 $gte:
179 type: string
180 title: $gte
181 description: >-
182 Filter by values greater than or equal to this parameter. Useful
183 for numbers and dates only.
184 $lt:
185 type: string
186 title: $lt
187 description: >-
188 Filter by values less than this parameter. Useful for numbers and
189 dates only.
190 $lte:
191 type: string
192 title: $lte
193 description: >-
194 Filter by values less than or equal to this parameter. Useful for
195 numbers and dates only.
196 $like:
197 type: string
198 title: $like
199 description: Apply a `like` filter. Useful for strings only.
200 $re:
201 type: string
202 title: $re
203 description: Apply a regex filter. Useful for strings only.
204 $ilike:
205 type: string
206 title: $ilike
207 description: Apply a case-insensitive `like` filter. Useful for strings only.
208 $fulltext:
209 type: string
210 title: $fulltext
211 description: Filter to apply on full-text properties.
212 $overlap:
213 type: array
214 description: Filter arrays that have overlapping values with this parameter.
215 items:
216 type: string
217 title: $overlap
218 description: Filter arrays that have overlapping values with this parameter.
219 $contains:
220 type: array
221 description: Filter arrays that contain some of the values of this parameter.
222 items:
223 type: string
224 title: $contains
225 description: Filter arrays that contain some of the values of this parameter.
226 $contained:
227 type: array
228 description: Filter arrays that contain all values of this parameter.
229 items:
230 type: string
231 title: $contained
232 description: Filter arrays that contain all values of this parameter.
233 $exists:
234 type: boolean
235 title: $exists
236 description: Filter by whether a value for this parameter exists (not `null`).
237 title: created_at
238 - name: updated_at
239 in: query
240 description: Filter by the product variant's update date.
241 required: false
242 schema:
243 type: object
244 description: Filter by the product variant's update date.
245 properties:
246 $and:
247 type: array
248 description: >-
249 Join query parameters with an AND condition. Each object's content
250 is the same type as the expected query parameters.
251 items:
252 type: object
253 title: $and
254 $or:
255 type: array
256 description: >-
257 Join query parameters with an OR condition. Each object's content
258 is the same type as the expected query parameters.
259 items:
260 type: object
261 title: $or
262 $eq:
263 oneOf:
264 - type: string
265 title: $eq
266 description: Filter by an exact match.
267 - type: array
268 description: Filter by an exact match.
269 items:
270 type: string
271 title: $eq
272 description: Filter by an exact match.
273 $ne:
274 type: string
275 title: $ne
276 description: Filter by values not equal to this parameter.
277 $in:
278 type: array
279 description: Filter by values in this array.
280 items:
281 type: string
282 title: $in
283 description: Filter by values in this array.
284 $nin:
285 type: array
286 description: Filter by values not in this array.
287 items:
288 type: string
289 title: $nin
290 description: Filter by values not in this array.
291 $not:
292 oneOf:
293 - type: string
294 title: $not
295 description: >-
296 Filter by values not matching the conditions in this
297 parameter.
298 - type: object
299 description: >-
300 Filter by values not matching the conditions in this
301 parameter.
302 - type: array
303 description: >-
304 Filter by values not matching the conditions in this
305 parameter.
306 items:
307 type: string
308 title: $not
309 description: >-
310 Filter by values not matching the conditions in this
311 parameter.
312 $gt:
313 type: string
314 title: $gt
315 description: >-
316 Filter by values greater than this parameter. Useful for numbers
317 and dates only.
318 $gte:
319 type: string
320 title: $gte
321 description: >-
322 Filter by values greater than or equal to this parameter. Useful
323 for numbers and dates only.
324 $lt:
325 type: string
326 title: $lt
327 description: >-
328 Filter by values less than this parameter. Useful for numbers and
329 dates only.
330 $lte:
331 type: string
332 title: $lte
333 description: >-
334 Filter by values less than or equal to this parameter. Useful for
335 numbers and dates only.
336 $like:
337 type: string
338 title: $like
339 description: Apply a `like` filter. Useful for strings only.
340 $re:
341 type: string
342 title: $re
343 description: Apply a regex filter. Useful for strings only.
344 $ilike:
345 type: string
346 title: $ilike
347 description: Apply a case-insensitive `like` filter. Useful for strings only.
348 $fulltext:
349 type: string
350 title: $fulltext
351 description: Filter to apply on full-text properties.
352 $overlap:
353 type: array
354 description: Filter arrays that have overlapping values with this parameter.
355 items:
356 type: string
357 title: $overlap
358 description: Filter arrays that have overlapping values with this parameter.
359 $contains:
360 type: array
361 description: Filter arrays that contain some of the values of this parameter.
362 items:
363 type: string
364 title: $contains
365 description: Filter arrays that contain some of the values of this parameter.
366 $contained:
367 type: array
368 description: Filter arrays that contain all values of this parameter.
369 items:
370 type: string
371 title: $contained
372 description: Filter arrays that contain all values of this parameter.
373 $exists:
374 type: boolean
375 title: $exists
376 description: Filter by whether a value for this parameter exists (not `null`).
377 title: updated_at
378 - name: deleted_at
379 in: query
380 description: Filter by the product variant's deletion date.
381 required: false
382 schema:
383 type: object
384 description: Filter by the product variant's deletion date.
385 properties:
386 $and:
387 type: array
388 description: >-
389 Join query parameters with an AND condition. Each object's content
390 is the same type as the expected query parameters.
391 items:
392 type: object
393 title: $and
394 $or:
395 type: array
396 description: >-
397 Join query parameters with an OR condition. Each object's content
398 is the same type as the expected query parameters.
399 items:
400 type: object
401 title: $or
402 $eq:
403 oneOf:
404 - type: string
405 title: $eq
406 description: Filter by an exact match.
407 - type: array
408 description: Filter by an exact match.
409 items:
410 type: string
411 title: $eq
412 description: Filter by an exact match.
413 $ne:
414 type: string
415 title: $ne
416 description: Filter by values not equal to this parameter.
417 $in:
418 type: array
419 description: Filter by values in this array.
420 items:
421 type: string
422 title: $in
423 description: Filter by values in this array.
424 $nin:
425 type: array
426 description: Filter by values not in this array.
427 items:
428 type: string
429 title: $nin
430 description: Filter by values not in this array.
431 $not:
432 oneOf:
433 - type: string
434 title: $not
435 description: >-
436 Filter by values not matching the conditions in this
437 parameter.
438 - type: object
439 description: >-
440 Filter by values not matching the conditions in this
441 parameter.
442 - type: array
443 description: >-
444 Filter by values not matching the conditions in this
445 parameter.
446 items:
447 type: string
448 title: $not
449 description: >-
450 Filter by values not matching the conditions in this
451 parameter.
452 $gt:
453 type: string
454 title: $gt
455 description: >-
456 Filter by values greater than this parameter. Useful for numbers
457 and dates only.
458 $gte:
459 type: string
460 title: $gte
461 description: >-
462 Filter by values greater than or equal to this parameter. Useful
463 for numbers and dates only.
464 $lt:
465 type: string
466 title: $lt
467 description: >-
468 Filter by values less than this parameter. Useful for numbers and
469 dates only.
470 $lte:
471 type: string
472 title: $lte
473 description: >-
474 Filter by values less than or equal to this parameter. Useful for
475 numbers and dates only.
476 $like:
477 type: string
478 title: $like
479 description: Apply a `like` filter. Useful for strings only.
480 $re:
481 type: string
482 title: $re
483 description: Apply a regex filter. Useful for strings only.
484 $ilike:
485 type: string
486 title: $ilike
487 description: Apply a case-insensitive `like` filter. Useful for strings only.
488 $fulltext:
489 type: string
490 title: $fulltext
491 description: Filter to apply on full-text properties.
492 $overlap:
493 type: array
494 description: Filter arrays that have overlapping values with this parameter.
495 items:
496 type: string
497 title: $overlap
498 description: Filter arrays that have overlapping values with this parameter.
499 $contains:
500 type: array
501 description: Filter arrays that contain some of the values of this parameter.
502 items:
503 type: string
504 title: $contains
505 description: Filter arrays that contain some of the values of this parameter.
506 $contained:
507 type: array
508 description: Filter arrays that contain all values of this parameter.
509 items:
510 type: string
511 title: $contained
512 description: Filter arrays that contain all values of this parameter.
513 $exists:
514 type: boolean
515 title: $exists
516 description: Filter by whether a value for this parameter exists (not `null`).
517 title: deleted_at
518 - name: $and
519 in: query
520 description: >-
521 Join query parameters with an AND condition. Each object's content is
522 the same type as the expected query parameters.
523 required: false
524 schema:
525 type: array
526 description: >-
527 Join query parameters with an AND condition. Each object's content is
528 the same type as the expected query parameters.
529 items:
530 type: object
531 title: $and
532 - name: $or
533 in: query
534 description: >-
535 Join query parameters with an OR condition. Each object's content is the
536 same type as the expected query parameters.
537 required: false
538 schema:
539 type: array
540 description: >-
541 Join query parameters with an OR condition. Each object's content is
542 the same type as the expected query parameters.
543 items:
544 type: object
545 title: $or
546 - name: with_deleted
547 in: query
548 description: Whether to include deleted records in the result.
549 required: false
550 schema:
551 type: boolean
552 title: with_deleted
553 description: Whether to include deleted records in the result.
554 - name: ean
555 in: query
556 required: false
557 schema:
558 oneOf:
559 - type: string
560 title: ean
561 description: The product variant's ean.
562 - type: array
563 description: The product variant's ean.
564 items:
565 type: string
566 title: ean
567 description: The ean's details.
568 - name: upc
569 in: query
570 required: false
571 schema:
572 oneOf:
573 - type: string
574 title: upc
575 description: The product variant's upc.
576 - type: array
577 description: The product variant's upc.
578 items:
579 type: string
580 title: upc
581 description: The upc's details.
582 - name: barcode
583 in: query
584 required: false
585 schema:
586 oneOf:
587 - type: string
588 title: barcode
589 description: The product variant's barcode.
590 - type: array
591 description: The product variant's barcode.
592 items:
593 type: string
594 title: barcode
595 description: The barcode's details.
596 - name: sku
597 in: query
598 required: false
599 schema:
600 oneOf:
601 - type: string
602 title: sku
603 description: Filter by an SKU.
604 - type: array
605 description: Filter by multiple SKUs.
606 items:
607 type: string
608 title: sku
609 description: An SKU.
610 security:
611 - api_token: []
612 - cookie_auth: []
613 - jwt_token: []
614 x-codeSamples:
615 - lang: JavaScript
616 label: JS SDK
617 source:
618 $ref: ../code_samples/JavaScript/admin_product-variants/get.js
619 - lang: Shell
620 label: cURL
621 source:
622 $ref: ../code_samples/Shell/admin_product-variants/get.sh
623 tags:
624 - Product Variants
625 responses:
626 '200':
627 description: OK
628 content:
629 application/json:
630 schema:
631 allOf:
632 - type: object
633 description: The paginated list of product variants.
634 required:
635 - limit
636 - offset
637 - count
638 properties:
639 limit:
640 type: number
641 title: limit
642 description: The maximum number of items returned.
643 offset:
644 type: number
645 title: offset
646 description: >-
647 The number of items skipped before retrieving the returned
648 items.
649 count:
650 type: number
651 title: count
652 description: The total number of items.
653 - type: object
654 description: The paginated list of product variants.
655 required:
656 - variants
657 properties:
658 variants:
659 type: array
660 description: The product variant's variants.
661 items:
662 $ref: ../components/schemas/AdminProductVariant.yaml
663 '400':
664 $ref: ../components/responses/400_error.yaml
665 '401':
666 $ref: ../components/responses/unauthorized.yaml
667 '404':
668 $ref: ../components/responses/not_found_error.yaml
669 '409':
670 $ref: ../components/responses/invalid_state_error.yaml
671 '422':
672 $ref: ../components/responses/invalid_request_error.yaml
673 '500':
674 $ref: ../components/responses/500_error.yaml