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