Bug 29620: Move the OpenAPI spec to YAML format
[koha.git] / api / v1 / swagger / paths / checkouts.yaml
1 ---
2 /checkouts:
3   get:
4     x-mojo-to: Checkouts#list
5     operationId: listCheckouts
6     tags:
7       - checkouts
8     summary: List checkouts
9     parameters:
10       - $ref: ../parameters.yaml#/patron_id_qp
11       - $ref: ../parameters.yaml#/page
12       - $ref: ../parameters.yaml#/per_page
13       - $ref: ../parameters.yaml#/match
14       - $ref: ../parameters.yaml#/order_by
15       - $ref: ../parameters.yaml#/q_param
16       - $ref: ../parameters.yaml#/q_body
17       - $ref: ../parameters.yaml#/q_header
18       - name: checked_in
19         in: query
20         description: By default, current checkouts are returned, when this is true then
21           checked in checkouts are returned as result.
22         type: boolean
23     produces:
24       - application/json
25     responses:
26       "200":
27         description: A list of checkouts
28         schema:
29           $ref: ../definitions.yaml#/checkouts
30       "403":
31         description: Access forbidden
32         schema:
33           $ref: ../definitions.yaml#/error
34       "404":
35         description: Patron not found
36         schema:
37           $ref: ../definitions.yaml#/error
38     x-koha-authorization:
39       permissions:
40         circulate: circulate_remaining_permissions
41     x-koha-embed:
42       - issuer
43 "/checkouts/{checkout_id}":
44   get:
45     x-mojo-to: Checkouts#get
46     operationId: getCheckout
47     tags:
48       - checkouts
49     summary: Get checkout
50     parameters:
51       - $ref: ../parameters.yaml#/checkout_id_pp
52     produces:
53       - application/json
54     responses:
55       "200":
56         description: Updated borrower's checkout
57         schema:
58           $ref: ../definitions.yaml#/checkout
59       "403":
60         description: Access forbidden
61         schema:
62           $ref: ../definitions.yaml#/error
63       "404":
64         description: Checkout not found
65         schema:
66           $ref: ../definitions.yaml#/error
67     x-koha-authorization:
68       permissions:
69         circulate: circulate_remaining_permissions
70     x-koha-embed:
71       - issuer
72 "/checkouts/{checkout_id}/renewal":
73   post:
74     x-mojo-to: Checkouts#renew
75     operationId: renewCheckout
76     tags:
77       - checkouts
78     summary: Renew a checkout
79     parameters:
80       - $ref: ../parameters.yaml#/checkout_id_pp
81       - $ref: ../parameters.yaml#/seen_pp
82     produces:
83       - application/json
84     responses:
85       "201":
86         description: Updated borrower's checkout
87         schema:
88           $ref: ../definitions.yaml#/checkout
89       "403":
90         description: Cannot renew checkout
91         schema:
92           $ref: ../definitions.yaml#/error
93       "404":
94         description: Checkout not found
95         schema:
96           $ref: ../definitions.yaml#/error
97     x-koha-authorization:
98       permissions:
99         circulate: circulate_remaining_permissions
100 "/checkouts/{checkout_id}/allows_renewal":
101   get:
102     x-mojo-to: Checkouts#allows_renewal
103     operationId: allows_renewalCheckout
104     tags:
105       - checkouts
106     summary: Get renewability for a checkout
107     parameters:
108       - $ref: ../parameters.yaml#/checkout_id_pp
109     produces:
110       - application/json
111     responses:
112       "200":
113         description: Checkout renewability information
114         schema:
115           $ref: ../definitions.yaml#/allows_renewal
116       "403":
117         description: Forbidden
118         schema:
119           $ref: ../definitions.yaml#/error
120       "404":
121         description: Checkout not found
122         schema:
123           $ref: ../definitions.yaml#/error
124     x-koha-authorization:
125       permissions:
126         circulate: circulate_remaining_permissions