Bug 11897: Use 'stockrotation' permission for the endpoint
[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         "allow-owner": true,
57         "allow-guarantor": true,
58         "permissions": {
59           "borrowers": "edit_borrowers",
60           "updatecharges": "remaining_permissions"
61         }
62       }
63     }
64   },
65   "/patrons/{patron_id}/account/credits": {
66     "post": {
67       "x-mojo-to": "Patrons::Account#add_credit",
68       "operationId": "addPatronCredit",
69       "tags": [
70         "patron"
71       ],
72       "parameters": [
73         {
74           "$ref": "../parameters.json#/patron_id_pp"
75         },
76         {
77           "name": "body",
78           "in": "body",
79           "description": "A JSON object containing credit information",
80           "required": true,
81           "schema": {
82             "$ref": "../definitions.json#/patron_account_credit"
83           }
84         }
85       ],
86       "produces": [
87         "application/json"
88       ],
89       "responses": {
90         "200": {
91           "description": "Credit added",
92           "schema": {
93             "type": "object"
94           }
95         },
96         "401": {
97           "description": "Authentication required",
98           "schema": {
99             "$ref": "../definitions.json#/error"
100           }
101         },
102         "403": {
103           "description": "Access forbidden",
104           "schema": {
105             "$ref": "../definitions.json#/error"
106           }
107         },
108         "404": {
109           "description": "Patron not found",
110           "schema": {
111             "$ref": "../definitions.json#/error"
112           }
113         },
114         "500": {
115           "description": "Internal server error",
116           "schema": {
117             "$ref": "../definitions.json#/error"
118           }
119         },
120         "503": {
121           "description": "Under maintenance",
122           "schema": {
123             "$ref": "../definitions.json#/error"
124           }
125         }
126       },
127       "x-koha-authorization": {
128         "permissions": {
129           "updatecharges": "remaining_permissions"
130         }
131       }
132     }
133   }
134 }