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