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