Bug 13895: Add API routes for checkouts retrieval and renewal
[koha.git] / api / v1 / swagger / paths / checkouts.json
1 {
2   "/checkouts": {
3     "get": {
4       "operationId": "listCheckouts",
5       "tags": ["patrons", "checkouts"],
6       "parameters": [{
7         "$ref": "../parameters.json#/borrowernumberQueryParam"
8       }],
9       "produces": [
10         "application/json"
11       ],
12       "responses": {
13         "200": {
14           "description": "A list of checkouts",
15           "schema": {
16             "$ref": "../definitions.json#/checkouts"
17           }
18         },
19         "403": {
20           "description": "Access forbidden",
21           "schema": { "$ref": "../definitions.json#/error" }
22         },
23         "404": {
24           "description": "Patron not found",
25           "schema": { "$ref": "../definitions.json#/error" }
26         }
27       },
28       "x-koha-authorization": {
29         "allow-owner": true,
30         "allow-guarantor": true,
31         "permissions": {
32           "circulate": "circulate_remaining_permissions"
33         }
34       }
35     }
36   },
37   "/checkouts/{checkout_id}": {
38     "get": {
39       "operationId": "getCheckout",
40       "tags": ["patrons", "checkouts"],
41       "parameters": [{
42         "$ref": "../parameters.json#/checkoutIdPathParam"
43       }],
44       "produces": ["application/json"],
45       "responses": {
46         "200": {
47           "description": "Updated borrower's checkout",
48           "schema": { "$ref": "../definitions.json#/checkout" }
49         },
50         "403": {
51           "description": "Access forbidden",
52           "schema": { "$ref": "../definitions.json#/error" }
53         },
54         "404": {
55           "description": "Checkout not found",
56           "schema": { "$ref": "../definitions.json#/error" }
57         }
58       },
59       "x-koha-authorization": {
60         "allow-owner": true,
61         "allow-guarantor": true,
62         "permissions": {
63           "circulate": "circulate_remaining_permissions"
64         }
65       }
66     },
67     "put": {
68       "operationId": "renewCheckout",
69       "tags": ["patrons", "checkouts"],
70       "parameters": [{
71         "$ref": "../parameters.json#/checkoutIdPathParam"
72       }],
73       "produces": ["application/json"],
74       "responses": {
75         "200": {
76           "description": "Updated borrower's checkout",
77           "schema": { "$ref": "../definitions.json#/checkout" }
78         },
79         "403": {
80           "description": "Cannot renew checkout",
81           "schema": { "$ref": "../definitions.json#/error" }
82         },
83         "404": {
84           "description": "Checkout not found",
85           "schema": { "$ref": "../definitions.json#/error" }
86         }
87       },
88       "x-koha-authorization": {
89         "allow-owner": true,
90         "allow-guarantor": true,
91         "permissions": {
92           "circulate": "circulate_remaining_permissions"
93         }
94       }
95     }
96   }
97 }