Bug 29620: Move the OpenAPI spec to YAML format
[koha.git] / api / v1 / swagger / paths / items.yaml
1 ---
2 /items:
3   get:
4     x-mojo-to: Items#list
5     operationId: listItems
6     tags:
7       - items
8     summary: List items
9     parameters:
10       - name: external_id
11         in: query
12         description: Search on the item's barcode
13         required: false
14         type: string
15       - $ref: ../parameters.yaml#/match
16       - $ref: ../parameters.yaml#/order_by
17       - $ref: ../parameters.yaml#/page
18       - $ref: ../parameters.yaml#/per_page
19       - $ref: ../parameters.yaml#/q_param
20       - $ref: ../parameters.yaml#/q_body
21       - $ref: ../parameters.yaml#/q_header
22     consumes:
23       - application/json
24     produces:
25       - application/json
26     responses:
27       "200":
28         description: A list of item
29         schema:
30           type: array
31           items:
32             $ref: ../definitions.yaml#/item
33       "401":
34         description: Authentication required
35         schema:
36           $ref: ../definitions.yaml#/error
37       "403":
38         description: Access forbidden
39         schema:
40           $ref: ../definitions.yaml#/error
41       "500":
42         description: Internal server error
43         schema:
44           $ref: ../definitions.yaml#/error
45       "503":
46         description: Under maintenance
47         schema:
48           $ref: ../definitions.yaml#/error
49     x-koha-authorization:
50       permissions:
51         catalogue: "1"
52 "/items/{item_id}":
53   get:
54     x-mojo-to: Items#get
55     operationId: getItem
56     tags:
57       - items
58     summary: Get item
59     parameters:
60       - $ref: ../parameters.yaml#/item_id_pp
61     consumes:
62       - application/json
63     produces:
64       - application/json
65     responses:
66       "200":
67         description: An item
68         schema:
69           $ref: ../definitions.yaml#/item
70       "400":
71         description: Missing or wrong parameters
72         schema:
73           $ref: ../definitions.yaml#/error
74       "404":
75         description: Item not found
76         schema:
77           $ref: ../definitions.yaml#/error
78       "500":
79         description: Internal server error
80         schema:
81           $ref: ../definitions.yaml#/error
82       "503":
83         description: Under maintenance
84         schema:
85           $ref: ../definitions.yaml#/error
86     x-koha-authorization:
87       permissions:
88         catalogue: "1"
89 "/items/{item_id}/pickup_locations":
90   get:
91     x-mojo-to: Items#pickup_locations
92     operationId: getItemPickupLocations
93     summary: Get valid pickup locations for an item
94     tags:
95       - items
96     parameters:
97       - $ref: ../parameters.yaml#/item_id_pp
98       - name: patron_id
99         in: query
100         description: Internal patron identifier
101         required: true
102         type: integer
103       - $ref: ../parameters.yaml#/match
104       - $ref: ../parameters.yaml#/order_by
105       - $ref: ../parameters.yaml#/page
106       - $ref: ../parameters.yaml#/per_page
107       - $ref: ../parameters.yaml#/q_param
108       - $ref: ../parameters.yaml#/q_body
109       - $ref: ../parameters.yaml#/q_header
110     consumes:
111       - application/json
112     produces:
113       - application/json
114     responses:
115       "200":
116         description: Item pickup locations
117         schema:
118           type: array
119           items:
120             $ref: ../definitions.yaml#/library
121       "400":
122         description: Missing or wrong parameters
123         schema:
124           $ref: ../definitions.yaml#/error
125       "401":
126         description: Authentication required
127         schema:
128           $ref: ../definitions.yaml#/error
129       "403":
130         description: Access forbidden
131         schema:
132           $ref: ../definitions.yaml#/error
133       "404":
134         description: Biblio not found
135         schema:
136           $ref: ../definitions.yaml#/error
137       "500":
138         description: Internal server error
139         schema:
140           $ref: ../definitions.yaml#/error
141       "503":
142         description: Under maintenance
143         schema:
144           $ref: ../definitions.yaml#/error
145     x-koha-authorization:
146       permissions:
147         reserveforothers: place_holds