Bug 13799: Reword 'borrower' to 'patron'
[koha.git] / api / v1 / swagger.json
1 {
2   "swagger": "2.0",
3   "info": {
4     "title": "Koha REST API",
5     "version": "1",
6     "license": {
7       "name": "GPL v3",
8       "url": "http://www.gnu.org/licenses/gpl.txt"
9     },
10     "contact": {
11       "name": "Koha Team",
12       "url": "http://koha-community.org/"
13     }
14   },
15   "basePath": "/api/v1",
16   "paths": {
17     "/patrons": {
18       "get": {
19         "x-mojo-controller": "Koha::REST::V1::Patrons",
20         "operationId": "listPatrons",
21         "tags": ["patrons"],
22         "produces": [
23           "application/json"
24         ],
25         "responses": {
26           "200": {
27             "description": "A list of patrons",
28             "schema": {
29               "type": "array",
30               "items": {
31                 "$ref": "#/definitions/patron"
32               }
33             }
34           },
35           "403": {
36             "description": "Access forbidden",
37             "schema": {
38               "$ref": "#/definitions/error"
39             }
40           }
41         }
42       }
43     },
44     "/patrons/{borrowernumber}": {
45       "get": {
46         "x-mojo-controller": "Koha::REST::V1::Patrons",
47         "operationId": "getPatron",
48         "tags": ["patrons"],
49         "parameters": [
50           {
51             "$ref": "#/parameters/borrowernumberPathParam"
52           }
53         ],
54         "produces": [
55           "application/json"
56         ],
57         "responses": {
58           "200": {
59             "description": "A patron",
60             "schema": {
61               "$ref": "#/definitions/patron"
62             }
63           },
64           "403": {
65             "description": "Access forbidden",
66             "schema": {
67               "$ref": "#/definitions/error"
68             }
69           },
70           "404": {
71             "description": "Patron not found",
72             "schema": {
73               "$ref": "#/definitions/error"
74             }
75           }
76         }
77       }
78     }
79   },
80   "definitions": {
81     "patron": {
82       "type": "object",
83       "properties": {
84         "borrowernumber": {
85           "$ref": "#/definitions/borrowernumber"
86         },
87         "cardnumber": {
88           "description": "library assigned ID number for patrons"
89         },
90         "surname": {
91           "description": "patron's last name"
92         },
93         "firstname": {
94           "description": "patron's first name"
95         },
96         "title": {
97           "description": "patron's title"
98         },
99         "othernames": {
100           "description": "any other names associated with the patron"
101         },
102         "initials": {
103           "description": "initials of the patron"
104         },
105         "streetnumber": {
106           "description": "street number of patron's primary address"
107         },
108         "streettype": {
109           "description": "street type of patron's primary address"
110         },
111         "address": {
112           "description": "first address line of patron's primary address"
113         },
114         "address2": {
115           "description": "second address line of patron's primary address"
116         },
117         "city": {
118           "description": "city or town of patron's primary address"
119         },
120         "state": {
121           "description": "state or province of patron's primary address"
122         },
123         "zipcode": {
124           "description": "zip or postal code of patron's primary address"
125         },
126         "country": {
127           "description": "country of patron's primary address"
128         },
129         "email": {
130           "description": "primary email address for patron's primary address"
131         },
132         "phone": {
133           "description": "primary phone number for patron's primary address"
134         },
135         "mobile": {
136           "description": "the other phone number for patron's primary address"
137         },
138         "fax": {
139           "description": "fax number for patron's primary address"
140         },
141         "emailpro": {
142           "description": "secondary email address for patron's primary address"
143         },
144         "phonepro": {
145           "description": "secondary phone number for patron's primary address"
146         },
147         "B_streetnumber": {
148           "description": "street number of patron's alternate address"
149         },
150         "B_streettype": {
151           "description": "street type of patron's alternate address"
152         },
153         "B_address": {
154           "description": "first address line of patron's alternate address"
155         },
156         "B_address2": {
157           "description": "second address line of patron's alternate address"
158         },
159         "B_city": {
160           "description": "city or town of patron's alternate address"
161         },
162         "B_state": {
163           "description": "state or province of patron's alternate address"
164         },
165         "B_zipcode": {
166           "description": "zip or postal code of patron's alternate address"
167         },
168         "B_country": {
169           "description": "country of patron's alternate address"
170         },
171         "B_email": {
172           "description": "email address for patron's alternate address"
173         },
174         "B_phone": {
175           "description": "phone number for patron's alternate address"
176         },
177         "dateofbirth": {
178           "description": "patron's date of birth"
179         },
180         "branchcode": {
181           "description": "code of patron's home branch"
182         },
183         "categorycode": {
184           "description": "code of patron's category"
185         },
186         "dateenrolled": {
187           "description": "date the patron was added to Koha"
188         },
189         "dateexpiry": {
190           "description": "date the patron's card is set to expire"
191         },
192         "gonenoaddress": {
193           "description": "set to 1 if library marked this patron as having an unconfirmed address"
194         },
195         "lost": {
196           "description": "set to 1 if library marked this patron as having lost his card"
197         },
198         "debarred": {
199           "description": "until this date the patron can only check-in"
200         },
201         "debarredcomment": {
202           "description": "comment on the stop of the patron"
203         },
204         "contactname": {
205           "description": "used for children and professionals to include surname or last name of guarantor or organization name"
206         },
207         "contactfirstname": {
208           "description": "used for children to include first name of guarantor"
209         },
210         "contacttitle": {
211           "description": "used for children to include title of guarantor"
212         },
213         "guarantorid": {
214           "description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
215         },
216         "borrowernotes": {
217           "description": "a note on the patron's account"
218         },
219         "relationship": {
220           "description": "used for children to include the relationship to their guarantor"
221         },
222         "ethnicity": {
223           "description": "unused"
224         },
225         "ethnotes": {
226           "description": "unused"
227         },
228         "sex": {
229           "description": "patron's gender"
230         },
231         "password": {
232           "description": "patron's encrypted password"
233         },
234         "flags": {
235           "description": "a number associated with the patron's permissions"
236         },
237         "userid": {
238           "description": "patron's login"
239         },
240         "opacnote": {
241           "description": "a note on the patron's account visible in OPAC and staff client"
242         },
243         "contactnote": {
244           "description": "a note related to patron's alternate address"
245         },
246         "sort1": {
247           "description": "a field that can be used for any information unique to the library"
248         },
249         "sort2": {
250           "description": "a field that can be used for any information unique to the library"
251         },
252         "altcontactfirstname": {
253           "description": "first name of alternate contact for the patron"
254         },
255         "altcontactsurname": {
256           "description": "surname or last name of the alternate contact for the patron"
257         },
258         "altcontactaddress1": {
259           "description": "the first address line for the alternate contact for the patron"
260         },
261         "altcontactaddress2": {
262           "description": "the second address line for the alternate contact for the patron"
263         },
264         "altcontactaddress3": {
265           "description": "the city for the alternate contact for the patron"
266         },
267         "altcontactstate": {
268           "description": "the state for the alternate contact for the patron"
269         },
270         "altcontactzipcode": {
271           "description": "the zipcode for the alternate contact for the patron"
272         },
273         "altcontactcountry": {
274           "description": "the country for the alternate contact for the patron"
275         },
276         "altcontactphone": {
277           "description": "the phone number for the alternate contact for the patron"
278         },
279         "smsalertnumber": {
280           "description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
281         },
282         "privacy": {
283           "description": "patron's privacy settings related to their reading history"
284         }
285       }
286     },
287     "borrowernumber": {
288       "description": "Patron internal identifier"
289     },
290     "error": {
291       "type": "object",
292       "properties": {
293         "error": {
294           "description": "Error message",
295           "type": "string"
296         }
297       }
298     }
299   },
300   "parameters": {
301     "borrowernumberPathParam": {
302       "name": "borrowernumber",
303       "in": "path",
304       "description": "Internal patron identifier",
305       "required": true,
306       "type": "integer"
307     }
308   }
309 }