1 /**
2 * @oas [get] /admin/refund-reasons
3 * operationId: GetRefundReasons
4 * summary: List Refund Reasons
5 * description: Retrieve a list of refund reasons. The refund reasons can be filtered by fields such as `id`. The refund reasons 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: id
49 * in: query
50 * required: false
51 * schema:
52 * oneOf:
53 * - type: string
54 * title: id
55 * description: Filter by a refund reason's ID.
56 * - type: array
57 * description: Filter by refund reason IDs.
58 * items:
59 * type: string
60 * title: id
61 * description: A refund reason ID.
62 * - name: q
63 * in: query
64 * description: Search term to filter the refund reason's searchable properties.
65 * required: false
66 * schema:
67 * type: string
68 * title: q
69 * description: Search term to filter the refund reason's searchable properties.
70 * - name: $and
71 * in: query
72 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
73 * required: false
74 * schema:
75 * type: array
76 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
77 * items:
78 * type: object
79 * title: $and
80 * - name: $or
81 * in: query
82 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
83 * required: false
84 * schema:
85 * type: array
86 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
87 * items:
88 * type: object
89 * title: $or
90 * - name: with_deleted
91 * in: query
92 * description: Whether to include deleted records in the result.
93 * required: false
94 * schema:
95 * type: boolean
96 * title: with_deleted
97 * description: Whether to include deleted records in the result.
98 * security:
99 * - api_token: []
100 * - cookie_auth: []
101 * - jwt_token: []
102 * x-codeSamples:
103 * - lang: JavaScript
104 * label: JS SDK
105 * source: |-
106 * import Medusa from "@medusajs/js-sdk"
107 *
108 * export const sdk = new Medusa({
109 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
110 * debug: import.meta.env.DEV,
111 * auth: {
112 * type: "session",
113 * },
114 * })
115 *
116 * sdk.admin.refundReason.list()
117 * .then(({ refund_reasons, count, limit, offset }) => {
118 * console.log(refund_reasons)
119 * })
120 * - lang: Shell
121 * label: cURL
122 * source: |-
123 * curl '{backend_url}/admin/refund-reasons' \
124 * -H 'Authorization: Bearer {jwt_token}'
125 * tags:
126 * - Refund Reasons
127 * responses:
128 * "200":
129 * description: OK
130 * content:
131 * application/json:
132 * schema:
133 * allOf:
134 * - type: object
135 * description: The paginated list of refund reasons.
136 * required:
137 * - limit
138 * - offset
139 * - count
140 * properties:
141 * limit:
142 * type: number
143 * title: limit
144 * description: The maximum number of items returned.
145 * offset:
146 * type: number
147 * title: offset
148 * description: The number of items skipped before retrieving the returned items.
149 * count:
150 * type: number
151 * title: count
152 * description: The total number of items.
153 * - type: object
154 * description: The paginated list of refund reasons.
155 * required:
156 * - refund_reasons
157 * properties:
158 * refund_reasons:
159 * type: array
160 * description: The refund reason's refund reasons.
161 * items:
162 * $ref: "#/components/schemas/AdminRefundReason"
163 * "400":
164 * $ref: "#/components/responses/400_error"
165 * "401":
166 * $ref: "#/components/responses/unauthorized"
167 * "404":
168 * $ref: "#/components/responses/not_found_error"
169 * "409":
170 * $ref: "#/components/responses/invalid_state_error"
171 * "422":
172 * $ref: "#/components/responses/invalid_request_error"
173 * "500":
174 * $ref: "#/components/responses/500_error"
175 *
176 */
177