Bug 23607: Make /patrons/:patron_id/account staff only
[koha.git] / api / v1 / swagger / paths / patrons_account.json
1 {
2   "/patrons/{patron_id}/account": {
3     "get": {
4       "x-mojo-to": "Patrons::Account#get",
5       "operationId": "getPatronAccount",
6       "tags": [
7         "patron"
8       ],
9       "parameters": [
10         {
11           "$ref": "../parameters.json#/patron_id_pp"
12         }
13       ],
14       "produces": [
15         "application/json"
16       ],
17       "responses": {
18         "200": {
19           "description": "Patron's account balance",
20           "schema": {
21             "$ref": "../definitions.json#/patron_balance"
22           }
23         },
24         "401": {
25           "description": "Authentication required",
26           "schema": {
27             "$ref": "../definitions.json#/error"
28           }
29         },
30         "403": {
31           "description": "Access forbidden",
32           "schema": {
33             "$ref": "../definitions.json#/error"
34           }
35         },
36         "404": {
37           "description": "Patron not found",
38           "schema": {
39             "$ref": "../definitions.json#/error"
40           }
41         },
42         "500": {
43           "description": "Internal server error",
44           "schema": {
45             "$ref": "../definitions.json#/error"
46           }
47         },
48         "503": {
49           "description": "Under maintenance",
50           "schema": {
51             "$ref": "../definitions.json#/error"
52           }
53         }
54       },
55       "x-koha-authorization": {
56         "permissions": {
57           "borrowers": "edit_borrowers",
58           "updatecharges": "remaining_permissions"
59         }
60       }
61     }
62   },
63   "/patrons/{patron_id}/account/credits": {
64     "post": {
65       "x-mojo-to": "Patrons::Account#add_credit",
66       "operationId": "addPatronCredit",
67       "tags": [
68         "patron"
69       ],
70       "parameters": [
71         {
72           "$ref": "../parameters.json#/patron_id_pp"
73         },
74         {
75           "name": "body",
76           "in": "body",
77           "description": "A JSON object containing credit information",
78           "required": true,
79           "schema": {
80             "$ref": "../definitions.json#/patron_account_credit"
81           }
82         }
83       ],
84       "produces": [
85         "application/json"
86       ],
87       "responses": {
88         "200": {
89           "description": "Credit added",
90           "schema": {
91             "type": "object"
92           }
93         },
94         "401": {
95           "description": "Authentication required",
96           "schema": {
97             "$ref": "../definitions.json#/error"
98           }
99         },
100         "403": {
101           "description": "Access forbidden",
102           "schema": {
103             "$ref": "../definitions.json#/error"
104           }
105         },
106         "404": {
107           "description": "Patron not found",
108           "schema": {
109             "$ref": "../definitions.json#/error"
110           }
111         },
112         "500": {
113           "description": "Internal server error",
114           "schema": {
115             "$ref": "../definitions.json#/error"
116           }
117         },
118         "503": {
119           "description": "Under maintenance",
120           "schema": {
121             "$ref": "../definitions.json#/error"
122           }
123         }
124       },
125       "x-koha-authorization": {
126         "permissions": {
127           "updatecharges": "remaining_permissions"
128         }
129       }
130     }
131   }
132 }