Building a shopify private or public app - shopify

I am trying to make a plan to update my client's shopify stores by building Shopify app or using external library. Basically, I want to provide my clients with some convenience by automating the inventory update, order process and extra stuff.
For now, I have only two scenarios.
Whenever my wholesale inventory changes, i want to update my client's shopify product list to be updated (quantity, price and product description) accordingly.
Whenever my client(shopify store owner) receives an order from his/her customer, i want the order information to be automatically transferred to my server.
If possible, I want my clients to be able to integrate with my application without any tech knowledge. I have looked into the Shopify app (public/private) and some external API(java), because I am a java developer.
I checked Shopify Java library which requires api key and password to be able to access shopify owner's store for product/order access, but I am not sure how user-friendly this approach is in terms of Shopify owner's side.
For Shopify public app, I am not familiar with it, so I am not sure how much I can do with it.
Could somebody provide some details about pros/cons about these approaches?
Thanks.

All you need to know is that with Shopify, you can connect to their shop using standard HTTPS. Even better, it's all GraphQL now. As for credentials, Shopify is fully modern and offers you two methods of getting credentials.
Your merchant client can create credentials with permissions right inside their Shopify Admin -> Apps. They give you the keys, you're in business
You get them (or you) to simply click install your App running at some HTTPS address, and you use oAuth to get the credentials.
Either way, makes no difference to the actual code you write to interact with their shop and deal with inventory, sales etc. You do not need to make your App public in the sense of App store, so you can use your partner dashboard to create an App and oAuth install, or like I said, use the private App way.

Related

Connect API to Shopify

I have searched for tons of threads here in Stack Overflow but I can't seem to find the fitting or direct answers.
So we would like to fetch products from API of external (outside Shopify) source then upload them to Shopify. Is there a way to do this without creating an app? This external source API provides already data in Shopify format.
Thanks!
In the Shopify store you wish to add these products to, you can create an access token with permission to create products. Using that token, you are free to make API calls to the Shopify store, with the data representing products, to create products in the Shopify store. Very simple pattern. Takes about 30 seconds of your time to create the access token in the Shopify store admin.
No you have to create APP for it.
As per latest updates from Shopify, you need to create "Custom App" atleast to get the Access Tokens and API keys, because Shopify has depreciated "Private apps" They work like Private apps, as those apps are specific to only one store, but these apps can give you all the needed permission to Create and Fetch Products.
You can create new apps from admin panel here: [YourStoreDomain]/admin/settings/apps/development
Documentations realated to it is: https://help.shopify.com/en/manual/apps/custom-apps
From Shopify: https://help.shopify.com/en/manual/apps/private-apps
Note Private apps are deprecated and can't be created as of January
2022. Ask your app developer to create a custom app. Like private apps, custom apps are built exclusively for your shop, but they don't
require open API access to your store or access to your Shopify admin.

Long living Shopify token

We are working on a system which retrieves data from customers' Shopify shops and provides some services based on this data. In order to make it as convenient as possible for an end-user we would like to update this data on a daily\weekly\monthly basis.
For now we only came up with a solution of implementing unlisted app, prompt a user to provide all necessary permissions for the app to access their shops and fetch the data. But the token we get doesn't seem to be valid for a long time and we probably won't be able to reuse it a day later.
We appreciate it if you can share any success cases of implementing this kind of approach.
You provide an App to the merchant they can install using oAuth. When the merchant is prompted to approve the App, Shopify will then provide your App with a long-lived access token you can use as much as you want, for as long as you want. I use a custom App from my Partner App dashboard to create these kinds of one-off Apps. It is superior to the one where the merchant has to tick off scopes and permissions IMO.
There are two kinds of token you can ask for and receive. One is considered for offline access, or long-lived. It works for everything. It is for webhooks as an example, or other access where no person is involved. But, there is also, online access tokens! Say a person clicks into the App from Shopify to do some work. You can request an online token for them to do their thing, and that token is only good for say 24 hours.
So you have options!

Is It Possible To Use An External Database For User Data & Login Credentials With Shopify?

Our client has asked us to build a Shopify site that ties into their in-house customer db (with or without using Salesforce). Is this even possible? Does Shopify support any method of cross-site database querying?
The only thing I can think of to accomplish this is to write a webhook on their in-house server with a simple read-only mini DB query API. However, as that I'm not super familiar with Shopify's more obscure capabilities (and having already spent quite some time sifting through their docs and running google searches on the matter with absolutely zero results), I'm not even sure if this is possible.
Are we barking up an impossible tree, or is this something that can actually be accomplished?
Thank you in advance for any help you can give.
What I have understood from your description is you already have an external database with user login details and you want to use the same for authentication in Shopify. If yes, then it is possible with Shopify Multipass feature. This feature is only available for Shopify Plus plans. From the Shopify Multipass docs
Multipass login is for store owners who have a separate website and a
Shopify store. It redirects users from the website to the Shopify
store and seamlessly logs them in with the same email address they
used to sign up for the original website. If no account with that
email address exists yet, one is created. There is no need to
synchronize any customer databases.
For your particular scenario, you would have to validate user credentials with your external database, generate multipass url and redirect.
Yes your requirement is quite possible. But the method i am going to mention is a hack basically. Below are the steps:
Create Login page/Account creation page in Shopify
When the user does a login/create account you send the information to your server via below methods
JSONP request
Creating a iframe of your domain and passing the information in the iframe
Now, you validate the user credentials at your server
After validating you check if the user is present in Shopify. If not you create the user with a password. API Link
Make sure you save the user password you push into Shopify at your end also.
Now when you have completed authentication of the user, return back Shopify username and password
Create a hidden form in Shopify liquid file and pass the credentials in the respective fields and submit the form and user should be able to log in with the existing password they have!

When a Shopify store customer has logged in to his account on the store I want also make him log into my Shopify app

I have developed a Shopify app, I wonder if we can perform the following functionality :
when a customer has logged in to his account on the store I want to also log him into my app, in another word I want to make a customer account is the same as his account on my app.
One thing you know. A customer logged into a Shopify store has a visible ID to Javascript. You could thus use an App Proxy to securely pass back their ID to your App. Using that ID, you can offer functionality to that customer, in your App. As long as you restrict access to the Proxy, you'd be A-Ok security wise.
If you wanted to allow access to the App without Proxy calls, you'll have to put into place your own security, which as we know from experience, will likely be weak and or a calamity. Most people should never roll their own security patterns. If they login to the App, without Shopify Plus Multipass, you cannot log them into Shopify. So you have no other options AFAIK.

How to let my customers login to Shopify via third-party account (without Multipass)

I want my customers to be able to login to my Shopify store via my existing website account system.
This means that if they've already entered their address on my website, they don't need to enter it again in Shopify. (And if I can also track my users' shopping behaviour that would be a bonus.)
I found this related discussion on the Shopify forums (about Facebook login), but with no clear answer:
https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/login-with-facebook-114126
Is it possible to use oAuth (or some other method) to enable this kind of functionality in Shopify?
The official Shopify method to login to your store from your third-party website is to use Multipass, however this requires a Shopify Plus account (starting at $995/month).
Shopify does provide some support for oAuth, however it appears to be mainly used for shop-owners adding third-party apps into their stores, not for creating customer accounts.
There are various apps available for social login functionality. While these won't exactly provide the functionality you need, they must have a found a way of creating new user accounts, so perhaps they can hint at a possible solution for this.
See https://apps.shopify.com/search/query?utf8=%E2%9C%93&q=log+in