Create customer with phone by using iOS SDK

kevin888800
New Member
4 0 0

Hello everyone! I'm investigating and surveying the possibility to integrate Shopify into our App, to provide a channel for our customers to buy our own productions as an addition beyond our main services.


I'm trying the iOS demo and the SDK. I want to know whether I should create a customer identity for every customer who visits our shopfront when I use Shopify SDK. If yes, maybe I should invoke the api of

```

func create(email: String, password: String, firstName: Input<String> = .undefined, lastName: Input<String> = .undefined, phone: Input<String> = .undefined, acceptsMarketing: Input<Bool> = .undefined) -> CustomerCreateInput {}

```

I found that the email and password is required anyhow, but only their phone and SMS verification code are required when our customers register and login our App, no need for email and password, so that we can't use the ready customer information we mastering to create a Shopify customer account. Does it means that it's impossible to intercommunicate our account with Shopify?


Waiting for your response, thank you!

0 Likes
_JB
Shopify Staff
Shopify Staff
750 87 165

Hey @kevin888800,

Creating a new customer for every visitor on the site isn't necessary. Creating a new customer record requires either an e-mail address or phone number, so you won't be able to create a customer record until this information is available. For most stores, a customer is created automatically once the user enters checkout and provides their e-mail address. 

Note that a customer record can exist with or without an account. The methods you mentioned allow a customer to be created with an account, so they require a password argument. You can definitely use this to implement customer account functionality in your app, but it's not required.

JB | Developer 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

0 Likes
kevin888800
New Member
4 0 0

Hey @_JB , thank you for your reply! Yes, we need saves the customer's record like their orders, their goods in cart, their shipping address. If we don't create customer accounts, how to fetch the history orders and contents in cart of a specific customer?I read the document of the mobile-buy-sdk-ios on github, and found if I want to fetch the customer orders I need to provide the "customerAccessToken", but if I want to get a "customerAccessToken" I still need to provide an email and a password. How can I get a customer's history orders without their email and password when only the phone number we can provide?

Or, can we create anonymous customer account though pass the customer's id in our own users system to Shopify sdk as a customer account identity?

0 Likes