Solved

Checkout auto login

kuldi
Tourist
5 0 1

I am having a flutter app for my Shopify store where I can browse through all my products and collections. But when I add any product to cart using Shopify storefront API and create a checkout url using the following API

query checkoutURL($cartId: ID!) {
        cart(id: $cartId) {
        checkoutUrl
        id
      }
}

 

I get a checkout url and when I try to open the url in the webview it prompts a login dialogue box. How can I auto login the user because I have already logged-in user while entering the app. I have also enabled the shopify multipass option. Please suggest me what I am missing.

Accepted Solution (1)

minhduc
Shopify Partner
1 1 0

This is an accepted solution.

You can put X-Shopify-Customer-Access-Token into headers in webview with value is your customer access token. 

You can try it. It's worked for me.

View solution in original post

Replies 6 (6)

activelyblack
Shopify Partner
1 0 0

I have the Same Query, anyone from Shopify please suggest the Solution.

minhduc
Shopify Partner
1 1 0

This is an accepted solution.

You can put X-Shopify-Customer-Access-Token into headers in webview with value is your customer access token. 

You can try it. It's worked for me.
PabloGa
Tourist
3 0 1

Hi,
We've developed a frontend web app using Storefront API.
We can do user registration, login, etc but we cannot create an authenticated checkout.
When user is logged in in our web app, appears not logged in the checkout, but when the order is complete it's associated to the user.

 

We've tried both "cartCreate" and "checkoutCreate" APIs.

 

With "cartCreate" API we cannot assign "deliveryAddressPreferences" to the "CartBuyerIdentity".
We tried also with "cartBuyerIdentityUpdate" but it didn't work.

 

With "checkoutCreate" instead we can send the shipping address to the checkout and when the user arrive to the chekout the address is filled.
With "checkoutCustomerAssociateV2" we associate the user to the checkout object but the user is stil not logged in the checkout page.

 

Are there any solutions?

X-Shopify-Customer-Access-Token seems to work only withMobile SDKs.

Is it possible to create a logout where the user is logged in, if we login with Storefront API?

MauriceWirtz
Tourist
3 0 1

Hi, 

I've got the exact same issue, did you resolved this by any chance?

 

 

Thanks!

GigaTeam
Shopify Partner
1 0 0

Hi Maurice,

 

no we didn't. 
We need to try the new customer account APIs that should help.

We'll see.

aki_iwabuchi
Shopify Partner
6 0 1

@minhduc wrote:

You can put X-Shopify-Customer-Access-Token into headers in webview with value is your customer access token. 


Hi,

It was working fine this way, but when I upgraded the flutter SDK version, it stopped working only for IOS. It takes me to the login screen. android is working fine. Is the same thing happening? Please let me know if you find a solution.