Using Stripe Customer ID to Complete the Shopify Checkout

Using Stripe Customer ID to Complete the Shopify Checkout

yuvamanohar
Tourist
6 0 6

Hi, 
We have the below use case as part of adding commerce capabilities inside our app - 

1. Taking in the credit card info only once from the user and create a stripe customer object

2. Get the token for completing a checkout using customer id (stripe platform's one) and complete the checkout using the token  
                         OR 

2'. Somehow pass the customer id info to Shopify Storefront completing the checkout API and complete the checkout. 


Would be great if someone can advise whether 2 or 2' is possible using Shopify storefront API?

Replies 6 (6)

Alex
Shopify Staff
1561 81 342

The Storefront API has the checkoutCompleteWithTokenizedPaymentV2 mutation, which you can see utilized here. With that you could generate a Stripe Token to use, I'm not sure Stripe Customer IDs work though

 

As the guide notes, you will need to be a sales channel app and be given access to payment processing before this mutation can be used: https://help.shopify.com/en/api/guides/sales-channel-sdk/getting-started#request-payment-processing

 

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog

yuvamanohar
Tourist
6 0 6

Hi Alex,

 

 Thanks for the reply. One follow-up question I have - 

So, you are saying that using Storefront API we cannot leverage Stripe Customer Id to complete a checkout? Which means that we need the user to punch-in the credit card details every time a checkout is initiated if using Storefront API? Is that right? 

yuvamanohar
Tourist
6 0 6

Hi Alex, 

 

  Any update here?  Would definitely appreciate the help.

 

Thanks,

Yuva

Alex
Shopify Staff
1561 81 342

Hmm, if I'm going off documentation you should be able to. I'm going to work on getting you a clear answer. I'm referring to the note here: https://help.shopify.com/en/api/guides/sales-channel-sdk/completing-a-payment#integrate-stripe-with-...

 

If you've already tokenized the customer's credit card and created a customer in your Stripe platform account, then you can send the customer id from your platform account instead of sending the card information.

Alex | 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 the Shopify Help Center or the Shopify Blog

Alex
Shopify Staff
1561 81 342

So you can use the Stripe customer ID when creating the Stripe token, which you will use as input into the mutation. Referring to this documentation on Stripe's end: https://stripe.com/docs/api/tokens/create_card

 

You'll see that both card and customer are optional, where in your case you would make use of customer (which is the customer ID), where you would then receive a Stripe token in the response. Note that this requires Stripe Connect to be set up on your Stripe account.

 

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog

bote795
Tourist
4 0 1

Hey Alex,

Just wanted to follow up, as you said "requires Stripe Connect to be set up on your Stripe account." 
But that means the customer needs to be a connect user as well right? 
So people buying items would all have to be connect accounts?