Bug 27947: Add cancellation reason to article request
[koha.git] / api / v1 / swagger / paths / public_patrons.json
1 {
2     "/public/patrons/{patron_id}/password": {
3         "post": {
4             "x-mojo-to": "Patrons::Password#set_public",
5             "operationId": "setPatronPasswordPublic",
6             "tags": [
7                 "patrons"
8             ],
9             "summary": "Set password for a patron (public)",
10             "parameters": [
11                 {
12                     "$ref": "../parameters.json#/patron_id_pp"
13                 },
14                 {
15                     "name": "body",
16                     "in": "body",
17                     "description": "A JSON object containing password information",
18                     "schema": {
19                         "type": "object",
20                         "properties": {
21                             "password": {
22                                 "description": "New password (plain text)",
23                                 "type": "string"
24                             },
25                             "password_repeated": {
26                                 "description": "Repeated new password (plain text)",
27                                 "type": "string"
28                             },
29                             "old_password": {
30                                 "description": "Patron's original password",
31                                 "type": "string"
32                             }
33                         },
34                         "required": [
35                             "password",
36                             "password_repeated",
37                             "old_password"
38                         ],
39                         "additionalProperties": false
40                     }
41                 }
42             ],
43             "produces": [
44                 "application/json"
45             ],
46             "responses": {
47                 "200": {
48                     "description": "Password changed"
49                 },
50                 "400": {
51                     "description": "Bad request",
52                     "schema": {
53                         "$ref": "../definitions.json#/error"
54                     }
55                 },
56                 "401": {
57                     "description": "Authentication required",
58                     "schema": {
59                         "$ref": "../definitions.json#/error"
60                     }
61                 },
62                 "403": {
63                     "description": "Access forbidden",
64                     "schema": {
65                         "$ref": "../definitions.json#/error"
66                     }
67                 },
68                 "404": {
69                     "description": "Patron not found",
70                     "schema": {
71                         "$ref": "../definitions.json#/error"
72                     }
73                 },
74                 "500": {
75                     "description": "Internal server error",
76                     "schema": {
77                         "$ref": "../definitions.json#/error"
78                     }
79                 },
80                 "503": {
81                     "description": "Under maintenance",
82                     "schema": {
83                         "$ref": "../definitions.json#/error"
84                     }
85                 }
86             },
87             "x-koha-authorization": {
88                 "allow-owner": true
89             }
90         }
91     },
92     "/public/patrons/{patron_id}/guarantors/can_see_charges": {
93         "put": {
94             "x-mojo-to": "Patrons#guarantors_can_see_charges",
95             "operationId": "setPatronGuarantorsCanSeeCharges",
96             "tags": [
97                 "patrons"
98             ],
99             "summary": "Set if guarantors can see charges (public)",
100             "parameters": [
101                 {
102                     "$ref": "../parameters.json#/patron_id_pp"
103                 },
104                 {
105                     "name": "body",
106                     "in": "body",
107                     "description": "A boolean representing if guarantors should be able to see the patron's charges",
108                     "required": true,
109                     "schema": {
110                         "type": "object",
111                         "properties": {
112                             "allowed": {
113                                 "type": "boolean"
114                             }
115                         },
116                         "additionalProperties": false
117                     }
118                 }
119             ],
120             "produces": [
121                 "application/json"
122             ],
123             "responses": {
124                 "200": {
125                     "description": "Charges view policy for guarantors changed"
126                 },
127                 "400": {
128                     "description": "Bad request",
129                     "schema": {
130                         "$ref": "../definitions.json#/error"
131                     }
132                 },
133                 "401": {
134                     "description": "Authentication required",
135                     "schema": {
136                         "$ref": "../definitions.json#/error"
137                     }
138                 },
139                 "403": {
140                     "description": "Access forbidden",
141                     "schema": {
142                         "$ref": "../definitions.json#/error"
143                     }
144                 },
145                 "404": {
146                     "description": "Patron not found",
147                     "schema": {
148                         "$ref": "../definitions.json#/error"
149                     }
150                 },
151                 "500": {
152                     "description": "Internal server error",
153                     "schema": {
154                         "$ref": "../definitions.json#/error"
155                     }
156                 },
157                 "503": {
158                     "description": "Under maintenance",
159                     "schema": {
160                         "$ref": "../definitions.json#/error"
161                     }
162                 }
163             },
164             "x-koha-authorization": {
165                 "allow-owner": true
166             }
167         }
168     },
169     "/public/patrons/{patron_id}/guarantors/can_see_checkouts": {
170         "put": {
171             "x-mojo-to": "Patrons#guarantors_can_see_checkouts",
172             "operationId": "setPatronGuarantorsCanSeeCheckouts",
173             "tags": [
174                 "patrons"
175             ],
176             "summary": "Set if guarantors can see checkouts",
177             "parameters": [
178                 {
179                     "$ref": "../parameters.json#/patron_id_pp"
180                 },
181                 {
182                     "name": "body",
183                     "in": "body",
184                     "description": "A boolean representing if guarantors should be able to see the patron's checkouts",
185                     "required": true,
186                     "schema": {
187                         "type": "object",
188                         "properties": {
189                             "allowed": {
190                                 "type": "boolean"
191                             }
192                         },
193                         "additionalProperties": false
194                     }
195                 }
196             ],
197             "produces": [
198                 "application/json"
199             ],
200             "responses": {
201                 "200": {
202                     "description": "Check-out view policy for guarantors changed"
203                 },
204                 "400": {
205                     "description": "Bad request",
206                     "schema": {
207                         "$ref": "../definitions.json#/error"
208                     }
209                 },
210                 "401": {
211                     "description": "Authentication required",
212                     "schema": {
213                         "$ref": "../definitions.json#/error"
214                     }
215                 },
216                 "403": {
217                     "description": "Access forbidden",
218                     "schema": {
219                         "$ref": "../definitions.json#/error"
220                     }
221                 },
222                 "404": {
223                     "description": "Patron not found",
224                     "schema": {
225                         "$ref": "../definitions.json#/error"
226                     }
227                 },
228                 "500": {
229                     "description": "Internal server error",
230                     "schema": {
231                         "$ref": "../definitions.json#/error"
232                     }
233                 },
234                 "503": {
235                     "description": "Under maintenance",
236                     "schema": {
237                         "$ref": "../definitions.json#/error"
238                     }
239                 }
240             },
241             "x-koha-authorization": {
242                 "allow-owner": true
243             }
244         }
245     },
246     "/public/patrons/{patron_id}/article_requests/{ar_id}": {
247         "delete": {
248             "x-mojo-to": "Patrons#cancel_article_request",
249             "operationId": "cancelPatronArticleRequest",
250             "tags": [
251                 "patrons",
252                 "article_requests"
253             ],
254             "summary": "Cancel patron's article requests",
255             "parameters": [
256                 {
257                     "$ref": "../parameters.json#/patron_id_pp"
258                 },
259                 {
260                     "$ref": "../parameters.json#/ar_id_pp"
261                 },
262                 {
263                     "$ref": "../parameters.json#/ar_reason_qp"
264                 },
265                 {
266                     "$ref": "../parameters.json#/ar_notes_qp"
267                 }
268             ],
269             "produces": ["application/json"],
270             "responses": {
271                 "204": {
272                     "description": "Patron's article request canceled"
273                 },
274                 "400": {
275                     "description": "Bad request",
276                     "schema": {
277                         "$ref": "../definitions.json#/error"
278                     }
279                 },
280                 "401": {
281                     "description": "Authentication required",
282                     "schema": {
283                         "$ref": "../definitions.json#/error"
284                     }
285                 },
286                 "403": {
287                     "description": "Access forbidden",
288                     "schema": {
289                         "$ref": "../definitions.json#/error"
290                     }
291                 },
292                 "404": {
293                     "description": "Patron not found",
294                     "schema": {
295                         "$ref": "../definitions.json#/error"
296                     }
297                 },
298                 "500": {
299                     "description": "Internal server error",
300                     "schema": {
301                         "$ref": "../definitions.json#/error"
302                     }
303                 },
304                 "503": {
305                     "description": "Under maintenance",
306                     "schema": {
307                         "$ref": "../definitions.json#/error"
308                     }
309                 }
310             },
311             "x-koha-authorization": {
312                 "allow-owner": true
313             }
314         }
315     }
316 }