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