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