Access denied calling checkoutCompleteWithCreditCard from iOS App

Shopify Partner
7 0 0

I am trying to use checkout graphql API in iOS mobile buy sdk. The storefront token has access 

unauthenticated_read_content,unauthenticated_read_product_listings,unauthenticated_read_collection_listings,unauthenticated_write_checkouts,unauthenticated_read_checkouts,unauthenticated_write_customers,unauthenticated_read_customers

 

I am using Shopify vault to convert the credit card information to a vault token. and then send that token to complete checkout mutation: 

checkoutCompleteWithCreditCardV2

 

I am getting error

[Buy.Graph.QueryError.Reason(message: "CheckoutCompleteWithCreditCardV2 access denied", line: nil, column: nil)]

0 Likes
Shopify Staff
Shopify Staff
6 2 0

Hey @Rishabh_Tayal 

 

As per the Storefront-API checkout guide,  to complete a checkout using the checkoutCompleteWithCreditCardv2 mutation you need to have the `write_checkouts_payments` scope enabled for your app. This scope is enabled by turning your app into a sales channel app and then requesting for payment processing

 
As a simpler workaround, the simplest way to complete a checkout is by redirecting the customer to a web view where they will be presented with the same flow that they're familiar with on the web. The Storefront.Checkout resource provides a webUrl that you can use to present a web view.
 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Shopify Partner
7 0 0

@hassain Thanks for your response. Our app is listed as 'sales channel'. I have also requested for payment processing access. However our request is not getting approved saying we don't have proper use case for the payment processing.

 

I am aware of the web checkout flow. We already have that feature in the mobile app and now would like to be able to add a native checkout using the checkoutCompleteWithCreditCardv2 mutation.

0 Likes
Shopify Partner
7 0 0

@hassain Any update?

 

0 Likes
Shopify Staff
Shopify Staff
6 2 0

Hey @Rishabh_Tayal ,

 

Thank you for all of the additional information.

 

As mentioned in my previous comment in order to use the checkoutCompleteWithCreditCardv2 mutation you will need to have the `write_checkouts_payments` scope enabled for your app, and this scope can only be enabled by being a sales channel app and receiving access for payment processing. So if you were not approved for payment processing for your use case, then you will not be able to use this mutation. 

 

In your situation, remaining with your current web checkout flow would be the best (in terms of ease of implementation and for security purposes) and only viable solution for completing the checkout in your app. 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes