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