Bug 13895: (follow-up) Fix POST response
[koha.git] / api / v1 / swagger / paths / checkouts.json
1 {
2   "/checkouts": {
3     "get": {
4       "x-mojo-to": "Checkout#list",
5       "operationId": "listCheckouts",
6       "tags": ["patrons", "checkouts"],
7       "parameters": [{
8         "$ref": "../parameters.json#/patron_id_qp"
9       }],
10       "produces": [
11         "application/json"
12       ],
13       "responses": {
14         "200": {
15           "description": "A list of checkouts",
16           "schema": {
17             "$ref": "../definitions.json#/checkouts"
18           }
19         },
20         "403": {
21           "description": "Access forbidden",
22           "schema": { "$ref": "../definitions.json#/error" }
23         },
24         "404": {
25           "description": "Patron not found",
26           "schema": { "$ref": "../definitions.json#/error" }
27         }
28       },
29       "x-koha-authorization": {
30         "permissions": {
31           "circulate": "circulate_remaining_permissions"
32         }
33       }
34     }
35   },
36   "/checkouts/{checkout_id}": {
37     "get": {
38       "x-mojo-to": "Checkout#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         "permissions": {
61           "circulate": "circulate_remaining_permissions"
62         }
63       }
64     }
65   },
66   "/checkouts/{checkout_id}/renewal": {
67     "post": {
68       "x-mojo-to": "Checkout#renew",
69       "operationId": "renewCheckout",
70       "tags": ["patrons", "checkouts"],
71       "parameters": [{
72         "$ref": "../parameters.json#/checkoutIdPathParam"
73       }],
74       "produces": ["application/json"],
75       "responses": {
76         "201": {
77           "description": "Updated borrower's checkout",
78           "schema": { "$ref": "../definitions.json#/checkout" }
79         },
80         "403": {
81           "description": "Cannot renew checkout",
82           "schema": { "$ref": "../definitions.json#/error" }
83         },
84         "404": {
85           "description": "Checkout not found",
86           "schema": { "$ref": "../definitions.json#/error" }
87         }
88       },
89       "x-koha-authorization": {
90         "permissions": {
91           "circulate": "circulate_remaining_permissions"
92         }
93       }
94     }
95   }
96 }