Bug 26633: Add API documentation
[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": ["holds", "clubs"],
7             "parameters": [{
8                 "$ref": "../parameters.json#/club_id_pp"
9               }, {
10                 "name": "body",
11                 "in": "body",
12                 "description": "A JSON object containing informations about the new hold",
13                 "required": true,
14                 "schema": {
15                   "type": "object",
16                   "properties": {
17                     "biblio_id": {
18                       "description": "Internal biblio identifier",
19                       "type": [ "integer", "null" ]
20                     },
21                     "item_id": {
22                       "description": "Internal item identifier",
23                       "type": [ "integer", "null" ]
24                     },
25                     "pickup_library_id": {
26                       "description": "Internal library identifier for the pickup library",
27                       "type": "string"
28                     },
29                     "expiration_date": {
30                       "description": "Hold end date",
31                       "type": ["string", "null"],
32                       "format": "date"
33                     },
34                     "notes": {
35                       "description": "Notes related to this hold",
36                       "type": [ "string", "null" ]
37                     },
38                     "item_type": {
39                       "description": "Limit hold on one itemtype (ignored for item-level holds)",
40                       "type": [ "string", "null" ]
41                     },
42                     "default_patron_home": {
43                       "description": "For each patron, set pickup location to patron's home library if possible",
44                       "type": "integer"
45                     }
46                   },
47                   "required": [ "pickup_library_id" ]
48                 }
49               }
50             ],
51             "consumes": ["application/json"],
52             "produces": ["application/json"],
53             "responses": {
54               "201": {
55                 "description": "Created hold",
56                 "schema": {
57                     "$ref": "../definitions/club_hold.json"
58                 }
59               },
60               "400": {
61                 "description": "Missing or wrong parameters",
62                 "schema": {
63                   "$ref": "../definitions.json#/error"
64                 }
65               },
66               "401": {
67                 "description": "Authentication required",
68                 "schema": {
69                   "$ref": "../definitions.json#/error"
70                 }
71               },
72               "403": {
73                 "description": "Hold not allowed",
74                 "schema": {
75                   "$ref": "../definitions.json#/error"
76                 }
77               },
78               "404": {
79                 "description": "Hold not found",
80                 "schema": {
81                   "$ref": "../definitions.json#/error"
82                 }
83               },
84               "409": {
85                 "description": "Hold not allowed",
86                 "schema": {
87                   "$ref": "../definitions.json#/error"
88                 }
89               },
90               "500": {
91                 "description": "Internal server error",
92                 "schema": {
93                   "$ref": "../definitions.json#/error"
94                 }
95               },
96               "503": {
97                 "description": "Under maintenance",
98                 "schema": {
99                   "$ref": "../definitions.json#/error"
100                 }
101               }
102             },
103             "x-koha-authorization": {
104               "permissions": {
105                 "reserveforothers": "1"
106               }
107             }
108         }
109     }
110 }