A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I want to use the `publishPublishable` mutation from the GraphQl Admin API, but I don't know how to acquire the `publicationId`s of my sales channels. Can anyone help?
https://shopify.dev/api/admin-graphql/2021-07/mutations/publishablePublish
Solved! Go to the solution
This is an accepted solution.
Hey @emiller
Have you tried querying the store's publications and using that to find your publication.id?
JamesG | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hey @emiller
Have you tried querying the store's publications and using that to find your publication.id?
JamesG | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks @JamesG , I just found that query. Thank you. I learned something else in addition, which is that you can only query that if you have the `read_subscriptions` permission, and that permission isn't available unless you request it (and maybe only on Plus stores).
So... I just tried some random json paths because of other similar posts I'd seen and found this:
https://admin.shopify.com/store/<YOUR_STORE_NAME>/publications.json
Mine looks like this:
{
"publications": [
{
"id": 92366267715,
"created_at": "2023-10-25T15:45:49-04:00",
"name": "Point of Sale"
},
{
"id": 92123456643,
"created_at": "2023-10-25T15:45:44-04:00",
"name": "Online Store"
},
{
"id": 92654321947,
"created_at": "2023-10-25T15:45:49-04:00",
"name": "Point of Sale"
}
]
}
Pretty convenient if you just need to grab the id to hard code in some config somewhere. I'm not sure if this is only available on Shopify Plus as mentioned in comments. I am testing this on a Plus store
I did confirm that he id for the Online Store matches what the GraphQL Admin API returns.
gid://shopify/Publication/92123456643
I have no idea why there are two Point of Sales 😃