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