Bug 19618: Add api endpoint for club holds
[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                   },
43                   "required": [ "pickup_library_id" ]
44                 }
45               }
46             ],
47             "consumes": ["application/json"],
48             "produces": ["application/json"],
49             "responses": {
50               "201": {
51                 "description": "Created hold",
52                 "schema": {
53                     "$ref": "../definitions/club_hold.json"
54                 }
55               },
56               "400": {
57                 "description": "Missing or wrong parameters",
58                 "schema": {
59                   "$ref": "../definitions.json#/error"
60                 }
61               },
62               "401": {
63                 "description": "Authentication required",
64                 "schema": {
65                   "$ref": "../definitions.json#/error"
66                 }
67               },
68               "403": {
69                 "description": "Hold not allowed",
70                 "schema": {
71                   "$ref": "../definitions.json#/error"
72                 }
73               },
74               "404": {
75                 "description": "Hold not found",
76                 "schema": {
77                   "$ref": "../definitions.json#/error"
78                 }
79               },
80               "500": {
81                 "description": "Internal server error",
82                 "schema": {
83                   "$ref": "../definitions.json#/error"
84                 }
85               },
86               "503": {
87                 "description": "Under maintenance",
88                 "schema": {
89                   "$ref": "../definitions.json#/error"
90                 }
91               }
92             },
93             "x-koha-authorization": {
94               "permissions": {
95                 "reserveforothers": "1"
96               }
97             }
98         }
99     }
100 }