1 /**
2 * @oas [get] /admin/gift-cards
3 * operationId: GetGiftCards
4 * summary: List Gift Cards
5 * description: Retrieve a list of gift cards. The gift cards can be filtered by fields such as `id`. The gift cards can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: query
10 * required: false
11 * schema:
12 * oneOf:
13 * - type: string
14 * title: id
15 * description: The gift card's ID.
16 * - type: array
17 * description: The gift card's ID.
18 * items:
19 * type: string
20 * title: id
21 * description: The id's ID.
22 * - name: customer_id
23 * in: query
24 * required: false
25 * schema:
26 * oneOf:
27 * - type: string
28 * title: customer_id
29 * description: Filter by a customer ID to retrieve their gift cards.
30 * - type: array
31 * description: Filter by customer IDs to retrieve their gift cards.
32 * items:
33 * type: string
34 * title: customer_id
35 * description: A customer ID.
36 * - name: created_at
37 * in: query
38 * description: Filter by a gift card's creation date.
39 * required: false
40 * schema:
41 * type: object
42 * description: Filter by a gift card's creation date.
43 * properties:
44 * $and:
45 * type: array
46 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
47 * items:
48 * type: object
49 * title: $and
50 * $or:
51 * type: array
52 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
53 * items:
54 * type: object
55 * title: $or
56 * $eq:
57 * oneOf:
58 * - type: string
59 * title: $eq
60 * description: Filter by an exact match.
61 * - type: array
62 * description: Filter by an exact match.
63 * items:
64 * type: string
65 * title: $eq
66 * description: Filter by an exact match.
67 * $ne:
68 * type: string
69 * title: $ne
70 * description: Filter by values not equal to this parameter.
71 * $in:
72 * type: array
73 * description: Filter by values in this array.
74 * items:
75 * type: string
76 * title: $in
77 * description: Filter by values in this array.
78 * $nin:
79 * type: array
80 * description: Filter by values not in this array.
81 * items:
82 * type: string
83 * title: $nin
84 * description: Filter by values not in this array.
85 * $not:
86 * oneOf:
87 * - type: string
88 * title: $not
89 * description: Filter by values not matching the conditions in this parameter.
90 * - type: object
91 * description: Filter by values not matching the conditions in this parameter.
92 * - type: array
93 * description: Filter by values not matching the conditions in this parameter.
94 * items:
95 * type: string
96 * title: $not
97 * description: Filter by values not matching the conditions in this parameter.
98 * $gt:
99 * type: string
100 * title: $gt
101 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
102 * $gte:
103 * type: string
104 * title: $gte
105 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
106 * $lt:
107 * type: string
108 * title: $lt
109 * description: Filter by values less than this parameter. Useful for numbers and dates only.
110 * $lte:
111 * type: string
112 * title: $lte
113 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
114 * $like:
115 * type: string
116 * title: $like
117 * description: Apply a `like` filter. Useful for strings only.
118 * $re:
119 * type: string
120 * title: $re
121 * description: Apply a regex filter. Useful for strings only.
122 * $ilike:
123 * type: string
124 * title: $ilike
125 * description: Apply a case-insensitive `like` filter. Useful for strings only.
126 * $fulltext:
127 * type: string
128 * title: $fulltext
129 * description: Filter to apply on full-text properties.
130 * $overlap:
131 * type: array
132 * description: Filter arrays that have overlapping values with this parameter.
133 * items:
134 * type: string
135 * title: $overlap
136 * description: Filter arrays that have overlapping values with this parameter.
137 * $contains:
138 * type: array
139 * description: Filter arrays that contain some of the values of this parameter.
140 * items:
141 * type: string
142 * title: $contains
143 * description: Filter arrays that contain some of the values of this parameter.
144 * $contained:
145 * type: array
146 * description: Filter arrays that contain all values of this parameter.
147 * items:
148 * type: string
149 * title: $contained
150 * description: Filter arrays that contain all values of this parameter.
151 * $exists:
152 * type: boolean
153 * title: $exists
154 * description: Filter by whether a value for this parameter exists (not `null`).
155 * title: created_at
156 * - name: updated_at
157 * in: query
158 * description: Filter by a gift card's update date.
159 * required: false
160 * schema:
161 * type: object
162 * description: Filter by a gift card's update date.
163 * properties:
164 * $and:
165 * type: array
166 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
167 * items:
168 * type: object
169 * title: $and
170 * $or:
171 * type: array
172 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
173 * items:
174 * type: object
175 * title: $or
176 * $eq:
177 * oneOf:
178 * - type: string
179 * title: $eq
180 * description: Filter by an exact match.
181 * - type: array
182 * description: Filter by an exact match.
183 * items:
184 * type: string
185 * title: $eq
186 * description: Filter by an exact match.
187 * $ne:
188 * type: string
189 * title: $ne
190 * description: Filter by values not equal to this parameter.
191 * $in:
192 * type: array
193 * description: Filter by values in this array.
194 * items:
195 * type: string
196 * title: $in
197 * description: Filter by values in this array.
198 * $nin:
199 * type: array
200 * description: Filter by values not in this array.
201 * items:
202 * type: string
203 * title: $nin
204 * description: Filter by values not in this array.
205 * $not:
206 * oneOf:
207 * - type: string
208 * title: $not
209 * description: Filter by values not matching the conditions in this parameter.
210 * - type: object
211 * description: Filter by values not matching the conditions in this parameter.
212 * - type: array
213 * description: Filter by values not matching the conditions in this parameter.
214 * items:
215 * type: string
216 * title: $not
217 * description: Filter by values not matching the conditions in this parameter.
218 * $gt:
219 * type: string
220 * title: $gt
221 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
222 * $gte:
223 * type: string
224 * title: $gte
225 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
226 * $lt:
227 * type: string
228 * title: $lt
229 * description: Filter by values less than this parameter. Useful for numbers and dates only.
230 * $lte:
231 * type: string
232 * title: $lte
233 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
234 * $like:
235 * type: string
236 * title: $like
237 * description: Apply a `like` filter. Useful for strings only.
238 * $re:
239 * type: string
240 * title: $re
241 * description: Apply a regex filter. Useful for strings only.
242 * $ilike:
243 * type: string
244 * title: $ilike
245 * description: Apply a case-insensitive `like` filter. Useful for strings only.
246 * $fulltext:
247 * type: string
248 * title: $fulltext
249 * description: Filter to apply on full-text properties.
250 * $overlap:
251 * type: array
252 * description: Filter arrays that have overlapping values with this parameter.
253 * items:
254 * type: string
255 * title: $overlap
256 * description: Filter arrays that have overlapping values with this parameter.
257 * $contains:
258 * type: array
259 * description: Filter arrays that contain some of the values of this parameter.
260 * items:
261 * type: string
262 * title: $contains
263 * description: Filter arrays that contain some of the values of this parameter.
264 * $contained:
265 * type: array
266 * description: Filter arrays that contain all values of this parameter.
267 * items:
268 * type: string
269 * title: $contained
270 * description: Filter arrays that contain all values of this parameter.
271 * $exists:
272 * type: boolean
273 * title: $exists
274 * description: Filter by whether a value for this parameter exists (not `null`).
275 * title: updated_at
276 * - name: limit
277 * in: query
278 * description: Limit the number of items returned in the list.
279 * required: false
280 * schema:
281 * type: number
282 * title: limit
283 * description: Limit the number of items returned in the list.
284 * externalDocs:
285 * url: "#pagination"
286 * - name: offset
287 * in: query
288 * description: The number of items to skip when retrieving a list.
289 * required: false
290 * schema:
291 * type: number
292 * title: offset
293 * description: The number of items to skip when retrieving a list.
294 * externalDocs:
295 * url: "#pagination"
296 * - name: order
297 * in: query
298 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
299 * required: false
300 * schema:
301 * type: string
302 * title: order
303 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
304 * externalDocs:
305 * url: "#pagination"
306 * - name: fields
307 * in: query
308 * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
309 * fields. Without prefix it will replace the entire default fields.
310 * required: false
311 * schema:
312 * type: string
313 * title: fields
314 * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
315 * fields. Without prefix it will replace the entire default fields.
316 * externalDocs:
317 * url: "#select-fields-and-relations"
318 * - name: $and
319 * in: query
320 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
321 * required: false
322 * schema:
323 * type: array
324 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
325 * items:
326 * type: object
327 * title: $and
328 * - name: $or
329 * in: query
330 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
331 * required: false
332 * schema:
333 * type: array
334 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
335 * items:
336 * type: object
337 * title: $or
338 * - name: with_deleted
339 * in: query
340 * description: The gift card's with deleted.
341 * required: false
342 * schema:
343 * type: boolean
344 * title: with_deleted
345 * description: The gift card's with deleted.
346 * security:
347 * - api_token: []
348 * - cookie_auth: []
349 * - jwt_token: []
350 * x-codeSamples:
351 * - lang: Shell
352 * label: cURL
353 * source: |-
354 * curl '{backend_url}/admin/gift-cards' \
355 * -H 'Authorization: Bearer {jwt_token}'
356 * tags:
357 * - Gift Cards
358 * responses:
359 * "200":
360 * description: OK
361 * content:
362 * application/json:
363 * schema:
364 * $ref: "#/components/schemas/AdminGiftCardsResponse"
365 * "400":
366 * $ref: "#/components/responses/400_error"
367 * "401":
368 * $ref: "#/components/responses/unauthorized"
369 * "404":
370 * $ref: "#/components/responses/not_found_error"
371 * "409":
372 * $ref: "#/components/responses/invalid_state_error"
373 * "422":
374 * $ref: "#/components/responses/invalid_request_error"
375 * "500":
376 * $ref: "#/components/responses/500_error"
377 * x-badges:
378 * - text: Loyalty Plugin
379 * description: |
380 * This API route is only available through the [Loyalty Plugin](https://docs.medusajs.com/resources/commerce-modules/loyalty).
381 *
382 */
383