I’m looking to filter products and variants based on if they are published in the POS sales channel, I can see that there is a published_status query keyword that accepts an online_store_channel value, but there doesn’t seem to be a corresponding value for point_of_sale_channel which seems like an oversight to me.
So without a shortcut it appears that I need to instead get the POS sales channel publication ID by first querying the store’s publications, but I’m wondering how I reliably determine that a publication is for the POS channel? Just look for the presence of the works “Point of Sale” in the title? That seems flakey to me…
Please let me know if there is a better way to do this seems overly complicated for what is part of the core Shopify platform.
I did some digging here, and you don’t need to identify POS by matching the publication title or maintain publication IDs for each shop.
The published_status filter accepts a channel app handle followed by -published. While the reference doesn’t enumerate the handle for every Shopify channel (which is why you only saw online_store_channel in the docs and nothing for POS), an app can query the app catalogs available on that shop and build the valid filters itself. You can use a query like this:
On a POS-enabled shop, this query should return the handle pos, producing published_status:pos-published. Building the filter from the returned handle avoids relying on publication titles or shop-specific publication IDs.
published_status:pos-published
That filter works with both products and productVariants, for example:
query PosPublishedResources {
products(
first: 100
query: "published_status:pos-published"
) {
nodes {
id
title
}
}
productVariants(
first: 100
query: "published_status:pos-published"
) {
nodes {
id
title
sku
}
}
}
Hi @Wes-Dev-Shopify thanks for the response, by the looks of it the handle varies as on my dev store the handle is pos not point-of-sale-channel. So if there are other variants out there then this method would be unreliable. We need a way to determine the POS channel without user intervention, so if the handle changes over time, which it appears to do, this solution won’t work.
I think there should be a reliable way to do this, like we already have via the online_store_channel handle, there should be a point_of_sale_channel handle.
Hey @simon_b - thanks for following up and catching that. You’re right: the POS app handle is pos, not point-of-sale-channel, so the handle-based filter is published_status:pos-published. I’m going to update my earlier post to correct it and avoid confusion for others reading the thread.
Although the POS handle is consistent across shops, you can also use the channel app ID. The published_status filter accepts a channel app ID followed by -published.
In the response from the SalesChannelHandles query, the POS app ID is gid://shopify/App/129785. The filter uses only the numeric portion:
query PosPublishedResources {
products(first: 100, query: "published_status:129785-published") {
nodes {
id
title
}
}
productVariants(first: 100, query: "published_status:129785-published") {
nodes {
id
title
sku
}
}
}
Here, 129785 is the channel app ID, not a shop-specific Publication ID. It identifies the POS app itself and remains the same across shops. This filter format is supported by both products (products - GraphQL Admin) and productVariants (productVariants - GraphQL Admin).
Hi @Wes-Dev-Shopify yes that makes sense, so we can rely on the handle being pos across all stores then? Like we can rely on online_store_channel working across the all stores?
For example I have a new merchant start using my app, my application needs to pull a list of products that are published on the POS channel, can I use published_status:pos-published or do I need to first perform the SalesChannelHandles query and look for the POS app in there?
EDIT -
If I do need to perform the SalesChannelHandles query and look for the POS app, how do I match it programmatically?
Hey @simon_b - yes, exactly. You can rely on pos being the POS app handle across shops and use published_status:pos-published directly. You don’t need to run the SalesChannelHandles query first for each new merchant.
I included that query as an example of how to inspect the available channel apps because the POS handle and app ID aren’t currently documented in the public API reference. The published_status documentation describes the generic channel handle and ID syntax, but the query isn’t a required discovery step.
Hi @Wes-Dev-Shopify sorry one more question, I’m attempting to use the channelByHandle query using that handle and getting null response, shouldn’t this return the POS channel?