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