Sales Channels API Routes
A sales channel indicates a channel where products can be sold in. For example, a webshop or a mobile app.
These API routes allow admins to manage sales channels and the products available in them.
GET /admin/sales-channels#
List Sales Channels
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.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]Optionalnamestring | string[]OptionaldescriptionstringOptionalis_disabledbooleanOptionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionallocation_idstring | string[]Optionalpublishable_key_idstring | string[]Optional$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumbersales_channelsobject[]The list of sales channels.
sales_channelsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/sales-channels#
Create Sales Channel
Create a sales channel.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
namestringdescriptionstringOptionalis_disabledbooleanOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
sales_channelobjectThe sales channel's details.
sales_channelobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
sales-channel.created: Emitted when sales channels are created.
GET /admin/sales-channels/{id}#
Get a Sales Channel
Retrieve a sales channel by its ID. You can expand the sales channel's relations or select the fields that should be returned.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
sales_channelobjectThe sales channel's details.
sales_channelobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/sales-channels/{id}#
Update a Sales Channel
Update a sales channel's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
namestringOptionaldescriptionstringOptionalis_disabledbooleanOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
sales_channelobjectThe sales channel's details.
sales_channelobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
sales-channel.updated: Emitted when sales channels are updated.
DELETE /admin/sales-channels/{id}#
Delete a Sales Channel
Delete a sales channel.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "sales-channel"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
sales-channel.deleted: Emitted when sales channels are deleted.
POST /admin/sales-channels/{id}/products#
Manage Products in Sales Channel
Manage products in a sales channel to add or remove them from the channel.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
addstring[]Optionalremovestring[]OptionalRequest examples
Responses
200 OK
sales_channelobjectThe sales channel's details.
sales_channelobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product.updated: Emitted when products are updated.