Bug 29107: Rename item_type => item_type_id
[koha.git] / api / v1 / swagger / paths / items.json
1 {
2   "/items": {
3     "get": {
4       "x-mojo-to": "Items#list",
5       "operationId": "listItems",
6       "tags": [
7         "items"
8       ],
9       "summary": "List items",
10       "parameters": [
11         {
12           "name": "external_id",
13           "in": "query",
14           "description": "Search on the item's barcode",
15           "required": false,
16           "type": "string"
17         },
18         {
19           "$ref": "../parameters.json#/match"
20         },
21         {
22           "$ref": "../parameters.json#/order_by"
23         },
24         {
25           "$ref": "../parameters.json#/page"
26         },
27         {
28           "$ref": "../parameters.json#/per_page"
29         },
30         {
31           "$ref": "../parameters.json#/q_param"
32         },
33         {
34           "$ref": "../parameters.json#/q_body"
35         },
36         {
37           "$ref": "../parameters.json#/q_header"
38         }
39       ],
40       "consumes": [
41         "application/json"
42       ],
43       "produces": [
44         "application/json"
45       ],
46       "responses": {
47         "200": {
48           "description": "A list of item",
49           "schema": {
50             "type": "array",
51             "items": {
52               "$ref": "../definitions.json#/item"
53             }
54           }
55         },
56         "401": {
57           "description": "Authentication required",
58           "schema": {
59             "$ref": "../definitions.json#/error"
60           }
61         },
62         "403": {
63           "description": "Access forbidden",
64           "schema": {
65             "$ref": "../definitions.json#/error"
66           }
67         },
68         "500": {
69           "description": "Internal server error",
70           "schema": {
71             "$ref": "../definitions.json#/error"
72           }
73         },
74         "503": {
75           "description": "Under maintenance",
76           "schema": {
77             "$ref": "../definitions.json#/error"
78           }
79         }
80       },
81       "x-koha-authorization": {
82         "permissions": {
83           "catalogue": "1"
84         }
85       }
86     }
87   },
88   "/items/{item_id}": {
89     "get": {
90       "x-mojo-to": "Items#get",
91       "operationId": "getItem",
92       "tags": ["items"],
93       "summary": "Get item",
94       "parameters": [{
95           "$ref": "../parameters.json#/item_id_pp"
96         }
97       ],
98       "consumes": ["application/json"],
99       "produces": ["application/json"],
100       "responses": {
101         "200": {
102           "description": "An item",
103           "schema": {
104             "$ref": "../definitions.json#/item"
105           }
106         },
107         "400": {
108           "description": "Missing or wrong parameters",
109           "schema": {
110             "$ref": "../definitions.json#/error"
111           }
112         },
113         "404": {
114           "description": "Item 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           "catalogue": "1"
135         }
136       }
137     }
138   },
139   "/items/{item_id}/pickup_locations": {
140     "get": {
141       "x-mojo-to": "Items#pickup_locations",
142       "operationId": "getItemPickupLocations",
143       "summary": "Get valid pickup locations for an item",
144       "tags": ["items"],
145       "parameters": [
146         {
147           "$ref": "../parameters.json#/item_id_pp"
148         },
149         {
150           "name": "patron_id",
151           "in": "query",
152           "description": "Internal patron identifier",
153           "required": true,
154           "type": "integer"
155         },
156         {
157           "$ref": "../parameters.json#/match"
158         },
159         {
160           "$ref": "../parameters.json#/order_by"
161         },
162         {
163           "$ref": "../parameters.json#/page"
164         },
165         {
166           "$ref": "../parameters.json#/per_page"
167         },
168         {
169           "$ref": "../parameters.json#/q_param"
170         },
171         {
172           "$ref": "../parameters.json#/q_body"
173         },
174         {
175           "$ref": "../parameters.json#/q_header"
176         }
177       ],
178       "consumes": [
179         "application/json"
180       ],
181       "produces": [
182         "application/json"
183       ],
184       "responses": {
185         "200": {
186           "description": "Item pickup locations",
187           "schema": {
188             "type": "array",
189             "items": {
190               "$ref": "../definitions.json#/library"
191             }
192           }
193         },
194         "400": {
195           "description": "Missing or wrong parameters",
196           "schema": {
197             "$ref": "../definitions.json#/error"
198           }
199         },
200         "401": {
201           "description": "Authentication required",
202           "schema": {
203             "$ref": "../definitions.json#/error"
204           }
205         },
206         "403": {
207           "description": "Access forbidden",
208           "schema": {
209             "$ref": "../definitions.json#/error"
210           }
211         },
212         "404": {
213           "description": "Biblio not found",
214           "schema": {
215             "$ref": "../definitions.json#/error"
216           }
217         },
218         "500": {
219           "description": "Internal server error",
220           "schema": {
221             "$ref": "../definitions.json#/error"
222           }
223         },
224         "503": {
225           "description": "Under maintenance",
226           "schema": {
227             "$ref": "../definitions.json#/error"
228           }
229         }
230       },
231       "x-koha-authorization": {
232         "permissions": {
233           "reserveforothers": "place_holds"
234         }
235       }
236     }
237   }
238 }