Bug 27947: Add cancellation reason to article request
[koha.git] / api / v1 / swagger / paths / clubs.json
1 {
2   "/clubs/{club_id}/holds": {
3     "post": {
4       "x-mojo-to": "Clubs::Holds#add",
5       "operationId": "addClubHold",
6       "tags": [
7         "clubs"
8       ],
9       "summary": "Add a club hold",
10       "parameters": [
11         {
12           "$ref": "../parameters.json#/club_id_pp"
13         },
14         {
15           "name": "body",
16           "in": "body",
17           "description": "A JSON object containing informations about the new hold",
18           "required": true,
19           "schema": {
20             "type": "object",
21             "properties": {
22               "biblio_id": {
23                 "description": "Internal biblio identifier",
24                 "type": [
25                   "integer",
26                   "null"
27                 ]
28               },
29               "item_id": {
30                 "description": "Internal item identifier",
31                 "type": [
32                   "integer",
33                   "null"
34                 ]
35               },
36               "pickup_library_id": {
37                 "description": "Internal library identifier for the pickup library",
38                 "type": "string"
39               },
40               "expiration_date": {
41                 "description": "Hold end date",
42                 "type": [
43                   "string",
44                   "null"
45                 ],
46                 "format": "date"
47               },
48               "notes": {
49                 "description": "Notes related to this hold",
50                 "type": [
51                   "string",
52                   "null"
53                 ]
54               },
55               "item_type": {
56                 "description": "Limit hold on one itemtype (ignored for item-level holds)",
57                 "type": [
58                   "string",
59                   "null"
60                 ]
61               },
62               "default_patron_home": {
63                 "description": "For each patron, set pickup location to patron's home library if possible",
64                 "type": "integer"
65               }
66             },
67             "required": [
68               "pickup_library_id"
69             ],
70             "additionalProperties": false
71           }
72         }
73       ],
74       "consumes": [
75         "application/json"
76       ],
77       "produces": [
78         "application/json"
79       ],
80       "responses": {
81         "201": {
82           "description": "Created club hold",
83           "schema": {
84             "$ref": "../definitions/club_hold.json"
85           }
86         },
87         "400": {
88           "description": "Missing or wrong parameters",
89           "schema": {
90             "$ref": "../definitions.json#/error"
91           }
92         },
93         "401": {
94           "description": "Authentication required",
95           "schema": {
96             "$ref": "../definitions.json#/error"
97           }
98         },
99         "403": {
100           "description": "Hold not allowed",
101           "schema": {
102             "$ref": "../definitions.json#/error"
103           }
104         },
105         "404": {
106           "description": "Club not found",
107           "schema": {
108             "$ref": "../definitions.json#/error"
109           }
110         },
111         "409": {
112           "description": "Hold not allowed",
113           "schema": {
114             "$ref": "../definitions.json#/error"
115           }
116         },
117         "500": {
118           "description": "Internal server error",
119           "schema": {
120             "$ref": "../definitions.json#/error"
121           }
122         },
123         "503": {
124           "description": "Under maintenance",
125           "schema": {
126             "$ref": "../definitions.json#/error"
127           }
128         }
129       },
130       "x-koha-authorization": {
131         "permissions": {
132           "reserveforothers": "1"
133         }
134       }
135     }
136   }
137 }