2e1eb88107ce409b9cb65c5367881d411a633e26
[koha.git] / api / v1 / swagger / paths / acquisitions_vendors.json
1 {
2   "/acquisitions/vendors": {
3     "get": {
4       "x-mojo-to": "Acquisitions::Vendors#list",
5       "operationId": "listVendors",
6       "tags": ["acquisitions","vendors"],
7       "produces": [
8         "application/json"
9       ],
10       "parameters": [{
11         "name": "name",
12         "in": "query",
13         "description": "Case insensitive search on vendor name",
14         "required": false,
15         "type": "string"
16       }, {
17         "name": "accountnumber",
18         "in": "query",
19         "description": "Case insensitive search on vendor's account number",
20         "required": false,
21         "type": "string"
22       }, {
23         "$ref": "../parameters.json#/match"
24       }, {
25         "$ref": "../parameters.json#/order_by"
26       }, {
27         "$ref": "../parameters.json#/page"
28       }, {
29         "$ref": "../parameters.json#/per_page"
30       }],
31       "responses": {
32         "200": {
33           "description": "A list of vendors",
34           "schema": {
35             "type": "array",
36             "items": {
37               "$ref": "../definitions.json#/vendor"
38             }
39           }
40         },
41         "401": {
42           "description": "Authentication required",
43           "schema": {
44             "$ref": "../definitions.json#/error"
45           }
46         },
47         "403": {
48           "description": "Access forbidden",
49           "schema": {
50             "$ref": "../definitions.json#/error"
51           }
52         },
53         "404": {
54           "description": "Vendor not found",
55           "schema": {
56             "$ref": "../definitions.json#/error"
57           }
58         },
59         "500": {
60           "description": "Internal server error",
61           "schema": {
62             "$ref": "../definitions.json#/error"
63           }
64         },
65         "503": {
66           "description": "Under maintenance",
67           "schema": {
68             "$ref": "../definitions.json#/error"
69           }
70         }
71       },
72       "x-koha-authorization": {
73         "permissions": {
74           "acquisition": "vendors_manage"
75         }
76       }
77     },
78     "post": {
79       "x-mojo-to": "Acquisitions::Vendors#add",
80       "operationId": "addVendor",
81       "tags": ["acquisitions","vendors"],
82       "parameters": [{
83         "name": "body",
84         "in": "body",
85         "description": "A JSON object representing a vendor",
86         "required": true,
87         "schema": {
88           "$ref": "../definitions.json#/vendor"
89         }
90       }],
91       "produces": [
92         "application/json"
93       ],
94       "responses": {
95         "201": {
96           "description": "Vendor added",
97           "schema": {
98             "$ref": "../definitions.json#/vendor"
99           }
100         },
101         "401": {
102           "description": "Authentication required",
103           "schema": {
104             "$ref": "../definitions.json#/error"
105           }
106         },
107         "403": {
108           "description": "Access forbidden",
109           "schema": {
110             "$ref": "../definitions.json#/error"
111           }
112         },
113         "404": {
114           "description": "Vendor not found",
115           "schema": {
116             "$ref": "../definitions.json#/error"
117           }
118         },
119         "500": {
120           "description": "Internal server error",
121           "schema": {
122             "$ref": "../definitions.json#/error"
123           }
124         },
125         "503": {
126           "description": "Under maintenance",
127           "schema": {
128             "$ref": "../definitions.json#/error"
129           }
130         }
131       },
132       "x-koha-authorization": {
133         "permissions": {
134           "acquisition": "vendors_manage"
135         }
136       }
137     }
138   },
139   "/acquisitions/vendors/{vendor_id}": {
140     "get": {
141       "x-mojo-to": "Acquisitions::Vendors#get",
142       "operationId": "getVendor",
143       "tags": ["acquisitions","vendors"],
144       "parameters": [{
145         "$ref": "../parameters.json#/vendoridPathParam"
146       }],
147       "produces": [
148         "application/json"
149       ],
150       "responses": {
151         "200": {
152           "description": "A vendor",
153           "schema": {
154             "$ref": "../definitions.json#/vendor"
155           }
156         },
157         "401": {
158           "description": "Authentication required",
159           "schema": {
160             "$ref": "../definitions.json#/error"
161           }
162         },
163         "403": {
164           "description": "Access forbidden",
165           "schema": {
166             "$ref": "../definitions.json#/error"
167           }
168         },
169         "404": {
170           "description": "Vendor not found",
171           "schema": {
172             "$ref": "../definitions.json#/error"
173           }
174         },
175         "500": {
176           "description": "Internal server error",
177           "schema": {
178             "$ref": "../definitions.json#/error"
179           }
180         },
181         "503": {
182           "description": "Under maintenance",
183           "schema": {
184             "$ref": "../definitions.json#/error"
185           }
186         }
187       },
188       "x-koha-authorization": {
189         "permissions": {
190           "acquisition": "vendors_manage"
191         }
192       }
193     },
194     "put": {
195       "x-mojo-to": "Acquisitions::Vendors#update",
196       "operationId": "updateVendor",
197       "tags": ["acquisitions","vendors"],
198       "parameters": [{
199         "$ref": "../parameters.json#/vendoridPathParam"
200       }, {
201         "name": "body",
202         "in": "body",
203         "description": "A JSON object representing a vendor",
204         "required": true,
205         "schema": {
206           "$ref": "../definitions.json#/vendor"
207         }
208       }],
209       "produces": [
210         "application/json"
211       ],
212       "responses": {
213         "200": {
214           "description": "A vendor",
215           "schema": {
216             "$ref": "../definitions.json#/vendor"
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": "Vendor 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": "vendors_manage"
253         }
254       }
255     },
256     "delete": {
257       "x-mojo-to": "Acquisitions::Vendors#delete",
258       "operationId": "deleteVendor",
259       "tags": ["acquisitions","vendors"],
260       "parameters": [{
261         "$ref": "../parameters.json#/vendoridPathParam"
262       }],
263       "produces": [
264         "application/json"
265       ],
266       "responses": {
267         "204": {
268           "description": "Vendor deleted"
269         },
270         "401": {
271           "description": "Authentication required",
272           "schema": {
273             "$ref": "../definitions.json#/error"
274           }
275         },
276         "403": {
277           "description": "Access forbidden",
278           "schema": {
279             "$ref": "../definitions.json#/error"
280           }
281         },
282         "404": {
283           "description": "Vendor not found",
284           "schema": {
285             "$ref": "../definitions.json#/error"
286           }
287         },
288         "500": {
289           "description": "Internal server error",
290           "schema": {
291             "$ref": "../definitions.json#/error"
292           }
293         },
294         "503": {
295           "description": "Under maintenance",
296           "schema": {
297             "$ref": "../definitions.json#/error"
298           }
299         }
300       },
301       "x-koha-authorization": {
302         "permissions": {
303           "acquisition": "vendors_manage"
304         }
305       }
306     }
307   }
308 }