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