1 get:
2 operationId: GetSalesChannels
3 summary: List Sales Channels
4 description: >-
5 Retrieve a list of sales channels. The sales channels can be filtered by
6 fields such as `id`. The sales channels can also be sorted or paginated.
7 x-authenticated: true
8 parameters:
9 - name: fields
10 in: query
11 description: >-
12 Comma-separated fields that should be included in the returned data. if
13 a field is prefixed with `+` it will be added to the default fields,
14 using `-` will remove it from the default fields. without prefix it will
15 replace the entire default fields.
16 required: false
17 schema:
18 type: string
19 title: fields
20 description: >-
21 Comma-separated fields that should be included in the returned data.
22 if a field is prefixed with `+` it will be added to the default
23 fields, using `-` will remove it from the default fields. without
24 prefix it will replace the entire default fields.
25 externalDocs:
26 url: '#select-fields-and-relations'
27 - name: offset
28 in: query
29 description: The number of items to skip when retrieving a list.
30 required: false
31 schema:
32 type: number
33 title: offset
34 description: The number of items to skip when retrieving a list.
35 externalDocs:
36 url: '#pagination'
37 - name: limit
38 in: query
39 description: Limit the number of items returned in the list.
40 required: false
41 schema:
42 type: number
43 title: limit
44 description: Limit the number of items returned in the list.
45 externalDocs:
46 url: '#pagination'
47 - name: order
48 in: query
49 description: >-
50 The field to sort the data by. By default, the sort order is ascending.
51 To change the order to descending, prefix the field name with `-`.
52 required: false
53 schema:
54 type: string
55 title: order
56 description: >-
57 The field to sort the data by. By default, the sort order is
58 ascending. To change the order to descending, prefix the field name
59 with `-`.
60 - name: q
61 in: query
62 description: Search term to filter the sales channel's searchable properties.
63 required: false
64 schema:
65 type: string
66 title: q
67 description: Search term to filter the sales channel's searchable properties.
68 - name: id
69 in: query
70 required: false
71 schema:
72 oneOf:
73 - type: string
74 title: id
75 description: Filter by a sales channel ID.
76 - type: array
77 description: Filter by sales channel IDs.
78 items:
79 type: string
80 title: id
81 description: A sales channel ID.
82 - name: name
83 in: query
84 required: false
85 schema:
86 oneOf:
87 - type: string
88 title: name
89 description: Filter by a sales channel name.
90 - type: array
91 description: Filter by sales channel names.
92 items:
93 type: string
94 title: name
95 description: A sales channel name.
96 - name: description
97 in: query
98 description: The sales channel's description.
99 required: false
100 schema:
101 type: string
102 title: description
103 description: >-
104 Filter by a description. This filter matches an entire description. To
105 search by terms or keywords, use the `q` query parameter instead.
106 - name: is_disabled
107 in: query
108 description: Filter by whether the sales channel is disabled.
109 required: false
110 schema:
111 type: boolean
112 title: is_disabled
113 description: Filter by whether the sales channel is disabled.
114 - name: created_at
115 in: query
116 description: Filter by a sales channel's creation date.
117 required: false
118 schema:
119 type: object
120 description: Filter by a sales channel's creation date.
121 properties:
122 $and:
123 type: array
124 description: >-
125 Join query parameters with an AND condition. Each object's content
126 is the same type as the expected query parameters.
127 items:
128 type: object
129 title: $and
130 $or:
131 type: array
132 description: >-
133 Join query parameters with an OR condition. Each object's content
134 is the same type as the expected query parameters.
135 items:
136 type: object
137 title: $or
138 $eq:
139 oneOf:
140 - type: string
141 title: $eq
142 description: Filter by an exact match.
143 - type: array
144 description: Filter by an exact match.
145 items:
146 type: string
147 title: $eq
148 description: Filter by an exact match.
149 $ne:
150 type: string
151 title: $ne
152 description: Filter by values not equal to this parameter.
153 $in:
154 type: array
155 description: Filter by values in this array.
156 items:
157 type: string
158 title: $in
159 description: Filter by values in this array.
160 $nin:
161 type: array
162 description: Filter by values not in this array.
163 items:
164 type: string
165 title: $nin
166 description: Filter by values not in this array.
167 $not:
168 oneOf:
169 - type: string
170 title: $not
171 description: >-
172 Filter by values not matching the conditions in this
173 parameter.
174 - type: object
175 description: >-
176 Filter by values not matching the conditions in this
177 parameter.
178 - type: array
179 description: >-
180 Filter by values not matching the conditions in this
181 parameter.
182 items:
183 type: string
184 title: $not
185 description: >-
186 Filter by values not matching the conditions in this
187 parameter.
188 $gt:
189 type: string
190 title: $gt
191 description: >-
192 Filter by values greater than this parameter. Useful for numbers
193 and dates only.
194 $gte:
195 type: string
196 title: $gte
197 description: >-
198 Filter by values greater than or equal to this parameter. Useful
199 for numbers and dates only.
200 $lt:
201 type: string
202 title: $lt
203 description: >-
204 Filter by values less than this parameter. Useful for numbers and
205 dates only.
206 $lte:
207 type: string
208 title: $lte
209 description: >-
210 Filter by values less than or equal to this parameter. Useful for
211 numbers and dates only.
212 $like:
213 type: string
214 title: $like
215 description: Apply a `like` filter. Useful for strings only.
216 $re:
217 type: string
218 title: $re
219 description: Apply a regex filter. Useful for strings only.
220 $ilike:
221 type: string
222 title: $ilike
223 description: Apply a case-insensitive `like` filter. Useful for strings only.
224 $fulltext:
225 type: string
226 title: $fulltext
227 description: Filter to apply on full-text properties.
228 $overlap:
229 type: array
230 description: Filter arrays that have overlapping values with this parameter.
231 items:
232 type: string
233 title: $overlap
234 description: Filter arrays that have overlapping values with this parameter.
235 $contains:
236 type: array
237 description: Filter arrays that contain some of the values of this parameter.
238 items:
239 type: string
240 title: $contains
241 description: Filter arrays that contain some of the values of this parameter.
242 $contained:
243 type: array
244 description: Filter arrays that contain all values of this parameter.
245 items:
246 type: string
247 title: $contained
248 description: Filter arrays that contain all values of this parameter.
249 $exists:
250 type: boolean
251 title: $exists
252 description: Filter by whether a value for this parameter exists (not `null`).
253 title: created_at
254 - name: updated_at
255 in: query
256 description: Filter by a sales channel's update date.
257 required: false
258 schema:
259 type: object
260 description: Filter by a sales channel's update date.
261 properties:
262 $and:
263 type: array
264 description: >-
265 Join query parameters with an AND condition. Each object's content
266 is the same type as the expected query parameters.
267 items:
268 type: object
269 title: $and
270 $or:
271 type: array
272 description: >-
273 Join query parameters with an OR condition. Each object's content
274 is the same type as the expected query parameters.
275 items:
276 type: object
277 title: $or
278 $eq:
279 oneOf:
280 - type: string
281 title: $eq
282 description: Filter by an exact match.
283 - type: array
284 description: Filter by an exact match.
285 items:
286 type: string
287 title: $eq
288 description: Filter by an exact match.
289 $ne:
290 type: string
291 title: $ne
292 description: Filter by values not equal to this parameter.
293 $in:
294 type: array
295 description: Filter by values in this array.
296 items:
297 type: string
298 title: $in
299 description: Filter by values in this array.
300 $nin:
301 type: array
302 description: Filter by values not in this array.
303 items:
304 type: string
305 title: $nin
306 description: Filter by values not in this array.
307 $not:
308 oneOf:
309 - type: string
310 title: $not
311 description: >-
312 Filter by values not matching the conditions in this
313 parameter.
314 - type: object
315 description: >-
316 Filter by values not matching the conditions in this
317 parameter.
318 - type: array
319 description: >-
320 Filter by values not matching the conditions in this
321 parameter.
322 items:
323 type: string
324 title: $not
325 description: >-
326 Filter by values not matching the conditions in this
327 parameter.
328 $gt:
329 type: string
330 title: $gt
331 description: >-
332 Filter by values greater than this parameter. Useful for numbers
333 and dates only.
334 $gte:
335 type: string
336 title: $gte
337 description: >-
338 Filter by values greater than or equal to this parameter. Useful
339 for numbers and dates only.
340 $lt:
341 type: string
342 title: $lt
343 description: >-
344 Filter by values less than this parameter. Useful for numbers and
345 dates only.
346 $lte:
347 type: string
348 title: $lte
349 description: >-
350 Filter by values less than or equal to this parameter. Useful for
351 numbers and dates only.
352 $like:
353 type: string
354 title: $like
355 description: Apply a `like` filter. Useful for strings only.
356 $re:
357 type: string
358 title: $re
359 description: Apply a regex filter. Useful for strings only.
360 $ilike:
361 type: string
362 title: $ilike
363 description: Apply a case-insensitive `like` filter. Useful for strings only.
364 $fulltext:
365 type: string
366 title: $fulltext
367 description: Filter to apply on full-text properties.
368 $overlap:
369 type: array
370 description: Filter arrays that have overlapping values with this parameter.
371 items:
372 type: string
373 title: $overlap
374 description: Filter arrays that have overlapping values with this parameter.
375 $contains:
376 type: array
377 description: Filter arrays that contain some of the values of this parameter.
378 items:
379 type: string
380 title: $contains
381 description: Filter arrays that contain some of the values of this parameter.
382 $contained:
383 type: array
384 description: Filter arrays that contain all values of this parameter.
385 items:
386 type: string
387 title: $contained
388 description: Filter arrays that contain all values of this parameter.
389 $exists:
390 type: boolean
391 title: $exists
392 description: Filter by whether a value for this parameter exists (not `null`).
393 title: updated_at
394 - name: deleted_at
395 in: query
396 description: Filter by a sales channel's deletion date.
397 required: false
398 schema:
399 type: object
400 description: Filter by a sales channel's deletion date.
401 properties:
402 $and:
403 type: array
404 description: >-
405 Join query parameters with an AND condition. Each object's content
406 is the same type as the expected query parameters.
407 items:
408 type: object
409 title: $and
410 $or:
411 type: array
412 description: >-
413 Join query parameters with an OR condition. Each object's content
414 is the same type as the expected query parameters.
415 items:
416 type: object
417 title: $or
418 $eq:
419 oneOf:
420 - type: string
421 title: $eq
422 description: Filter by an exact match.
423 - type: array
424 description: Filter by an exact match.
425 items:
426 type: string
427 title: $eq
428 description: Filter by an exact match.
429 $ne:
430 type: string
431 title: $ne
432 description: Filter by values not equal to this parameter.
433 $in:
434 type: array
435 description: Filter by values in this array.
436 items:
437 type: string
438 title: $in
439 description: Filter by values in this array.
440 $nin:
441 type: array
442 description: Filter by values not in this array.
443 items:
444 type: string
445 title: $nin
446 description: Filter by values not in this array.
447 $not:
448 oneOf:
449 - type: string
450 title: $not
451 description: >-
452 Filter by values not matching the conditions in this
453 parameter.
454 - type: object
455 description: >-
456 Filter by values not matching the conditions in this
457 parameter.
458 - type: array
459 description: >-
460 Filter by values not matching the conditions in this
461 parameter.
462 items:
463 type: string
464 title: $not
465 description: >-
466 Filter by values not matching the conditions in this
467 parameter.
468 $gt:
469 type: string
470 title: $gt
471 description: >-
472 Filter by values greater than this parameter. Useful for numbers
473 and dates only.
474 $gte:
475 type: string
476 title: $gte
477 description: >-
478 Filter by values greater than or equal to this parameter. Useful
479 for numbers and dates only.
480 $lt:
481 type: string
482 title: $lt
483 description: >-
484 Filter by values less than this parameter. Useful for numbers and
485 dates only.
486 $lte:
487 type: string
488 title: $lte
489 description: >-
490 Filter by values less than or equal to this parameter. Useful for
491 numbers and dates only.
492 $like:
493 type: string
494 title: $like
495 description: Apply a `like` filter. Useful for strings only.
496 $re:
497 type: string
498 title: $re
499 description: Apply a regex filter. Useful for strings only.
500 $ilike:
501 type: string
502 title: $ilike
503 description: Apply a case-insensitive `like` filter. Useful for strings only.
504 $fulltext:
505 type: string
506 title: $fulltext
507 description: Filter to apply on full-text properties.
508 $overlap:
509 type: array
510 description: Filter arrays that have overlapping values with this parameter.
511 items:
512 type: string
513 title: $overlap
514 description: Filter arrays that have overlapping values with this parameter.
515 $contains:
516 type: array
517 description: Filter arrays that contain some of the values of this parameter.
518 items:
519 type: string
520 title: $contains
521 description: Filter arrays that contain some of the values of this parameter.
522 $contained:
523 type: array
524 description: Filter arrays that contain all values of this parameter.
525 items:
526 type: string
527 title: $contained
528 description: Filter arrays that contain all values of this parameter.
529 $exists:
530 type: boolean
531 title: $exists
532 description: Filter by whether a value for this parameter exists (not `null`).
533 title: deleted_at
534 - name: location_id
535 in: query
536 required: false
537 schema:
538 oneOf:
539 - type: string
540 title: location_id
541 description: Filter by a location ID to retrieve its associated sales channels.
542 - type: array
543 description: >-
544 Filter by location IDs to retrieve their associated sales
545 channels.
546 items:
547 type: string
548 title: location_id
549 description: A location ID.
550 - name: publishable_key_id
551 in: query
552 required: false
553 schema:
554 oneOf:
555 - type: string
556 title: publishable_key_id
557 description: >-
558 Filter by a publishable API key's ID to retrieve its associated
559 sales channels.
560 - type: array
561 description: >-
562 Filter by publishable API key IDs to retrieve their associated
563 sales channels.
564 items:
565 type: string
566 title: publishable_key_id
567 description: A publishable API key ID.
568 - name: $and
569 in: query
570 required: false
571 schema:
572 type: array
573 description: >-
574 Join query parameters with an AND condition. Each object's content is
575 the same type as the expected query parameters.
576 items:
577 type: object
578 title: $and
579 - name: $or
580 in: query
581 required: false
582 schema:
583 type: array
584 description: >-
585 Join query parameters with an OR condition. Each object's content is
586 the same type as the expected query parameters.
587 items:
588 type: object
589 title: $or
590 - name: with_deleted
591 in: query
592 description: Whether to include deleted records in the result.
593 required: false
594 schema:
595 type: boolean
596 title: with_deleted
597 description: Whether to include deleted records in the result.
598 security:
599 - api_token: []
600 - cookie_auth: []
601 - jwt_token: []
602 x-codeSamples:
603 - lang: JavaScript
604 label: JS SDK
605 source:
606 $ref: ../code_samples/JavaScript/admin_sales-channels/get.js
607 - lang: Shell
608 label: cURL
609 source:
610 $ref: ../code_samples/Shell/admin_sales-channels/get.sh
611 tags:
612 - Sales Channels
613 responses:
614 '200':
615 description: OK
616 content:
617 application/json:
618 schema:
619 allOf:
620 - type: object
621 description: The paginated list of sales channels.
622 required:
623 - limit
624 - offset
625 - count
626 properties:
627 limit:
628 type: number
629 title: limit
630 description: The maximum number of items returned.
631 offset:
632 type: number
633 title: offset
634 description: >-
635 The number of items skipped before retrieving the returned
636 items.
637 count:
638 type: number
639 title: count
640 description: The total number of items.
641 - type: object
642 description: The paginated list of sales channels.
643 required:
644 - sales_channels
645 properties:
646 sales_channels:
647 type: array
648 description: The list of sales channels.
649 items:
650 $ref: ../components/schemas/AdminSalesChannel.yaml
651 '400':
652 $ref: ../components/responses/400_error.yaml
653 '401':
654 $ref: ../components/responses/unauthorized.yaml
655 '404':
656 $ref: ../components/responses/not_found_error.yaml
657 '409':
658 $ref: ../components/responses/invalid_state_error.yaml
659 '422':
660 $ref: ../components/responses/invalid_request_error.yaml
661 '500':
662 $ref: ../components/responses/500_error.yaml
663 post:
664 operationId: PostSalesChannels
665 summary: Create Sales Channel
666 description: Create a sales channel.
667 x-authenticated: true
668 parameters:
669 - name: fields
670 in: query
671 description: >-
672 Comma-separated fields that should be included in the returned data. if
673 a field is prefixed with `+` it will be added to the default fields,
674 using `-` will remove it from the default fields. without prefix it will
675 replace the entire default fields.
676 required: false
677 schema:
678 type: string
679 title: fields
680 description: >-
681 Comma-separated fields that should be included in the returned data.
682 if a field is prefixed with `+` it will be added to the default
683 fields, using `-` will remove it from the default fields. without
684 prefix it will replace the entire default fields.
685 externalDocs:
686 url: '#select-fields-and-relations'
687 security:
688 - api_token: []
689 - cookie_auth: []
690 - jwt_token: []
691 requestBody:
692 content:
693 application/json:
694 schema:
695 $ref: ../components/schemas/AdminCreateSalesChannel.yaml
696 x-codeSamples:
697 - lang: JavaScript
698 label: JS SDK
699 source:
700 $ref: ../code_samples/JavaScript/admin_sales-channels/post.js
701 - lang: Shell
702 label: cURL
703 source:
704 $ref: ../code_samples/Shell/admin_sales-channels/post.sh
705 tags:
706 - Sales Channels
707 responses:
708 '200':
709 description: OK
710 content:
711 application/json:
712 schema:
713 $ref: ../components/schemas/AdminSalesChannelResponse.yaml
714 '400':
715 $ref: ../components/responses/400_error.yaml
716 '401':
717 $ref: ../components/responses/unauthorized.yaml
718 '404':
719 $ref: ../components/responses/not_found_error.yaml
720 '409':
721 $ref: ../components/responses/invalid_state_error.yaml
722 '422':
723 $ref: ../components/responses/invalid_request_error.yaml
724 '500':
725 $ref: ../components/responses/500_error.yaml
726 x-workflow: createSalesChannelsWorkflow
727 x-events:
728 - name: sales-channel.created
729 payload: |-
730 ```ts
731 {
732 id, // The ID of the sales channel
733 }
734 ```
735 description: Emitted when sales channels are created.
736 deprecated: false