1 /**
2 * @oas [get] /admin/exchanges
3 * operationId: GetExchanges
4 * summary: List Exchanges
5 * description: Retrieve a list of exchanges. The exchanges can be filtered by fields such as `id`. The exchanges can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * - name: offset
21 * in: query
22 * description: The number of items to skip when retrieving a list.
23 * required: false
24 * schema:
25 * type: number
26 * title: offset
27 * description: The number of items to skip when retrieving a list.
28 * externalDocs:
29 * url: "#pagination"
30 * - name: limit
31 * in: query
32 * description: Limit the number of items returned in the list.
33 * required: false
34 * schema:
35 * type: number
36 * title: limit
37 * description: Limit the number of items returned in the list.
38 * externalDocs:
39 * url: "#pagination"
40 * - name: order
41 * in: query
42 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
43 * required: false
44 * schema:
45 * type: string
46 * title: order
47 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
48 * - name: deleted_at
49 * in: query
50 * description: Filter by an exchange's deletion date.
51 * required: false
52 * schema:
53 * type: object
54 * description: Filter by an exchange's deletion date.
55 * properties:
56 * $and:
57 * type: array
58 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
59 * items:
60 * type: object
61 * title: $and
62 * $or:
63 * type: array
64 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
65 * items:
66 * type: object
67 * title: $or
68 * $eq:
69 * oneOf:
70 * - type: string
71 * title: $eq
72 * description: Filter by an exact match.
73 * - type: array
74 * description: Filter by multiple exact matches.
75 * items:
76 * type: string
77 * title: $eq
78 * description: An exact match.
79 * $ne:
80 * type: string
81 * title: $ne
82 * description: Filter by values not equal to this parameter.
83 * $in:
84 * type: array
85 * description: Filter by values in this array.
86 * items:
87 * type: string
88 * title: $in
89 * description: The value to match.
90 * $nin:
91 * type: array
92 * description: Filter by values not in this array.
93 * items:
94 * type: string
95 * title: $nin
96 * description: The value not to match.
97 * $not:
98 * oneOf:
99 * - type: string
100 * title: $not
101 * description: Filter by values not matching this parameter.
102 * - type: object
103 * description: Filter by values not matching the conditions in this parameter.
104 * properties:
105 * $and:
106 * type: array
107 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
108 * items:
109 * type: object
110 * title: $and
111 * $or:
112 * type: array
113 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
114 * items:
115 * type: object
116 * title: $or
117 * $eq:
118 * oneOf:
119 * - type: string
120 * title: $eq
121 * description: Filter by an exact match.
122 * - type: array
123 * description: Filter by multiple exact matches.
124 * items:
125 * type: string
126 * title: $eq
127 * description: The value to match.
128 * $ne:
129 * type: string
130 * title: $ne
131 * description: Filter by values not matching this parameter.
132 * $in:
133 * type: array
134 * description: Filter by values in this array.
135 * items:
136 * type: string
137 * title: $in
138 * description: The value to match.
139 * $nin:
140 * type: array
141 * description: Filter by values not in this array.
142 * items:
143 * type: string
144 * title: $nin
145 * description: The value to not match
146 * $not:
147 * oneOf:
148 * - type: string
149 * title: $not
150 * description: Filter by values not matching this parameter
151 * - type: object
152 * description: Filter by values not matching the conditions in this parameter.
153 * - type: array
154 * description: Filter by values not matching the values of this parameter.
155 * items:
156 * type: string
157 * title: $not
158 * description: The values to not match.
159 * $gt:
160 * type: string
161 * title: $gt
162 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
163 * $gte:
164 * type: string
165 * title: $gte
166 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
167 * $lt:
168 * type: string
169 * title: $lt
170 * description: Filter by values less than this parameter. Useful for numbers and dates only.
171 * $lte:
172 * type: string
173 * title: $lte
174 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
175 * $like:
176 * type: string
177 * title: $like
178 * description: Apply a `like` filter. Useful for strings only.
179 * $re:
180 * type: string
181 * title: $re
182 * description: Apply a regex filter. Useful for strings only.
183 * $ilike:
184 * type: string
185 * title: $ilike
186 * description: Apply a case-insensitive `like` filter. Useful for strings only.
187 * $fulltext:
188 * type: string
189 * title: $fulltext
190 * description: Filter to apply on full-text properties.
191 * $overlap:
192 * type: array
193 * description: Filter arrays that have overlapping values with this parameter.
194 * items:
195 * type: string
196 * title: $overlap
197 * description: The value to match.
198 * $contains:
199 * type: array
200 * description: Filter arrays that contain some of the values of this parameter.
201 * items:
202 * type: string
203 * title: $contains
204 * description: The values to match.
205 * $contained:
206 * type: array
207 * description: Filter arrays that contain all values of this parameter.
208 * items:
209 * type: string
210 * title: $contained
211 * description: The values to match.
212 * $exists:
213 * type: boolean
214 * title: $exists
215 * description: Filter by whether a value for this parameter exists (not `null`).
216 * - type: array
217 * description: Filter by values not matching those in this parameter.
218 * items:
219 * type: string
220 * title: $not
221 * description: The values to not match.
222 * $gt:
223 * type: string
224 * title: $gt
225 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
226 * $gte:
227 * type: string
228 * title: $gte
229 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
230 * $lt:
231 * type: string
232 * title: $lt
233 * description: Filter by values less than this parameter. Useful for numbers and dates only.
234 * $lte:
235 * type: string
236 * title: $lte
237 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
238 * $like:
239 * type: string
240 * title: $like
241 * description: Apply a `like` filter. Useful for strings only.
242 * $re:
243 * type: string
244 * title: $re
245 * description: Apply a regex filter. Useful for strings only.
246 * $ilike:
247 * type: string
248 * title: $ilike
249 * description: Apply a case-insensitive `like` filter. Useful for strings only.
250 * $fulltext:
251 * type: string
252 * title: $fulltext
253 * description: Filter to apply on full-text properties.
254 * $overlap:
255 * type: array
256 * description: Filter arrays that have overlapping values with this parameter.
257 * items:
258 * type: string
259 * title: $overlap
260 * description: The values to match.
261 * $contains:
262 * type: array
263 * description: Filter arrays that contain some of the values of this parameter.
264 * items:
265 * type: string
266 * title: $contains
267 * description: The values to match.
268 * $contained:
269 * type: array
270 * description: Filter arrays that contain all values of this parameter.
271 * items:
272 * type: string
273 * title: $contained
274 * description: The values to match.
275 * $exists:
276 * type: boolean
277 * title: $exists
278 * description: Filter by whether a value for this parameter exists (not `null`).
279 * title: deleted_at
280 * - name: id
281 * in: query
282 * required: false
283 * schema:
284 * oneOf:
285 * - type: string
286 * title: id
287 * description: Filter by an exchange ID.
288 * - type: array
289 * description: Filter by exchange IDs.
290 * items:
291 * type: string
292 * title: id
293 * description: An exchange ID.
294 * - name: order_id
295 * in: query
296 * required: false
297 * schema:
298 * oneOf:
299 * - type: string
300 * title: order_id
301 * description: Filter by an exchange's order ID.
302 * - type: array
303 * description: Filter by order IDs that the exchanges belong to.
304 * items:
305 * type: string
306 * title: order_id
307 * description: An order's ID.
308 * - name: status
309 * in: query
310 * required: false
311 * schema:
312 * oneOf:
313 * - type: string
314 * title: status
315 * description: Filter by an exchange's status.
316 * - type: array
317 * description: Filter by exchange statuses.
318 * items:
319 * type: string
320 * title: status
321 * description: An exchange status.
322 * - name: created_at
323 * in: query
324 * description: Filter by the exchange's creation date.
325 * required: false
326 * schema:
327 * type: object
328 * description: Filter by the exchange's creation date.
329 * properties:
330 * $and:
331 * type: array
332 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
333 * items:
334 * type: object
335 * title: $and
336 * $or:
337 * type: array
338 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
339 * items:
340 * type: object
341 * title: $or
342 * $eq:
343 * oneOf:
344 * - type: string
345 * title: $eq
346 * description: Filter by an exact match.
347 * - type: array
348 * description: Filter by multiple exact matches.
349 * items:
350 * type: string
351 * title: $eq
352 * description: An exact match.
353 * $ne:
354 * type: string
355 * title: $ne
356 * description: Filter by values not equal to this parameter.
357 * $in:
358 * type: array
359 * description: Filter by values in this array.
360 * items:
361 * type: string
362 * title: $in
363 * description: The value to match.
364 * $nin:
365 * type: array
366 * description: Filter by values not in this array.
367 * items:
368 * type: string
369 * title: $nin
370 * description: The value not to match.
371 * $not:
372 * oneOf:
373 * - type: string
374 * title: $not
375 * description: Filter by values not matching this parameter.
376 * - type: object
377 * description: Filter by values not matching the conditions in this parameter.
378 * properties:
379 * $and:
380 * type: array
381 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
382 * items:
383 * type: object
384 * title: $and
385 * $or:
386 * type: array
387 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
388 * items:
389 * type: object
390 * title: $or
391 * $eq:
392 * oneOf:
393 * - type: string
394 * title: $eq
395 * description: Filter by an exact match.
396 * - type: array
397 * description: Filter by multiple exact matches.
398 * items:
399 * type: string
400 * title: $eq
401 * description: The value to match.
402 * $ne:
403 * type: string
404 * title: $ne
405 * description: Filter by values not matching this parameter.
406 * $in:
407 * type: array
408 * description: Filter by values in this array.
409 * items:
410 * type: string
411 * title: $in
412 * description: The value to match.
413 * $nin:
414 * type: array
415 * description: Filter by values not in this array.
416 * items:
417 * type: string
418 * title: $nin
419 * description: The value to not match
420 * $not:
421 * oneOf:
422 * - type: string
423 * title: $not
424 * description: Filter by values not matching this parameter
425 * - type: object
426 * description: Filter by values not matching the conditions in this parameter.
427 * - type: array
428 * description: Filter by values not matching the values of this parameter.
429 * items:
430 * type: string
431 * title: $not
432 * description: The values to not match.
433 * $gt:
434 * type: string
435 * title: $gt
436 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
437 * $gte:
438 * type: string
439 * title: $gte
440 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
441 * $lt:
442 * type: string
443 * title: $lt
444 * description: Filter by values less than this parameter. Useful for numbers and dates only.
445 * $lte:
446 * type: string
447 * title: $lte
448 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
449 * $like:
450 * type: string
451 * title: $like
452 * description: Apply a `like` filter. Useful for strings only.
453 * $re:
454 * type: string
455 * title: $re
456 * description: Apply a regex filter. Useful for strings only.
457 * $ilike:
458 * type: string
459 * title: $ilike
460 * description: Apply a case-insensitive `like` filter. Useful for strings only.
461 * $fulltext:
462 * type: string
463 * title: $fulltext
464 * description: Filter to apply on full-text properties.
465 * $overlap:
466 * type: array
467 * description: Filter arrays that have overlapping values with this parameter.
468 * items:
469 * type: string
470 * title: $overlap
471 * description: The value to match.
472 * $contains:
473 * type: array
474 * description: Filter arrays that contain some of the values of this parameter.
475 * items:
476 * type: string
477 * title: $contains
478 * description: The values to match.
479 * $contained:
480 * type: array
481 * description: Filter arrays that contain all values of this parameter.
482 * items:
483 * type: string
484 * title: $contained
485 * description: The values to match.
486 * $exists:
487 * type: boolean
488 * title: $exists
489 * description: Filter by whether a value for this parameter exists (not `null`).
490 * - type: array
491 * description: Filter by values not matching those in this parameter.
492 * items:
493 * type: string
494 * title: $not
495 * description: The values to not match.
496 * $gt:
497 * type: string
498 * title: $gt
499 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
500 * $gte:
501 * type: string
502 * title: $gte
503 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
504 * $lt:
505 * type: string
506 * title: $lt
507 * description: Filter by values less than this parameter. Useful for numbers and dates only.
508 * $lte:
509 * type: string
510 * title: $lte
511 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
512 * $like:
513 * type: string
514 * title: $like
515 * description: Apply a `like` filter. Useful for strings only.
516 * $re:
517 * type: string
518 * title: $re
519 * description: Apply a regex filter. Useful for strings only.
520 * $ilike:
521 * type: string
522 * title: $ilike
523 * description: Apply a case-insensitive `like` filter. Useful for strings only.
524 * $fulltext:
525 * type: string
526 * title: $fulltext
527 * description: Filter to apply on full-text properties.
528 * $overlap:
529 * type: array
530 * description: Filter arrays that have overlapping values with this parameter.
531 * items:
532 * type: string
533 * title: $overlap
534 * description: The values to match.
535 * $contains:
536 * type: array
537 * description: Filter arrays that contain some of the values of this parameter.
538 * items:
539 * type: string
540 * title: $contains
541 * description: The values to match.
542 * $contained:
543 * type: array
544 * description: Filter arrays that contain all values of this parameter.
545 * items:
546 * type: string
547 * title: $contained
548 * description: The values to match.
549 * $exists:
550 * type: boolean
551 * title: $exists
552 * description: Filter by whether a value for this parameter exists (not `null`).
553 * title: created_at
554 * - name: updated_at
555 * in: query
556 * description: Filter by the exchange's update date.
557 * required: false
558 * schema:
559 * type: object
560 * description: Filter by the exchange's update date.
561 * properties:
562 * $and:
563 * type: array
564 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
565 * items:
566 * type: object
567 * title: $and
568 * $or:
569 * type: array
570 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
571 * items:
572 * type: object
573 * title: $or
574 * $eq:
575 * oneOf:
576 * - type: string
577 * title: $eq
578 * description: Filter by an exact match.
579 * - type: array
580 * description: Filter by multiple exact matches.
581 * items:
582 * type: string
583 * title: $eq
584 * description: An exact match.
585 * $ne:
586 * type: string
587 * title: $ne
588 * description: Filter by values not equal to this parameter.
589 * $in:
590 * type: array
591 * description: Filter by values in this array.
592 * items:
593 * type: string
594 * title: $in
595 * description: The value to match.
596 * $nin:
597 * type: array
598 * description: Filter by values not in this array.
599 * items:
600 * type: string
601 * title: $nin
602 * description: The value not to match.
603 * $not:
604 * oneOf:
605 * - type: string
606 * title: $not
607 * description: Filter by values not matching this parameter.
608 * - type: object
609 * description: Filter by values not matching the conditions in this parameter.
610 * properties:
611 * $and:
612 * type: array
613 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
614 * items:
615 * type: object
616 * title: $and
617 * $or:
618 * type: array
619 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
620 * items:
621 * type: object
622 * title: $or
623 * $eq:
624 * oneOf:
625 * - type: string
626 * title: $eq
627 * description: Filter by an exact match.
628 * - type: array
629 * description: Filter by multiple exact matches.
630 * items:
631 * type: string
632 * title: $eq
633 * description: The value to match.
634 * $ne:
635 * type: string
636 * title: $ne
637 * description: Filter by values not matching this parameter.
638 * $in:
639 * type: array
640 * description: Filter by values in this array.
641 * items:
642 * type: string
643 * title: $in
644 * description: The value to match.
645 * $nin:
646 * type: array
647 * description: Filter by values not in this array.
648 * items:
649 * type: string
650 * title: $nin
651 * description: The value to not match
652 * $not:
653 * oneOf:
654 * - type: string
655 * title: $not
656 * description: Filter by values not matching this parameter
657 * - type: object
658 * description: Filter by values not matching the conditions in this parameter.
659 * - type: array
660 * description: Filter by values not matching the values of this parameter.
661 * items:
662 * type: string
663 * title: $not
664 * description: The values to not match.
665 * $gt:
666 * type: string
667 * title: $gt
668 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
669 * $gte:
670 * type: string
671 * title: $gte
672 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
673 * $lt:
674 * type: string
675 * title: $lt
676 * description: Filter by values less than this parameter. Useful for numbers and dates only.
677 * $lte:
678 * type: string
679 * title: $lte
680 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
681 * $like:
682 * type: string
683 * title: $like
684 * description: Apply a `like` filter. Useful for strings only.
685 * $re:
686 * type: string
687 * title: $re
688 * description: Apply a regex filter. Useful for strings only.
689 * $ilike:
690 * type: string
691 * title: $ilike
692 * description: Apply a case-insensitive `like` filter. Useful for strings only.
693 * $fulltext:
694 * type: string
695 * title: $fulltext
696 * description: Filter to apply on full-text properties.
697 * $overlap:
698 * type: array
699 * description: Filter arrays that have overlapping values with this parameter.
700 * items:
701 * type: string
702 * title: $overlap
703 * description: The value to match.
704 * $contains:
705 * type: array
706 * description: Filter arrays that contain some of the values of this parameter.
707 * items:
708 * type: string
709 * title: $contains
710 * description: The values to match.
711 * $contained:
712 * type: array
713 * description: Filter arrays that contain all values of this parameter.
714 * items:
715 * type: string
716 * title: $contained
717 * description: The values to match.
718 * $exists:
719 * type: boolean
720 * title: $exists
721 * description: Filter by whether a value for this parameter exists (not `null`).
722 * - type: array
723 * description: Filter by values not matching those in this parameter.
724 * items:
725 * type: string
726 * title: $not
727 * description: The values to not match.
728 * $gt:
729 * type: string
730 * title: $gt
731 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
732 * $gte:
733 * type: string
734 * title: $gte
735 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
736 * $lt:
737 * type: string
738 * title: $lt
739 * description: Filter by values less than this parameter. Useful for numbers and dates only.
740 * $lte:
741 * type: string
742 * title: $lte
743 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
744 * $like:
745 * type: string
746 * title: $like
747 * description: Apply a `like` filter. Useful for strings only.
748 * $re:
749 * type: string
750 * title: $re
751 * description: Apply a regex filter. Useful for strings only.
752 * $ilike:
753 * type: string
754 * title: $ilike
755 * description: Apply a case-insensitive `like` filter. Useful for strings only.
756 * $fulltext:
757 * type: string
758 * title: $fulltext
759 * description: Filter to apply on full-text properties.
760 * $overlap:
761 * type: array
762 * description: Filter arrays that have overlapping values with this parameter.
763 * items:
764 * type: string
765 * title: $overlap
766 * description: The values to match.
767 * $contains:
768 * type: array
769 * description: Filter arrays that contain some of the values of this parameter.
770 * items:
771 * type: string
772 * title: $contains
773 * description: The values to match.
774 * $contained:
775 * type: array
776 * description: Filter arrays that contain all values of this parameter.
777 * items:
778 * type: string
779 * title: $contained
780 * description: The values to match.
781 * $exists:
782 * type: boolean
783 * title: $exists
784 * description: Filter by whether a value for this parameter exists (not `null`).
785 * title: updated_at
786 * - name: with_deleted
787 * in: query
788 * description: Whether to include deleted records in the result.
789 * required: false
790 * schema:
791 * type: boolean
792 * title: with_deleted
793 * description: Whether to include deleted records in the result.
794 * security:
795 * - api_token: []
796 * - cookie_auth: []
797 * - jwt_token: []
798 * x-codeSamples:
799 * - lang: JavaScript
800 * label: JS SDK
801 * source: |-
802 * import Medusa from "@medusajs/js-sdk"
803 *
804 * export const sdk = new Medusa({
805 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
806 * debug: import.meta.env.DEV,
807 * auth: {
808 * type: "session",
809 * },
810 * })
811 *
812 * sdk.admin.exchange.list()
813 * .then(({ exchanges, count, limit, offset }) => {
814 * console.log(exchanges)
815 * })
816 * - lang: Shell
817 * label: cURL
818 * source: |-
819 * curl '{backend_url}/admin/exchanges' \
820 * -H 'Authorization: Bearer {jwt_token}'
821 * tags:
822 * - Exchanges
823 * responses:
824 * "200":
825 * description: OK
826 * content:
827 * application/json:
828 * schema:
829 * allOf:
830 * - type: object
831 * description: The paginated list of exchanges.
832 * required:
833 * - limit
834 * - offset
835 * - count
836 * properties:
837 * limit:
838 * type: number
839 * title: limit
840 * description: The maximum number of items returned.
841 * offset:
842 * type: number
843 * title: offset
844 * description: The number of items skipped before retrieving the returned items.
845 * count:
846 * type: number
847 * title: count
848 * description: The total number of items.
849 * - type: object
850 * description: The paginated list of exchanges.
851 * required:
852 * - exchanges
853 * properties:
854 * exchanges:
855 * type: array
856 * description: The exchange's exchanges.
857 * items:
858 * $ref: "#/components/schemas/AdminExchange"
859 * "400":
860 * $ref: "#/components/responses/400_error"
861 * "401":
862 * $ref: "#/components/responses/unauthorized"
863 * "404":
864 * $ref: "#/components/responses/not_found_error"
865 * "409":
866 * $ref: "#/components/responses/invalid_state_error"
867 * "422":
868 * $ref: "#/components/responses/invalid_request_error"
869 * "500":
870 * $ref: "#/components/responses/500_error"
871 *
872 */
873