Is there a way to publish product to online store via private APP?

Solved
OpticalLink
Tourist
9 2 0

These days I was tried to develop my own Shopify store and I feel very disappointment to Shopify platform.

There are hundreds of product need to be put on the shelf. Since the import function in Store Admin page is not stable and frequently fail with Chinese and German characters, I have to develop a private APP to import my products.

 

BUT, Shopify close the door for Shopify Basic customers.

During API document, product can be published to channels. There are several ways to publish products. 

For example, the owner can use "productPublications" parameter in mutation productCreate., or to use standalone mutation publishablePublishToCurrentChannel.

 

The fact is, Shopify GraphQL server disable read_publications access scope for Shopify Basic customers. This means either "productPublications" parameter in mutation productCreate or  mutation publishablePublishToCurrentChannel are not available for Shopify Basic customers via private APP.

The only way is to publish all products in Shopify store owner's admin page one by one.

 

Is there any way to publish product to online store via private APP?

Note: Shopify Plus plan costs $2000 per month.  So the solution should available for Shopify Basic users.

 

Thanks a lot.

 

Accepted Solutions (2)

Accepted Solutions
OpticalLink
Tourist
9 2 0

This is an accepted solution.

After check the product status, the product is published successful.

The problem is solved.

 

The returne message afer excute publishablePublishToCurrentChannel makes me misunderstand. It is the weekness of GraphQL. It shows a error, but the error is actually refer to query, not refer to update process.

 

mutation publishablePublishToCurrentChannel($id: ID!) {
  publishablePublishToCurrentChannel(id: $id) {
    publishable {
      availablePublicationCount
      publicationCount
      publishedOnCurrentPublication
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

{"data":{"publishablePublishToCurrentChannel":{"publishable":null,"shop":{"id":"gid:\/\/shopify\/Shop\/_______"},"userErrors":[]}},"errors":[{"message":"Access denied for availablePublicationCount field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app.","locations":[{"line":5,"column":13}],"path":["publishablePublishToCurrentChannel","publishable","availablePublicationCount"],"extensions":{"code":"ACCESS_DENIED","documentation":"https:\/\/shopify.dev\/api\/usage\/access-scopes","requiredAccessScope":"`read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app."}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}

 

After remove "publishable" parameter, the result is OK. 

View solution in original post

OpticalLink
Tourist
9 2 0

This is an accepted solution.

After check product, my test to publish product is successed. So the problem is solved.

The "productPublications" parameter in mutation productCreate is not avaviable anyway, because read_publications access scope is removed from Shopify Basic customers.

Another way to mutation publishablePublishToCurrentChannel is still available for Shopify Basic customers via private APP.

 

The reason for the misunderstanding of mutation publishablePublishToCurrentChannel is the ambiguous return of GraphQL call. Actually GraphQL mutation includes two requests in one query, one is update and another is query.

In my test case, mutation publishablePublishToCurrentChannel is successed to update but failed to query, so there is error message in result.

 

Here is my test mutation:

 mutation publishablePublishToCurrentChannel($id: ID!) {
  publishablePublishToCurrentChannel(id: $id) {
    publishable {
      availablePublicationCount
      publicationCount
      publishedOnCurrentPublication
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

And the result:

'{"data":{"publishablePublishToCurrentChannel":{"publishable":null,"shop":{"id":"gid:\\/\\/shopify\\/Shop\\/______"},"userErrors":[]}},"errors":[{"message":"Access denied for availablePublicationCount field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app.","locations":[{"line":1,"column":117}],"path":["publishablePublishToCurrentChannel","publishable","availablePublicationCount"],"extensions":{"code":"ACCESS_DENIED","documentation":"https:\\/\\/shopify.dev\\/api\\/usage\\/access-scopes","requiredAccessScope":"`read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app."}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}'

 GraphQL should return two results that map to seprate update and query request.

 

View solution in original post

Replies 4 (4)
OpticalLink
Tourist
9 2 0

This is an accepted solution.

After check the product status, the product is published successful.

The problem is solved.

 

The returne message afer excute publishablePublishToCurrentChannel makes me misunderstand. It is the weekness of GraphQL. It shows a error, but the error is actually refer to query, not refer to update process.

 

mutation publishablePublishToCurrentChannel($id: ID!) {
  publishablePublishToCurrentChannel(id: $id) {
    publishable {
      availablePublicationCount
      publicationCount
      publishedOnCurrentPublication
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

{"data":{"publishablePublishToCurrentChannel":{"publishable":null,"shop":{"id":"gid:\/\/shopify\/Shop\/_______"},"userErrors":[]}},"errors":[{"message":"Access denied for availablePublicationCount field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app.","locations":[{"line":5,"column":13}],"path":["publishablePublishToCurrentChannel","publishable","availablePublicationCount"],"extensions":{"code":"ACCESS_DENIED","documentation":"https:\/\/shopify.dev\/api\/usage\/access-scopes","requiredAccessScope":"`read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app."}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}

 

After remove "publishable" parameter, the result is OK. 

View solution in original post

OpticalLink
Tourist
9 2 0

This is an accepted solution.

After check product, my test to publish product is successed. So the problem is solved.

The "productPublications" parameter in mutation productCreate is not avaviable anyway, because read_publications access scope is removed from Shopify Basic customers.

Another way to mutation publishablePublishToCurrentChannel is still available for Shopify Basic customers via private APP.

 

The reason for the misunderstanding of mutation publishablePublishToCurrentChannel is the ambiguous return of GraphQL call. Actually GraphQL mutation includes two requests in one query, one is update and another is query.

In my test case, mutation publishablePublishToCurrentChannel is successed to update but failed to query, so there is error message in result.

 

Here is my test mutation:

 mutation publishablePublishToCurrentChannel($id: ID!) {
  publishablePublishToCurrentChannel(id: $id) {
    publishable {
      availablePublicationCount
      publicationCount
      publishedOnCurrentPublication
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

And the result:

'{"data":{"publishablePublishToCurrentChannel":{"publishable":null,"shop":{"id":"gid:\\/\\/shopify\\/Shop\\/______"},"userErrors":[]}},"errors":[{"message":"Access denied for availablePublicationCount field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app.","locations":[{"line":1,"column":117}],"path":["publishablePublishToCurrentChannel","publishable","availablePublicationCount"],"extensions":{"code":"ACCESS_DENIED","documentation":"https:\\/\\/shopify.dev\\/api\\/usage\\/access-scopes","requiredAccessScope":"`read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app."}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}'

 GraphQL should return two results that map to seprate update and query request.

 

View solution in original post

OpticalLink
Tourist
9 2 0

So strange. If a reply is accepted as solution, then the reply will be hidden.

 

Here is the copy of reply message:

 

After check product, my test to publish product is successed. So the problem is solved.

The "productPublications" parameter in mutation productCreate is not avaviable anyway, because read_publications access scope is removed from Shopify Basic customers.

Another way to mutation publishablePublishToCurrentChannel is still available for Shopify Basic customers via private APP.

 

The reason for the misunderstanding of mutation publishablePublishToCurrentChannel is the ambiguous return of GraphQL call. Actually GraphQL mutation includes two requests in one query, one is update and another is query.

In my test case, mutation publishablePublishToCurrentChannel is successed to update but failed to query, so there is error message in result.

 

Here is my test mutation:

 mutation publishablePublishToCurrentChannel($id: ID!) {
  publishablePublishToCurrentChannel(id: $id) {
    publishable {
      availablePublicationCount
      publicationCount
      publishedOnCurrentPublication
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

And the result:

'{"data":{"publishablePublishToCurrentChannel":{"publishable":null,"shop":{"id":"gid:\\/\\/shopify\\/Shop\\/______"},"userErrors":[]}},"errors":[{"message":"Access denied for availablePublicationCount field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app.","locations":[{"line":1,"column":117}],"path":["publishablePublishToCurrentChannel","publishable","availablePublicationCount"],"extensions":{"code":"ACCESS_DENIED","documentation":"https:\\/\\/shopify.dev\\/api\\/usage\\/access-scopes","requiredAccessScope":"`read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores. Contact Shopify Partner Support to enable the scope for your app."}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}'

 GraphQL should return two results that map to seprate update and query request.

OpticalLink
Tourist
9 2 0

It is so strange that all the replies to orignal message is been deleted or hidden.

I posted the problem, and then I found the solution to solve the problem by myself.

But all replies with solution is been deleted.

 

What is the problem of this discussion forum?