1 /**
2 * @oas [delete] /admin/reservations/{id}
3 * operationId: DeleteReservationsId
4 * summary: Delete a Reservation
5 * description: Delete a reservation.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The reservation's ID.
11 * required: true
12 * schema:
13 * type: string
14 * security:
15 * - api_token: []
16 * - cookie_auth: []
17 * - jwt_token: []
18 * x-codeSamples:
19 * - lang: JavaScript
20 * label: JS SDK
21 * source: |-
22 * import Medusa from "@medusajs/js-sdk"
23 *
24 * export const sdk = new Medusa({
25 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
26 * debug: import.meta.env.DEV,
27 * auth: {
28 * type: "session",
29 * },
30 * })
31 *
32 * sdk.admin.reservation.delete("res_123")
33 * .then(({ deleted }) => {
34 * console.log(deleted)
35 * })
36 * - lang: Shell
37 * label: cURL
38 * source: |-
39 * curl -X DELETE '{backend_url}/admin/reservations/{id}' \
40 * -H 'Authorization: Bearer {jwt_token}'
41 * tags:
42 * - Reservations
43 * responses:
44 * "200":
45 * description: OK
46 * content:
47 * application/json:
48 * schema:
49 * type: object
50 * description: The deletion's details.
51 * required:
52 * - id
53 * - object
54 * - deleted
55 * properties:
56 * id:
57 * type: string
58 * title: id
59 * description: The reservation's ID.
60 * object:
61 * type: string
62 * title: object
63 * description: The name of the deleted object.
64 * default: reservation
65 * deleted:
66 * type: boolean
67 * title: deleted
68 * description: Whether the reservation was deleted.
69 * "400":
70 * $ref: "#/components/responses/400_error"
71 * "401":
72 * $ref: "#/components/responses/unauthorized"
73 * "404":
74 * $ref: "#/components/responses/not_found_error"
75 * "409":
76 * $ref: "#/components/responses/invalid_state_error"
77 * "422":
78 * $ref: "#/components/responses/invalid_request_error"
79 * "500":
80 * $ref: "#/components/responses/500_error"
81 * x-workflow: deleteReservationsWorkflow
82 * x-events:
83 * - name: reservation-item.deleted
84 * payload: |-
85 * ```ts
86 * {
87 * id, // The ID of the reservation
88 * order_id, // (optional) The ID of the order, if the reservation was deleted by an order flow
89 * }
90 * ```
91 * description: Emitted when reservations are deleted.
92 * deprecated: false
93 * since: 2.18.0
94 *
95 */
96