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