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