Sales Channels
Queries and Mutations listed here are used to send requests to the Admin Sales Channel API Routes.
All hooks listed require authentication.
A sales channel indicates a channel where products can be sold in. For example, a webshop or a mobile app. Admins can manage sales channels and the products available in them.
Related Guide: How to manage sales channels.
Mutations
useAdminCreateSalesChannel
This hook creates a sales channel.
Example
import React from "react"
import { useAdminCreateSalesChannel } from "medusa-react"
const CreateSalesChannel = () => {
const createSalesChannel = useAdminCreateSalesChannel()
// ...
const handleCreate = (name: string, description: string) => {
createSalesChannel.mutate({
name,
description,
}, {
onSuccess: ({ sales_channel }) => {
console.log(sales_channel.id)
}
})
}
// ...
}
export default CreateSalesChannel