Bug 29593: Fix wrong tag in GET /public/libraries spec
[koha.git] / api / v1 / swagger / paths / acquisitions_orders.json
1 {
2     "/acquisitions/orders": {
3         "get": {
4             "x-mojo-to": "Acquisitions::Orders#list",
5             "operationId": "listOrders",
6             "tags": ["orders"],
7             "summary": "List orders",
8             "produces": [
9                 "application/json"
10             ],
11             "parameters": [
12                 {
13                     "name": "biblio_id",
14                     "in": "query",
15                     "description": "Identifier for a linked bibliographic record",
16                     "required": false,
17                     "type": "integer"
18                 },
19                 {
20                     "name": "basket_id",
21                     "in": "query",
22                     "description": "Identifier for a linked acquisition basket",
23                     "required": false,
24                     "type": "integer"
25                 },
26                 {
27                     "name": "fund_id",
28                     "in": "query",
29                     "description": "Identifier for the fund the order goes against",
30                     "required": false,
31                     "type": "integer"
32                 },
33                 {
34                     "name": "status",
35                     "in": "query",
36                     "description": "Current status for the order. Can be 'new', 'ordered', 'partial', 'complete' or 'cancelled'",
37                     "required": false,
38                     "type": "string"
39                 },
40                 {
41                     "name": "only_active",
42                     "in": "query",
43                     "description": "If only active orders should be listed",
44                     "required": false,
45                     "type": "boolean"
46                 },
47                 {
48                     "$ref": "../parameters.json#/match"
49                 },
50                 {
51                     "$ref": "../parameters.json#/order_by"
52                 },
53                 {
54                     "$ref": "../parameters.json#/page"
55                 },
56                 {
57                     "$ref": "../parameters.json#/per_page"
58                 },
59                 {
60                     "$ref": "../parameters.json#/q_param"
61                 },
62                 {
63                     "$ref": "../parameters.json#/q_body"
64                 },
65                 {
66                     "$ref": "../parameters.json#/q_header"
67                 }
68             ],
69             "responses": {
70                 "200": {
71                     "description": "A list of orders",
72                     "schema": {
73                         "type": "array",
74                         "items": {
75                             "$ref": "../definitions.json#/order"
76                         }
77                     }
78                 },
79                 "401": {
80                     "description": "Authentication required",
81                     "schema": {
82                         "$ref": "../definitions.json#/error"
83                     }
84                 },
85                 "403": {
86                     "description": "Access forbidden",
87                     "schema": {
88                         "$ref": "../definitions.json#/error"
89                     }
90                 },
91                 "404": {
92                     "description": "Order not found",
93                     "schema": {
94                         "$ref": "../definitions.json#/error"
95                     }
96                 },
97                 "500": {
98                     "description": "Internal server error",
99                     "schema": {
100                         "$ref": "../definitions.json#/error"
101                     }
102                 },
103                 "503": {
104                     "description": "Under maintenance",
105                     "schema": {
106                         "$ref": "../definitions.json#/error"
107                     }
108                 }
109             },
110             "x-koha-authorization": {
111                 "permissions": {
112                     "acquisition": [ "order_manage", "order_manage_all" ]
113                 }
114             },
115             "x-koha-embed": [
116                 "basket",
117                 "basket.basket_group",
118                 "basket.creator",
119                 "biblio",
120                 "biblio.active_orders+count",
121                 "biblio.holds+count",
122                 "biblio.items+count",
123                 "biblio.suggestions.suggester",
124                 "fund",
125                 "current_item_level_holds+count",
126                 "invoice",
127                 "items",
128                 "subscription"
129             ]
130         },
131         "post": {
132             "x-mojo-to": "Acquisitions::Orders#add",
133             "operationId": "addOrder",
134             "tags": ["orders"],
135             "summary": "Add order",
136             "parameters": [
137                 {
138                     "name": "body",
139                     "in": "body",
140                     "description": "A JSON object representing an order",
141                     "required": true,
142                     "schema": {
143                         "$ref": "../definitions.json#/order"
144                     }
145                 }
146             ],
147             "produces": [
148                 "application/json"
149             ],
150             "responses": {
151                 "201": {
152                     "description": "Order added",
153                     "schema": {
154                         "$ref": "../definitions.json#/order"
155                     }
156                 },
157                 "400": {
158                     "description": "Bad request",
159                     "schema": {
160                         "$ref": "../definitions.json#/error"
161                     }
162                 },
163                 "401": {
164                     "description": "Authentication required",
165                     "schema": {
166                         "$ref": "../definitions.json#/error"
167                     }
168                 },
169                 "403": {
170                     "description": "Access forbidden",
171                     "schema": {
172                         "$ref": "../definitions.json#/error"
173                     }
174                 },
175                 "409": {
176                     "description": "Conflict in creating the resource",
177                     "schema": {
178                         "$ref": "../definitions.json#/error"
179                     }
180                 },
181                 "500": {
182                     "description": "Internal server error",
183                     "schema": {
184                         "$ref": "../definitions.json#/error"
185                     }
186                 },
187                 "503": {
188                     "description": "Under maintenance",
189                     "schema": {
190                         "$ref": "../definitions.json#/error"
191                     }
192                 }
193             },
194             "x-koha-authorization": {
195                 "permissions": {
196                     "acquisition": "order_manage"
197                 }
198             }
199         }
200     },
201     "/acquisitions/orders/{order_id}": {
202         "get": {
203             "x-mojo-to": "Acquisitions::Orders#get",
204             "operationId": "getOrder",
205             "tags": ["orders"],
206             "summary": "Get order",
207             "parameters": [
208                 {
209                     "$ref": "../parameters.json#/order_id_pp"
210                 }
211             ],
212             "produces": [
213                 "application/json"
214             ],
215             "responses": {
216                 "200": {
217                     "description": "An order",
218                     "schema": {
219                         "$ref": "../definitions.json#/order"
220                     }
221                 },
222                 "401": {
223                     "description": "Authentication required",
224                     "schema": {
225                         "$ref": "../definitions.json#/error"
226                     }
227                 },
228                 "403": {
229                     "description": "Access forbidden",
230                     "schema": {
231                         "$ref": "../definitions.json#/error"
232                     }
233                 },
234                 "404": {
235                     "description": "Order not found",
236                     "schema": {
237                         "$ref": "../definitions.json#/error"
238                     }
239                 },
240                 "500": {
241                     "description": "Internal server error",
242                     "schema": {
243                         "$ref": "../definitions.json#/error"
244                     }
245                 },
246                 "503": {
247                     "description": "Under maintenance",
248                     "schema": {
249                         "$ref": "../definitions.json#/error"
250                     }
251                 }
252             },
253             "x-koha-authorization": {
254                 "permissions": {
255                     "acquisition": "order_manage"
256                 }
257             },
258             "x-koha-embed": [
259                 "basket",
260                 "basket.basket_group",
261                 "basket.creator",
262                 "biblio",
263                 "biblio.active_orders+count",
264                 "biblio.holds+count",
265                 "biblio.items+count",
266                 "biblio.suggestions.suggester",
267                 "fund",
268                 "current_item_level_holds+count",
269                 "invoice",
270                 "items",
271                 "subscription"
272             ]
273         },
274         "put": {
275             "x-mojo-to": "Acquisitions::Orders#update",
276             "operationId": "updateOrder",
277             "tags": ["orders"],
278             "summary": "Update order",
279             "parameters": [
280                 {
281                     "$ref": "../parameters.json#/order_id_pp"
282                 },
283                 {
284                     "name": "body",
285                     "in": "body",
286                     "description": "A JSON object representing an order",
287                     "required": true,
288                     "schema": {
289                         "$ref": "../definitions.json#/order"
290                     }
291                 }
292             ],
293             "produces": [
294                 "application/json"
295             ],
296             "responses": {
297                 "200": {
298                     "description": "An order",
299                     "schema": {
300                         "$ref": "../definitions.json#/order"
301                     }
302                 },
303                 "401": {
304                     "description": "Authentication required",
305                     "schema": {
306                         "$ref": "../definitions.json#/error"
307                     }
308                 },
309                 "403": {
310                     "description": "Access forbidden",
311                     "schema": {
312                         "$ref": "../definitions.json#/error"
313                     }
314                 },
315                 "404": {
316                     "description": "Order not found",
317                     "schema": {
318                         "$ref": "../definitions.json#/error"
319                     }
320                 },
321                 "500": {
322                     "description": "Internal server error",
323                     "schema": {
324                         "$ref": "../definitions.json#/error"
325                     }
326                 },
327                 "503": {
328                     "description": "Under maintenance",
329                     "schema": {
330                         "$ref": "../definitions.json#/error"
331                     }
332                 }
333             },
334             "x-koha-authorization": {
335                 "permissions": {
336                     "acquisition": "order_manage"
337                 }
338             }
339         },
340         "delete": {
341             "x-mojo-to": "Acquisitions::Orders#delete",
342             "operationId": "deleteOrder",
343             "tags": ["orders"],
344             "summary": "Delete order",
345             "parameters": [
346                 {
347                     "$ref": "../parameters.json#/order_id_pp"
348                 }
349             ],
350             "produces": [
351                 "application/json"
352             ],
353             "responses": {
354                 "204": {
355                     "description": "Order deleted"
356                 },
357                 "401": {
358                     "description": "Authentication required",
359                     "schema": {
360                         "$ref": "../definitions.json#/error"
361                     }
362                 },
363                 "403": {
364                     "description": "Access forbidden",
365                     "schema": {
366                         "$ref": "../definitions.json#/error"
367                     }
368                 },
369                 "404": {
370                     "description": "Order not found",
371                     "schema": {
372                         "$ref": "../definitions.json#/error"
373                     }
374                 },
375                 "500": {
376                     "description": "Internal server error",
377                     "schema": {
378                         "$ref": "../definitions.json#/error"
379                     }
380                 },
381                 "503": {
382                     "description": "Under maintenance",
383                     "schema": {
384                         "$ref": "../definitions.json#/error"
385                     }
386                 }
387             },
388             "x-koha-authorization": {
389                 "permissions": {
390                     "acquisition": "order_manage"
391                 }
392             }
393         }
394     }
395 }