> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/medusajs/medusa/llms.txt
> Use this file to discover all available pages before exploring further.

# Sales Channel Module

> Learn about the Sales Channel Module and how to manage multiple sales channels in Medusa.

## Overview

The Sales Channel Module manages different sales channels for your commerce operations. Sales channels allow you to organize products, orders, and inventory across different storefronts, marketplaces, or distribution channels.

**Key Features:**

* Multiple sales channel support
* Channel-specific product availability
* Channel-based order tracking
* Inventory management per channel
* Channel metadata and customization

## When to Use

Use the Sales Channel Module when you need to:

* Manage multiple storefronts (web, mobile app, etc.)
* Sell on different marketplaces
* Separate B2B and B2C channels
* Track sales by channel
* Control product availability per channel
* Support multi-brand commerce
* Implement channel-specific pricing or promotions

## Data Models

### SalesChannel

Represents a sales channel or storefront.

<ResponseField name="id" type="string" required>
  Unique sales channel identifier
</ResponseField>

<ResponseField name="name" type="string" required>
  Sales channel name
</ResponseField>

<ResponseField name="description" type="string">
  Sales channel description
</ResponseField>

<ResponseField name="is_disabled" type="boolean">
  Whether the channel is disabled (default: false)
</ResponseField>

<ResponseField name="metadata" type="object">
  Additional custom data
</ResponseField>

## Service Interface

The Sales Channel Module service is available at `@medusajs/medusa/sales-channel`.

### Create Sales Channel

Create a new sales channel.

<CodeGroup>
  ```typescript Example theme={null}
  import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
  import { ISalesChannelModuleService } from "@medusajs/framework/types"
  import { Modules } from "@medusajs/framework/utils"

  export async function POST(
    req: MedusaRequest,
    res: MedusaResponse
  ) {
    const salesChannelModuleService: ISalesChannelModuleService = req.scope.resolve(
      Modules.SALES_CHANNEL
    )

    const salesChannel = await salesChannelModuleService.createSalesChannels({
      name: "Mobile App",
      description: "iOS and Android mobile applications",
      is_disabled: false,
    })

    res.json({ sales_channel: salesChannel })
  }
  ```
</CodeGroup>

<ParamField path="data" type="CreateSalesChannelDTO | CreateSalesChannelDTO[]" required>
  Sales channel data

  <ParamField path="name" type="string" required>
    Sales channel name
  </ParamField>

  <ParamField path="description" type="string">
    Sales channel description
  </ParamField>

  <ParamField path="is_disabled" type="boolean">
    Whether to disable the channel
  </ParamField>

  <ParamField path="metadata" type="object">
    Custom metadata
  </ParamField>
</ParamField>

<ResponseField name="salesChannel" type="SalesChannelDTO | SalesChannelDTO[]">
  The created sales channel(s)
</ResponseField>

### Retrieve Sales Channel

Get a sales channel.

<CodeGroup>
  ```typescript Example theme={null}
  const salesChannel = await salesChannelModuleService.retrieveSalesChannel(
    "sc_mobile"
  )

  console.log(salesChannel.name) // "Mobile App"
  ```
</CodeGroup>

<ParamField path="salesChannelId" type="string" required>
  The ID of the sales channel to retrieve
</ParamField>

<ParamField path="config" type="FindConfig">
  Configuration for the query
</ParamField>

<ResponseField name="salesChannel" type="SalesChannelDTO">
  The retrieved sales channel
</ResponseField>

### List Sales Channels

List all sales channels.

<CodeGroup>
  ```typescript Example theme={null}
  const salesChannels = await salesChannelModuleService.listSalesChannels({
    is_disabled: false,
  })

  for (const channel of salesChannels) {
    console.log(channel.name)
  }
  ```
</CodeGroup>

<ParamField path="filters" type="FilterableSalesChannelProps">
  Filters to apply

  <ParamField path="id" type="string | string[]">
    Filter by sales channel IDs
  </ParamField>

  <ParamField path="name" type="string | string[]">
    Filter by name
  </ParamField>

  <ParamField path="is_disabled" type="boolean">
    Filter by disabled status
  </ParamField>
</ParamField>

<ResponseField name="salesChannels" type="SalesChannelDTO[]">
  Array of sales channels
</ResponseField>

### Update Sales Channel

Modify a sales channel.

<CodeGroup>
  ```typescript Example theme={null}
  const salesChannel = await salesChannelModuleService.updateSalesChannels(
    "sc_mobile",
    {
      description: "Updated mobile app channel",
      is_disabled: false,
    }
  )
  ```
</CodeGroup>

<ParamField path="salesChannelId" type="string" required>
  ID of the sales channel to update
</ParamField>

<ParamField path="data" type="UpdateSalesChannelDTO" required>
  Fields to update

  <ParamField path="name" type="string">
    Sales channel name
  </ParamField>

  <ParamField path="description" type="string">
    Description
  </ParamField>

  <ParamField path="is_disabled" type="boolean">
    Whether to disable
  </ParamField>
</ParamField>

### Delete Sales Channel

Remove a sales channel.

<CodeGroup>
  ```typescript Example theme={null}
  await salesChannelModuleService.deleteSalesChannels(["sc_old"])
  ```
</CodeGroup>

## Integration Examples

### With Product Module

Associate products with sales channels.

<CodeGroup>
  ```typescript Example theme={null}
  import { Modules } from "@medusajs/framework/utils"

  const productModule = container.resolve(Modules.PRODUCT)
  const salesChannelModule = container.resolve(Modules.SALES_CHANNEL)

  // Create sales channels
  const webChannel = await salesChannelModule.createSalesChannels({
    name: "Website",
  })

  const appChannel = await salesChannelModule.createSalesChannels({
    name: "Mobile App",
  })

  // Products are linked to sales channels via workflows
  // or Link Modules in Medusa
  ```
</CodeGroup>

### With Cart Module

Create carts for specific channels.

<CodeGroup>
  ```typescript Example theme={null}
  import { Modules } from "@medusajs/framework/utils"

  const cartModule = container.resolve(Modules.CART)
  const salesChannelModule = container.resolve(Modules.SALES_CHANNEL)

  // Get sales channel
  const salesChannel = await salesChannelModule.retrieveSalesChannel("sc_web")

  // Create cart for channel
  const cart = await cartModule.createCarts({
    sales_channel_id: salesChannel.id,
    currency_code: "usd",
    email: "customer@example.com",
  })
  ```
</CodeGroup>

### With Order Module

Track orders by sales channel.

<CodeGroup>
  ```typescript Example theme={null}
  import { Modules } from "@medusajs/framework/utils"

  const orderModule = container.resolve(Modules.ORDER)

  // List orders for specific channel
  const orders = await orderModule.listOrders({
    sales_channel_id: "sc_mobile",
  })

  console.log(`${orders.length} orders from mobile app`)
  ```
</CodeGroup>

### With Inventory Module

Channel-specific inventory availability.

<CodeGroup>
  ```typescript Example theme={null}
  import { Modules } from "@medusajs/framework/utils"

  const inventoryModule = container.resolve(Modules.INVENTORY)

  // Check inventory available for channel
  // (via product-sales channel links)
  const availableQuantity = await inventoryModule.retrieveAvailableQuantity(
    "iitem_123",
    ["sloc_warehouse"]
  )
  ```
</CodeGroup>

## Common Use Cases

### Multi-Storefront

<CodeGroup>
  ```typescript Example theme={null}
  // Main website
  const webChannel = await salesChannelModuleService.createSalesChannels({
    name: "Website",
    description: "Main e-commerce website",
  })

  // Mobile app
  const appChannel = await salesChannelModuleService.createSalesChannels({
    name: "Mobile App",
    description: "iOS and Android apps",
  })

  // Physical stores
  const storeChannel = await salesChannelModuleService.createSalesChannels({
    name: "Retail Stores",
    description: "Point of sale systems in physical locations",
  })
  ```
</CodeGroup>

### Marketplace Integration

<CodeGroup>
  ```typescript Example theme={null}
  // Amazon
  const amazonChannel = await salesChannelModuleService.createSalesChannels({
    name: "Amazon",
    description: "Amazon marketplace integration",
    metadata: {
      marketplace: "amazon",
      seller_id: "ABC123",
    },
  })

  // eBay
  const ebayChannel = await salesChannelModuleService.createSalesChannels({
    name: "eBay",
    description: "eBay marketplace integration",
    metadata: {
      marketplace: "ebay",
      store_name: "MyStore",
    },
  })
  ```
</CodeGroup>

### B2B vs B2C

<CodeGroup>
  ```typescript Example theme={null}
  // B2C channel
  const b2cChannel = await salesChannelModuleService.createSalesChannels({
    name: "Retail",
    description: "Direct to consumer sales",
    metadata: {
      type: "b2c",
    },
  })

  // B2B channel
  const b2bChannel = await salesChannelModuleService.createSalesChannels({
    name: "Wholesale",
    description: "Business to business sales",
    metadata: {
      type: "b2b",
      minimum_order: 1000,
    },
  })
  ```
</CodeGroup>

### Multi-Brand

<CodeGroup>
  ```typescript Example theme={null}
  // Brand A
  const brandAChannel = await salesChannelModuleService.createSalesChannels({
    name: "Brand A Store",
    description: "Premium brand storefront",
    metadata: {
      brand: "brand-a",
    },
  })

  // Brand B
  const brandBChannel = await salesChannelModuleService.createSalesChannels({
    name: "Brand B Store",
    description: "Economy brand storefront",
    metadata: {
      brand: "brand-b",
    },
  })
  ```
</CodeGroup>

## Best Practices

1. **Channel Naming**: Use clear, descriptive names that identify the channel's purpose ("Website", "Mobile App", "Amazon", etc.).

2. **Metadata Usage**: Store channel-specific configuration in metadata:
   * API credentials for marketplace integrations
   * Channel type (b2b, b2c, marketplace)
   * Brand identifiers
   * Custom settings

3. **Default Channel**: Create a default sales channel for your primary storefront during initial setup.

4. **Disabled Channels**: Use `is_disabled` instead of deleting channels to maintain historical data and reporting.

5. **Product Availability**: Control which products appear in each channel using product-sales channel links (managed via workflows).

6. **Analytics**: Track performance by channel by filtering orders, carts, and sales data by `sales_channel_id`.

7. **Channel Context**: Always include `sales_channel_id` when:
   * Creating carts
   * Creating orders
   * Checking product availability
   * Calculating prices

## Related Modules

* [Product Module](/modules/product) - Control product availability per channel
* [Cart Module](/modules/cart) - Create channel-specific carts
* [Order Module](/modules/order) - Track orders by channel
* [Inventory Module](/modules/inventory) - Channel inventory management
