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