Embedded app read_publications and write_publications

Martinbaste
Tourist
4 0 1

Hi,

 

I'm developing an application using the Embedded App SDK and I'd like for it to be able to publish products. For this, if I understand correctly, I need read_publications and write_publications access. 

I've found no way of obtaining this. 

I asked support about this and they said they can provide immediate access to Private applications. However, I havent found a way to make my application private or to create a private Embedded App application (the app is for a single client so Private is fine). I contacted the Partners Team through chat and they couldn't help, they told me to ask here.

So, whats' next? Am I missing something?

Shopify staff: any way we can have an embedded app with read/write_publications access?

Other developers: Have you been able to publish products using an embedded app?

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 194

Hey @Martinbaste , 

 

These scopes are only available to public apps that are also sales channels with their own channel to publish products to - for other public apps, these scopes are not available. 

 

At the same time, private apps do not have the ability to be embedded apps, or even apps with an interface on a shop for that matter - embedded app functionality is only available to public apps that are configured through the Partner Dashboard since that is where app extensions (Embedded App SDK, etc.) are available. 

 

Ultimately, there is no way to be a public app that is not a sales channel with these scopes, but there is no way to be a private app that is embedded either - nor a way to convert a public app to a private one. You would need to create a new, non-embedded private app that would then be granted these scopes.

0 Likes
Martinbaste
Tourist
4 0 1

Thanks for the thorough answer @Josh . That clears things up.

 

Now, for the situation that originated these questions: Is it possible to publish a product into the regular Shopify web store with a public app using Embedded App SDK? In that case, how?

 

I am developing a simple application to import products from a specific source and it'd be ideal if it was possible to publish products from within the Embedded app. Otherwise the workflow is: (1) create the products in the embedded app, (2) go to the product section of the admin dashboard and make the products available.

 

Thanks in advance

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 194

Hey again @Martinbaste , 

 

If you only need to publish to the online store, products should be made available on the online store by default when they're created. 

 

If a product has been hidden, however, you should still be able to publish to the online store with a PUT request containing 'published: "true"'

0 Likes
Martinbaste
Tourist
4 0 1

Hi @Josh ,

 

Thanks for the info, I should have mentioned that I'm using the graphQL API, and in that case the products seem to be unpublished by default, and need to be published with the publishablePublish mutation. Is this correct? For this, I'd need to know the id of the store publication and have write permission to publish to the store, or am I missing something?

 

Thank you for the help so far.

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 194

Hey again @Martinbaste , 

 

Interesting, if a product isn't published you could publish it with the publishablePublish mutation, that's correct. I have a couple examples here that should help with that : 

 

mutation {
  publishablePublish(id: "gid://shopify/Product/1931630510136", input: {publicationId: "gid://shopify/Publication/52220", publishDate: "2019-09-16T10:25:56-04:00"}) {
    publishable {
      publicationCount
      resourcePublications(first: 5) {
        edges {
          node {
            isPublished
            publication {
              id
              name
            }
          }
        }
      }
    }
  }
}

And then to get the publication ID : 

 

{
  publications(first: 10) {
    edges {
      node {
        id
        name
      }
    }
  }
}

 

0 Likes
ODA_Shop
New Member
1 0 0

I'm running into this issue as well. I need access to the publications, but I cannot find anywhere to set read_publications. I've searched through the docs, I've tried in the admin pages for our private app for our store, but It is not listed anywhere. How are we supposed to manage publications?

If I run this:

 

 

{
  publications(first: 10) {
    edges {
      node {
        id
        name
      }
    }
  }
}

 

 
I get this:
 

 

{
    "data": null,
    "errors": [
        {
            "message": "Access denied for publications field. Required access: `read_publications` access scope.  This scope is currently available only to private apps installed on Shopify Plus stores.",
            "locations": [
                {
                    "line": 3,
                    "column": 3
                }
            ],
            "path": [
                "publications"
            ],
            "extensions": {
                "code": "ACCESS_DENIED",
                "documentation": "https://shopify.dev/docs/admin-api/access-scopes",
                "requiredAccessScope": "read_publications"
            }
        }
    ],
    "extensions": {
        "cost": {
            "requestedQueryCost": 12,
            "actualQueryCost": 2,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 998,
                "restoreRate": 50.0
            }
        }
    }
}

 

0 Likes
HunkyBill
Shopify Expert
4491 45 486

You got it. You cannot get this scope. Basically, we are unable to play with publications due to Shopify restrictions. Trust me, it sucks. But there are so few of us that have this need, it is hard to make enough noise to get their attention and point out the oversight.

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes