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