1 /**
2 * @oas [post] /admin/sales-channels/{id}
3 * operationId: PostSalesChannelsId
4 * summary: Update a Sales Channel
5 * description: Update a sales channel's details.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The sales channel's ID.
11 * required: true
12 * schema:
13 * type: string
14 * - name: fields
15 * in: query
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 * required: false
19 * schema:
20 * type: string
21 * title: fields
22 * 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
23 * fields. without prefix it will replace the entire default fields.
24 * externalDocs:
25 * url: "#select-fields-and-relations"
26 * security:
27 * - api_token: []
28 * - cookie_auth: []
29 * - jwt_token: []
30 * requestBody:
31 * content:
32 * application/json:
33 * schema:
34 * $ref: "#/components/schemas/AdminUpdateSalesChannel"
35 * x-codeSamples:
36 * - lang: JavaScript
37 * label: JS SDK
38 * source: |-
39 * import Medusa from "@medusajs/js-sdk"
40 *
41 * export const sdk = new Medusa({
42 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
43 * debug: import.meta.env.DEV,
44 * auth: {
45 * type: "session",
46 * },
47 * })
48 *
49 * sdk.admin.salesChannel.update(
50 * "sc_123",
51 * {
52 * name: "Storefront",
53 * }
54 * )
55 * .then(({ salesChannel }) => {
56 * console.log(salesChannel)
57 * })
58 * - lang: Shell
59 * label: cURL
60 * source: |-
61 * curl -X POST '{backend_url}/admin/sales-channels/{id}' \
62 * -H 'Authorization: Bearer {jwt_token}' \
63 * -H 'Content-Type: application/json' \
64 * --data-raw '{
65 * "description": "{value}",
66 * "metadata": {}
67 * }'
68 * tags:
69 * - Sales Channels
70 * responses:
71 * "200":
72 * description: OK
73 * content:
74 * application/json:
75 * schema:
76 * $ref: "#/components/schemas/AdminSalesChannelResponse"
77 * "400":
78 * $ref: "#/components/responses/400_error"
79 * "401":
80 * $ref: "#/components/responses/unauthorized"
81 * "404":
82 * $ref: "#/components/responses/not_found_error"
83 * "409":
84 * $ref: "#/components/responses/invalid_state_error"
85 * "422":
86 * $ref: "#/components/responses/invalid_request_error"
87 * "500":
88 * $ref: "#/components/responses/500_error"
89 * x-workflow: updateSalesChannelsWorkflow
90 * x-events:
91 * - name: sales-channel.updated
92 * payload: |-
93 * ```ts
94 * {
95 * id, // The ID of the sales channel
96 * }
97 * ```
98 * description: Emitted when sales channels are updated.
99 * deprecated: false
100 *
101 */
102