Bug 36481: Add GET /libraries/:library_id/cash_registers
[koha.git] / api / v1 / swagger / paths / libraries.yaml
1 ---
2 /libraries:
3   get:
4     x-mojo-to: Libraries#list
5     operationId: listLibraries
6     tags:
7       - libraries
8     summary: List libraries
9     parameters:
10       - name: name
11         in: query
12         description: Case insensitive 'starts-with' search on name
13         required: false
14         type: string
15       - name: address1
16         in: query
17         description: Case insensitive 'starts-with' search on address1
18         required: false
19         type: string
20       - name: address2
21         in: query
22         description: Case insensitive 'starts-with' search on address2
23         required: false
24         type: string
25       - name: address3
26         in: query
27         description: Case insensitive 'starts-with' search on address3
28         required: false
29         type: string
30       - name: postal_code
31         in: query
32         description: Case insensitive 'starts-with' search on postal code
33         required: false
34         type: string
35       - name: city
36         in: query
37         description: Case insensitive 'starts-with' search on city
38         required: false
39         type: string
40       - name: state
41         in: query
42         description: Case insensitive 'starts-with' search on state
43         required: false
44         type: string
45       - name: country
46         in: query
47         description: Case insensitive 'starts_with' search on country
48         required: false
49         type: string
50       - name: phone
51         in: query
52         description: Case insensitive 'starts_with' search on phone number
53         required: false
54         type: string
55       - name: fax
56         in: query
57         description: Case insensitive 'starts_with' search on fax number
58         required: false
59         type: string
60       - name: email
61         in: query
62         description: Case insensitive 'starts_with' search on email address
63         required: false
64         type: string
65       - name: reply_to_email
66         in: query
67         description: Case insensitive 'starts_with' search on Reply-To email address
68         required: false
69         type: string
70       - name: return_path_email
71         in: query
72         description: Case insensitive 'starts_with' search on Return-Path email address
73         required: false
74         type: string
75       - name: url
76         in: query
77         description: Case insensitive 'starts_with' search on website URL
78         required: false
79         type: string
80       - name: ip
81         in: query
82         description: Case insensitive 'starts_with' search on IP address
83         required: false
84         type: string
85       - name: notes
86         in: query
87         description: Case insensitive 'starts_with' search on notes
88         required: false
89         type: string
90       - $ref: "../swagger.yaml#/parameters/match"
91       - $ref: "../swagger.yaml#/parameters/order_by"
92       - $ref: "../swagger.yaml#/parameters/page"
93       - $ref: "../swagger.yaml#/parameters/per_page"
94       - $ref: "../swagger.yaml#/parameters/q_param"
95       - $ref: "../swagger.yaml#/parameters/q_body"
96       - $ref: "../swagger.yaml#/parameters/request_id_header"
97       - name: x-koha-embed
98         in: header
99         required: false
100         description: Embed list sent as a request header
101         type: array
102         items:
103           type: string
104           enum:
105             - smtp_server
106         collectionFormat: csv
107     produces:
108       - application/json
109     responses:
110       "200":
111         description: A list of libraries
112         schema:
113           type: array
114           items:
115             $ref: "../swagger.yaml#/definitions/library"
116       "500":
117         description: |
118           Internal server error. Possible `error_code` attribute values:
119
120           * `internal_server_error`
121         schema:
122           $ref: "../swagger.yaml#/definitions/error"
123       "503":
124         description: Under maintenance
125         schema:
126           $ref: "../swagger.yaml#/definitions/error"
127     x-koha-authorization:
128       permissions:
129         catalogue: "1"
130   post:
131     x-mojo-to: Libraries#add
132     operationId: addLibrary
133     tags:
134       - libraries
135     summary: Add library
136     parameters:
137       - name: body
138         in: body
139         description: A JSON object containing informations about the new library
140         required: true
141         schema:
142           $ref: "../swagger.yaml#/definitions/library"
143     produces:
144       - application/json
145     responses:
146       "201":
147         description: Library added
148         schema:
149           $ref: "../swagger.yaml#/definitions/library"
150       "400":
151         description: Bad request
152         schema:
153           $ref: "../swagger.yaml#/definitions/error"
154       "401":
155         description: Authentication required
156         schema:
157           $ref: "../swagger.yaml#/definitions/error"
158       "403":
159         description: Access forbidden
160         schema:
161           $ref: "../swagger.yaml#/definitions/error"
162       "409":
163         description: Conflict in creating resource
164         schema:
165           $ref: "../swagger.yaml#/definitions/error"
166       "500":
167         description: |
168           Internal server error. Possible `error_code` attribute values:
169
170           * `internal_server_error`
171         schema:
172           $ref: "../swagger.yaml#/definitions/error"
173       "503":
174         description: Under maintenance
175         schema:
176           $ref: "../swagger.yaml#/definitions/error"
177     x-koha-authorization:
178       permissions:
179         parameters: manage_libraries
180 "/libraries/{library_id}":
181   get:
182     x-mojo-to: Libraries#get
183     operationId: getLibrary
184     tags:
185       - libraries
186     summary: Get library
187     parameters:
188       - $ref: "../swagger.yaml#/parameters/library_id_pp"
189       - name: x-koha-embed
190         in: header
191         required: false
192         description: Embed list sent as a request header
193         type: array
194         items:
195           type: string
196           enum:
197             - smtp_server
198         collectionFormat: csv
199     produces:
200       - application/json
201     responses:
202       "200":
203         description: A library
204         schema:
205           $ref: "../swagger.yaml#/definitions/library"
206       "404":
207         description: Library not found
208         schema:
209           $ref: "../swagger.yaml#/definitions/error"
210     x-koha-authorization:
211       permissions:
212         catalogue: "1"
213   put:
214     x-mojo-to: Libraries#update
215     operationId: updateLibrary
216     tags:
217       - libraries
218     summary: Update library
219     parameters:
220       - $ref: "../swagger.yaml#/parameters/library_id_pp"
221       - name: body
222         in: body
223         description: A JSON object containing information on the library
224         required: true
225         schema:
226           $ref: "../swagger.yaml#/definitions/library"
227     consumes:
228       - application/json
229     produces:
230       - application/json
231     responses:
232       "200":
233         description: A library
234         schema:
235           $ref: "../swagger.yaml#/definitions/library"
236       "400":
237         description: Bad request
238         schema:
239           $ref: "../swagger.yaml#/definitions/error"
240       "401":
241         description: Authentication required
242         schema:
243           $ref: "../swagger.yaml#/definitions/error"
244       "403":
245         description: Access forbidden
246         schema:
247           $ref: "../swagger.yaml#/definitions/error"
248       "404":
249         description: Library not found
250         schema:
251           $ref: "../swagger.yaml#/definitions/error"
252       "500":
253         description: |
254           Internal server error. Possible `error_code` attribute values:
255
256           * `internal_server_error`
257         schema:
258           $ref: "../swagger.yaml#/definitions/error"
259       "503":
260         description: Under maintenance
261         schema:
262           $ref: "../swagger.yaml#/definitions/error"
263     x-koha-authorization:
264       permissions:
265         parameters: manage_libraries
266   delete:
267     x-mojo-to: Libraries#delete
268     operationId: deleteLibrary
269     tags:
270       - libraries
271     summary: Delete library
272     parameters:
273       - $ref: "../swagger.yaml#/parameters/library_id_pp"
274     produces:
275       - application/json
276     responses:
277       "204":
278         description: Library deleted
279         schema:
280           type: string
281       "401":
282         description: Authentication required
283         schema:
284           $ref: "../swagger.yaml#/definitions/error"
285       "403":
286         description: Access forbidden
287         schema:
288           $ref: "../swagger.yaml#/definitions/error"
289       "404":
290         description: Library not found
291         schema:
292           $ref: "../swagger.yaml#/definitions/error"
293       "500":
294         description: |
295           Internal server error. Possible `error_code` attribute values:
296
297           * `internal_server_error`
298         schema:
299           $ref: "../swagger.yaml#/definitions/error"
300       "503":
301         description: Under maintenance
302         schema:
303           $ref: "../swagger.yaml#/definitions/error"
304     x-koha-authorization:
305       permissions:
306         parameters: manage_libraries
307 "/libraries/{library_id}/desks":
308   get:
309     x-mojo-to: Libraries#list_desks
310     operationId: listLibraryDesks
311     tags:
312       - desks
313     summary: List the library's desks
314     parameters:
315       - $ref: "../swagger.yaml#/parameters/match"
316       - $ref: "../swagger.yaml#/parameters/order_by"
317       - $ref: "../swagger.yaml#/parameters/page"
318       - $ref: "../swagger.yaml#/parameters/per_page"
319       - $ref: "../swagger.yaml#/parameters/q_param"
320       - $ref: "../swagger.yaml#/parameters/q_body"
321       - $ref: "../swagger.yaml#/parameters/request_id_header"
322     produces:
323       - application/json
324     responses:
325       200:
326         description: A list of desks for the library
327         schema:
328           type: array
329           items:
330             $ref: "../swagger.yaml#/definitions/desk"
331       404:
332         description: Resource not found
333         schema:
334           $ref: "../swagger.yaml#/definitions/error"
335       500:
336         description: |
337           Internal server error. Possible `error_code` attribute values:
338
339           * `internal_server_error`
340         schema:
341           $ref: "../swagger.yaml#/definitions/error"
342       503:
343         description: Under maintenance
344         schema:
345           $ref: "../swagger.yaml#/definitions/error"
346     x-koha-authorization:
347       permissions:
348         catalogue: 1
349 "/libraries/{library_id}/cash_registers":
350   get:
351     x-mojo-to: Libraries#list_cash_registers
352     operationId: listLibraryCashRegisters
353     tags:
354       - cash_registers
355     summary: List the library's cash registers
356     parameters:
357       - $ref: "../swagger.yaml#/parameters/match"
358       - $ref: "../swagger.yaml#/parameters/order_by"
359       - $ref: "../swagger.yaml#/parameters/page"
360       - $ref: "../swagger.yaml#/parameters/per_page"
361       - $ref: "../swagger.yaml#/parameters/q_param"
362       - $ref: "../swagger.yaml#/parameters/q_body"
363       - $ref: "../swagger.yaml#/parameters/request_id_header"
364     produces:
365       - application/json
366     responses:
367       200:
368         description: A list of desks for the library
369         schema:
370           type: array
371           items:
372             $ref: "../swagger.yaml#/definitions/cash_register"
373       404:
374         description: Resource not found
375         schema:
376           $ref: "../swagger.yaml#/definitions/error"
377       500:
378         description: |
379           Internal server error. Possible `error_code` attribute values:
380
381           * `internal_server_error`
382         schema:
383           $ref: "../swagger.yaml#/definitions/error"
384       503:
385         description: Under maintenance
386         schema:
387           $ref: "../swagger.yaml#/definitions/error"
388     x-koha-authorization:
389       permissions:
390         catalogue: 1
391 /public/libraries:
392   get:
393     x-mojo-to: Libraries#list
394     operationId: listLibrariesPublic
395     tags:
396       - libraries
397     summary: List libraries
398     parameters:
399       - $ref: "../swagger.yaml#/parameters/match"
400       - $ref: "../swagger.yaml#/parameters/order_by"
401       - $ref: "../swagger.yaml#/parameters/page"
402       - $ref: "../swagger.yaml#/parameters/per_page"
403       - $ref: "../swagger.yaml#/parameters/q_param"
404       - $ref: "../swagger.yaml#/parameters/q_body"
405       - $ref: "../swagger.yaml#/parameters/request_id_header"
406     produces:
407       - application/json
408     responses:
409       "200":
410         description: A list of libraries
411         schema:
412           type: array
413           items:
414             $ref: "../swagger.yaml#/definitions/library"
415       "500":
416         description: |
417           Internal server error. Possible `error_code` attribute values:
418
419           * `internal_server_error`
420         schema:
421           $ref: "../swagger.yaml#/definitions/error"
422       "503":
423         description: Under maintenance
424         schema:
425           $ref: "../swagger.yaml#/definitions/error"
426 "/public/libraries/{library_id}":
427   get:
428     x-mojo-to: Libraries#get
429     operationId: getLibraryPublic
430     tags:
431       - libraries
432     summary: Get library (public)
433     parameters:
434       - $ref: "../swagger.yaml#/parameters/library_id_pp"
435     produces:
436       - application/json
437     responses:
438       "200":
439         description: A library
440       "401":
441         description: Authentication required
442         schema:
443           $ref: "../swagger.yaml#/definitions/error"
444       "403":
445         description: Access forbidden
446         schema:
447           $ref: "../swagger.yaml#/definitions/error"
448       "404":
449         description: Library not found
450         schema:
451           $ref: "../swagger.yaml#/definitions/error"
452       "406":
453         description: Not acceptable
454         schema:
455           type: array
456           description: Accepted content-types
457           items:
458             type: string
459       "500":
460         description: |
461           Internal server error. Possible `error_code` attribute values:
462
463           * `internal_server_error`
464         schema:
465           $ref: "../swagger.yaml#/definitions/error"
466       "503":
467         description: Under maintenance
468         schema:
469           $ref: "../swagger.yaml#/definitions/error"