Files
medusa-store/docs/api/admin/paths/reservations_{id}.yaml
2023-02-09 09:50:55 +02:00

153 lines
4.2 KiB
YAML

delete:
operationId: DeleteReservationsReservation
summary: Delete a Reservation
description: Deletes a Reservation.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Reservation to delete.
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/reservations_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/reservations_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Reservation
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The ID of the deleted Reservation.
object:
type: string
description: The type of the object that was deleted.
default: reservation
deleted:
type: boolean
description: Whether or not the Reservation was deleted.
default: true
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
get:
operationId: GetReservationsReservation
summary: Get a Reservation
description: Retrieves a single reservation using its id
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the reservation to retrieve.
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/reservations_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/reservations_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Reservation
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostReservationsReq.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostReservationsReservation
summary: Updates a Reservation
description: Updates a Reservation which can be associated with any resource as required.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Reservation to update.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostReservationsReservationReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/reservations_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/reservations_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Reservation
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostReservationsReq.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml