1 /**
2 * @oas [post] /admin/price-preferences
3 * operationId: PostPricePreferences
4 * summary: Create Price Preference
5 * description: Create a price preference.
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 * security:
21 * - api_token: []
22 * - cookie_auth: []
23 * - jwt_token: []
24 * requestBody:
25 * content:
26 * application/json:
27 * schema:
28 * $ref: "#/components/schemas/AdminCreatePricePreference"
29 * x-codeSamples:
30 * - lang: JavaScript
31 * label: JS SDK
32 * source: |-
33 * import Medusa from "@medusajs/js-sdk"
34 *
35 * export const sdk = new Medusa({
36 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
37 * debug: import.meta.env.DEV,
38 * auth: {
39 * type: "session",
40 * },
41 * })
42 *
43 * sdk.admin.pricePreference.create({
44 * attribute: "region_id",
45 * value: "region_123",
46 * is_tax_inclusive: true
47 * })
48 * .then(({ price_preference }) => {
49 * console.log(price_preference)
50 * })
51 * - lang: Shell
52 * label: cURL
53 * source: |-
54 * curl -X POST '{backend_url}/admin/price-preferences' \
55 * -H 'Authorization: Bearer {jwt_token}'
56 * tags:
57 * - Price Preferences
58 * responses:
59 * "200":
60 * description: OK
61 * content:
62 * application/json:
63 * schema:
64 * $ref: "#/components/schemas/AdminPricePreferenceResponse"
65 * "400":
66 * $ref: "#/components/responses/400_error"
67 * "401":
68 * $ref: "#/components/responses/unauthorized"
69 * "404":
70 * $ref: "#/components/responses/not_found_error"
71 * "409":
72 * $ref: "#/components/responses/invalid_state_error"
73 * "422":
74 * $ref: "#/components/responses/invalid_request_error"
75 * "500":
76 * $ref: "#/components/responses/500_error"
77 * x-workflow: createPricePreferencesWorkflow
78 * x-events: []
79 *
80 */
81