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