1 /**
2 * @oas [get] /admin/currencies
3 * operationId: GetCurrencies
4 * summary: List Currencies
5 * description: Retrieve a list of currencies. The currencies can be filtered by fields such as `id`. The currencies 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: The search term to filter the currency's searchable properties by.
51 * required: false
52 * schema:
53 * type: string
54 * title: q
55 * description: The search term to filter the currency's searchable properties by.
56 * - name: code
57 * in: query
58 * required: false
59 * schema:
60 * oneOf:
61 * - type: string
62 * title: code
63 * description: Filter by a currency code.
64 * - type: array
65 * description: Filter by currency codes.
66 * items:
67 * type: string
68 * title: code
69 * description: A currency code.
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.currency.list()
117 * .then(({ currencies, count, limit, offset }) => {
118 * console.log(currencies)
119 * })
120 * - lang: Shell
121 * label: cURL
122 * source: |-
123 * curl '{backend_url}/admin/currencies' \
124 * -H 'Authorization: Bearer {jwt_token}'
125 * tags:
126 * - Currencies
127 * responses:
128 * "200":
129 * description: OK
130 * content:
131 * application/json:
132 * schema:
133 * $ref: "#/components/schemas/AdminCurrencyListResponse"
134 * "400":
135 * $ref: "#/components/responses/400_error"
136 * "401":
137 * $ref: "#/components/responses/unauthorized"
138 * "404":
139 * $ref: "#/components/responses/not_found_error"
140 * "409":
141 * $ref: "#/components/responses/invalid_state_error"
142 * "422":
143 * $ref: "#/components/responses/invalid_request_error"
144 * "500":
145 * $ref: "#/components/responses/500_error"
146 *
147 */
148