Im trying to make a product available on a sales channel. For context, I have already created the product via the APIs but they dont seem to be available on a sales channel by default. To do so, im using the publishablePublish mutation.
While using the publishablePublish mutation, it requires a publishing ID as a part of the variables in order to publish the resource to a particular sales channel. But how can we figure out what is the publishing id for a particular sales channel? Example, the defaulted “Online Sales Channel”.
I tried going through the publications type to see if I can find anything but it does not have a title/name to distinguish a sales channel. Used the following query. Catalog type does have a title property but it returns a null value always.
publications(first: 10) {
nodes {
id
autoPublish
catalog {
id
status
title
}
}
}
Is there a way to get the title of the publication so that I know which publication ID is associated to a sales channel?
Hey @sivansundar - this is definitely a tricky one. There’s not a simple way to grab the Sales Channel name, but it’s usually tied to the Sales Channel app’s handle which we can grab through fragmenting the query. Here’s a quick example:
query saleschannelname {
publications(first: 10, catalogType: APP) {
nodes {
id
catalog {
id
... on AppCatalog {
apps(first: 10) {
nodes {
id
handle
}
}
}
}
}
}
}