I have a question regarding best practice for a Shopify login flow we are building. I have looked through the forums but unfortunately cant find something helps with my question.
On the multipass doc page, under FAQs it states:
Some of my customers have already placed orders on Shopify. How do I update those customers so they can login through multipass?
You can use the Update Customer API to set the multipass_identifier for the customer. You will need to use the identifier with all your multipass requests for those customer accounts.
In the case of the integration we are looking to build with our product we have no way of knowing if any given user may or may not have signed into an existing Shopify store before.
Are we better off treating any customer as an existing one? Meaning even if they are created automatically we still use the Update Customer API to send the identifier and any other optional data?
You'll only need to use identifiers if multiple users could have the same email address:
At Shopify, we use email addresses as unique identifiers for customers of a shop. If your site uses other identifiers (such as usernames), or if it is possible that two different users of your site registered with the same email address, you must set the unique identifier in the "identifier" field...
Assuming the emails are unique, you shouldn't need to set the identifier field. When you use Multipass login on an existing customer, they'll just be logged in (i.e. a duplicate account wont be created). If they don't have an account yet, one is created.
Let me know if you have any questions!
If an email (account) doesn't exist and multipass is going to create one, does it follow the standard account creation process of sending the verification email to the customer before the account is activated? I'm wondering how the customer assigns their password for the Shopify site/account if we make this an automated, seamless process under the hood?
You might find a combination of these threads helpful:
TLDR: Their password will be randomly generated. If you log them in through Multipass, they won't need to enter a password on Shopify's side. If you'd like them to login through Shopify, you could use the API to send them an account activation email where they can set a password.