Bug 26633: Add API documentation
[koha.git] / api / v1 / swagger / paths / checkouts.json
1 {
2   "/checkouts": {
3     "get": {
4       "x-mojo-to": "Checkouts#list",
5       "operationId": "listCheckouts",
6       "tags": ["patrons", "checkouts"],
7       "parameters": [{
8         "$ref": "../parameters.json#/patron_id_qp"
9       }, {
10         "$ref": "../parameters.json#/page"
11       }, {
12         "$ref": "../parameters.json#/per_page"
13       }, {
14         "$ref": "../parameters.json#/match"
15       }, {
16         "$ref": "../parameters.json#/order_by"
17       },{
18         "name": "checked_in",
19         "in": "query",
20         "description": "By default, current checkouts are returned, when this is true then checked in checkouts are returned as result.",
21         "type": "boolean"
22       }],
23       "produces": [
24         "application/json"
25       ],
26       "responses": {
27         "200": {
28           "description": "A list of checkouts",
29           "schema": {
30             "$ref": "../definitions.json#/checkouts"
31           }
32         },
33         "403": {
34           "description": "Access forbidden",
35           "schema": { "$ref": "../definitions.json#/error" }
36         },
37         "404": {
38           "description": "Patron not found",
39           "schema": { "$ref": "../definitions.json#/error" }
40         }
41       },
42       "x-koha-authorization": {
43         "permissions": {
44           "circulate": "circulate_remaining_permissions"
45         }
46       },
47       "x-koha-embed": [
48         "issuer"
49       ]
50     }
51   },
52   "/checkouts/{checkout_id}": {
53     "get": {
54       "x-mojo-to": "Checkouts#get",
55       "operationId": "getCheckout",
56       "tags": ["patrons", "checkouts"],
57       "parameters": [{
58         "$ref": "../parameters.json#/checkout_id_pp"
59       }],
60       "produces": ["application/json"],
61       "responses": {
62         "200": {
63           "description": "Updated borrower's checkout",
64           "schema": { "$ref": "../definitions.json#/checkout" }
65         },
66         "403": {
67           "description": "Access forbidden",
68           "schema": { "$ref": "../definitions.json#/error" }
69         },
70         "404": {
71           "description": "Checkout not found",
72           "schema": { "$ref": "../definitions.json#/error" }
73         }
74       },
75       "x-koha-authorization": {
76         "permissions": {
77           "circulate": "circulate_remaining_permissions"
78         }
79       },
80       "x-koha-embed": [
81         "issuer"
82       ]
83     }
84   },
85   "/checkouts/{checkout_id}/renewal": {
86     "post": {
87       "x-mojo-to": "Checkouts#renew",
88       "operationId": "renewCheckout",
89       "tags": ["patrons", "checkouts"],
90       "parameters": [
91         { "$ref": "../parameters.json#/checkout_id_pp" },
92         { "$ref": "../parameters.json#/seen_pp" }
93       ],
94       "produces": ["application/json"],
95       "responses": {
96         "201": {
97           "description": "Updated borrower's checkout",
98           "schema": { "$ref": "../definitions.json#/checkout" }
99         },
100         "403": {
101           "description": "Cannot renew checkout",
102           "schema": { "$ref": "../definitions.json#/error" }
103         },
104         "404": {
105           "description": "Checkout not found",
106           "schema": { "$ref": "../definitions.json#/error" }
107         }
108       },
109       "x-koha-authorization": {
110         "permissions": {
111           "circulate": "circulate_remaining_permissions"
112         }
113       }
114     }
115   },
116   "/checkouts/{checkout_id}/allows_renewal": {
117     "get": {
118       "x-mojo-to": "Checkouts#allows_renewal",
119       "operationId": "allows_renewalCheckout",
120       "tags": ["patrons", "checkouts"],
121       "parameters": [{
122         "$ref": "../parameters.json#/checkout_id_pp"
123       }],
124       "produces": ["application/json"],
125       "responses": {
126         "200": {
127           "description": "Checkout renewability information",
128           "schema": { "$ref": "../definitions.json#/allows_renewal" }
129         },
130         "403": {
131           "description": "Forbidden",
132           "schema": { "$ref": "../definitions.json#/error" }
133         },
134         "404": {
135           "description": "Checkout not found",
136           "schema": { "$ref": "../definitions.json#/error" }
137         }
138       },
139       "x-koha-authorization": {
140         "permissions": {
141           "circulate": "circulate_remaining_permissions"
142         }
143       }
144     }
145   }
146 }