Bug 23154: Add pagination to /api/v1/checkouts
[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       "produces": [
15         "application/json"
16       ],
17       "responses": {
18         "200": {
19           "description": "A list of checkouts",
20           "schema": {
21             "$ref": "../definitions.json#/checkouts"
22           }
23         },
24         "403": {
25           "description": "Access forbidden",
26           "schema": { "$ref": "../definitions.json#/error" }
27         },
28         "404": {
29           "description": "Patron not found",
30           "schema": { "$ref": "../definitions.json#/error" }
31         }
32       },
33       "x-koha-authorization": {
34         "permissions": {
35           "circulate": "circulate_remaining_permissions"
36         }
37       }
38     }
39   },
40   "/checkouts/{checkout_id}": {
41     "get": {
42       "x-mojo-to": "Checkouts#get",
43       "operationId": "getCheckout",
44       "tags": ["patrons", "checkouts"],
45       "parameters": [{
46         "$ref": "../parameters.json#/checkout_id_pp"
47       }],
48       "produces": ["application/json"],
49       "responses": {
50         "200": {
51           "description": "Updated borrower's checkout",
52           "schema": { "$ref": "../definitions.json#/checkout" }
53         },
54         "403": {
55           "description": "Access forbidden",
56           "schema": { "$ref": "../definitions.json#/error" }
57         },
58         "404": {
59           "description": "Checkout not found",
60           "schema": { "$ref": "../definitions.json#/error" }
61         }
62       },
63       "x-koha-authorization": {
64         "permissions": {
65           "circulate": "circulate_remaining_permissions"
66         }
67       }
68     }
69   },
70   "/checkouts/{checkout_id}/renewal": {
71     "post": {
72       "x-mojo-to": "Checkouts#renew",
73       "operationId": "renewCheckout",
74       "tags": ["patrons", "checkouts"],
75       "parameters": [{
76         "$ref": "../parameters.json#/checkout_id_pp"
77       }],
78       "produces": ["application/json"],
79       "responses": {
80         "201": {
81           "description": "Updated borrower's checkout",
82           "schema": { "$ref": "../definitions.json#/checkout" }
83         },
84         "403": {
85           "description": "Cannot renew checkout",
86           "schema": { "$ref": "../definitions.json#/error" }
87         },
88         "404": {
89           "description": "Checkout not found",
90           "schema": { "$ref": "../definitions.json#/error" }
91         }
92       },
93       "x-koha-authorization": {
94         "permissions": {
95           "circulate": "circulate_remaining_permissions"
96         }
97       }
98     }
99   }
100 }