Bug 22615: Add /ill_backends endpoint
[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     }
48   },
49   "/checkouts/{checkout_id}": {
50     "get": {
51       "x-mojo-to": "Checkouts#get",
52       "operationId": "getCheckout",
53       "tags": ["patrons", "checkouts"],
54       "parameters": [{
55         "$ref": "../parameters.json#/checkout_id_pp"
56       }],
57       "produces": ["application/json"],
58       "responses": {
59         "200": {
60           "description": "Updated borrower's checkout",
61           "schema": { "$ref": "../definitions.json#/checkout" }
62         },
63         "403": {
64           "description": "Access forbidden",
65           "schema": { "$ref": "../definitions.json#/error" }
66         },
67         "404": {
68           "description": "Checkout not found",
69           "schema": { "$ref": "../definitions.json#/error" }
70         }
71       },
72       "x-koha-authorization": {
73         "permissions": {
74           "circulate": "circulate_remaining_permissions"
75         }
76       }
77     }
78   },
79   "/checkouts/{checkout_id}/renewal": {
80     "post": {
81       "x-mojo-to": "Checkouts#renew",
82       "operationId": "renewCheckout",
83       "tags": ["patrons", "checkouts"],
84       "parameters": [{
85         "$ref": "../parameters.json#/checkout_id_pp"
86       }],
87       "produces": ["application/json"],
88       "responses": {
89         "201": {
90           "description": "Updated borrower's checkout",
91           "schema": { "$ref": "../definitions.json#/checkout" }
92         },
93         "403": {
94           "description": "Cannot renew checkout",
95           "schema": { "$ref": "../definitions.json#/error" }
96         },
97         "404": {
98           "description": "Checkout not found",
99           "schema": { "$ref": "../definitions.json#/error" }
100         }
101       },
102       "x-koha-authorization": {
103         "permissions": {
104           "circulate": "circulate_remaining_permissions"
105         }
106       }
107     }
108   },
109   "/checkouts/{checkout_id}/allows_renewal": {
110     "get": {
111       "x-mojo-to": "Checkouts#allows_renewal",
112       "operationId": "allows_renewalCheckout",
113       "tags": ["patrons", "checkouts"],
114       "parameters": [{
115         "$ref": "../parameters.json#/checkout_id_pp"
116       }],
117       "produces": ["application/json"],
118       "responses": {
119         "200": {
120           "description": "Checkout renewability information",
121           "schema": { "$ref": "../definitions.json#/allows_renewal" }
122         },
123         "403": {
124           "description": "Forbidden",
125           "schema": { "$ref": "../definitions.json#/error" }
126         },
127         "404": {
128           "description": "Checkout not found",
129           "schema": { "$ref": "../definitions.json#/error" }
130         }
131       },
132       "x-koha-authorization": {
133         "permissions": {
134           "circulate": "circulate_remaining_permissions"
135         }
136       }
137     }
138   }
139 }