Clarity Please - Completing a Checkout

David_Hopkins
Shopify Partner
7 0 2

Afternoon All,

Can someone tell me how to do the following properly please?

  •     Create a checkout
  •     Add a payment
  •     Complete the checkout
  •     Display the order

I'm finding the API docs confusing, and sometimes missing. My process so far:

  •     I started my integration using the REST Admin API to get my product data.
  •     I then found I needed to create a private app and convert it to a Sales Channel in order to get access to the checkouts endpoint.
  •     When I tried to add a Stripe payment to a checkout I was denied access.
  •     When I requested access I was told by "Rubina C. (Shopify Apps Team)" that the Sales Channel was not for me. I should use the Storefront API and switch to GraphQL.
  •     I switched and recreated my checkout. Now there is no documentation for adding a payment and completing a checkout using Storefront and GraphQL. The docs here https://help.shopify.com/en/api/custom-storefronts/storefront-api/guides/checkout-guide#completing-t... instruct me to send customers to the Shopify WebURL (!).

I just want to create a checkout, add a payment, complete the checkout, and display the order. Bread and butter stuff. Can someone clarify on how to do this please?

Many Thanks,

David


p.s. I found "checkoutCompleteWithTokenizedPaymentV2" using the GraphiQL.app and my storefront endpoint but I get "CheckoutCompleteWithTokenizedPaymentV2 access denied" when running this mutation. Nothing in the docs for it, just a vague reference in a forum post here https://ecommerce.shopify.com/c/api-announcements/t/stay-up-to-date-with-the-storefront-api-changes-...

Replies 6 (6)

KarlOffenberger
Shopify Partner
1873 184 901

Hi David,

Yes, I am with you on that one. In a nutshell:

  • Checkout API is only available through the Sales Channel SDK which in turn is only approved for public apps offered through Shopify App Store. I have no idea what the approval / acceptance criteria are other than what I mentioned.
  • Storefront API does not allow checkout completion i.e. payment. You can create the checkout, add line items, shipping address, customer etc. but no way to add the payment and complete checkout. checkoutCompleteWithTokenizedPaymentV2 and similar mutations are only part of Unity SDK and / or Mobile Buy SDK and even as such, available to a few select partners AFAIK.

So there we have it.

This is a major thorn in my eye. Lack of control over checkout, shipping, multi-currency, multi-language, more granular event handling via webhooks, very limited query parameters within REST and GraphQL APIs and more, are all reasons I am finding it hard to truly warm up to Shopify considering its leadership role, credo to date and the fact that many of these features are behind a wall of exclusivity for premium customers or opaque access criteria. What is there is hardly documented beyond the basic endpoint request / response fields and even those often leave a lot of questions open (ever tried to understand custom line item taxing?)

As is, I am considering using Shopify purely as an inventory with a few other perks, but bypass the entire storefront and checkout, master product catalog etc. If I count the costs (disregarding my own developer time) of spinning up a few GCEs or downstream services to host all that, I'd still be better off than paying for the next Shopify plan or just one app from the app store.

It is what it is though and in Shopify's defense, they aren't doing too bad or worse than most of their competitors.

I hope someone can prove me wrong or correct my answer - I'd love to hear how!

davidgetter
Shopify Partner
7 0 1

Is this still the case?


Storefront API does not allow checkout completion i.e. payment. You can create the checkout, add line items, shipping address, customer etc. but no way to add the payment and complete checkout. checkoutCompleteWithTokenizedPaymentV2 and similar mutations are only part of Unity SDK and / or Mobile Buy SDK and even as such, available to a few select partners AFAIK.

PaulNewton
Shopify Partner
6275 574 1324

Can someone clarify on how to do this please?

You can't do the whole process without being a sales channel. Also see this post:

https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/checkout-api-550676 clarified by Alex Richter ( Shopify Developer Experience) .

 

What is there is hardly documented beyond the basic endpoint request / response fields and even those often leave a lot of questions open

Undeclared descriptive prerequisite are an ongoing documenation|education|communication problem for the platform. The docs on endpoints are missing the delcaration you need to be a sales channel, all others need to go through shopifys hosted checkout to complete payment. Standard response is PCI compliance risk.

Ever since the wiki went away fixing docs is a waiting game if you even bother reporting it to shopify support. It's eIther that, stumbling upon the solution, or finding someone that solved the problem expensivel  and needs you to pay them to solve it for you.

I've been thinking of pushing for github hosted developer documentation ala msdn so edits dont take a year but meh /shrug

If I count the costs (disregarding my own developer time) of spinning up a few GCEs or downstream services to host all that, I'd still be better off than paying for the next Shopify plan

Not an uncommon thing and doable as long as you dont need to scale or provide various payment methods and support for them, are going to do you own PCI compliance while handling credit card details, etc. 

Lack of control over checkout, shipping, multi-currency, multi-language, more granular event handling via webhooks, very limited query parameters within REST and GraphQL APIs and more

Frustating sure however you must keep in mind shopify's developer side really comes secondary to being accessible to general merchant needs. Businesswise if a platform doesn't fit your business req's, such as 1 page checkout, either use|build a platform that does or just reduce the req's.

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


KarlOffenberger
Shopify Partner
1873 184 901

Standard response is PCI compliance risk

Yes, it would be a major dealbreaker for many merchants if they had to jump through the hoops of PCI scruteneering - even a relatively straightforward SAQ A-EP self-assessment would deter most.

That said, many forward-thinking payment gateways offer solutions of fully hosted checkout forms and widgets or iframes that are very customizable while remaining the responsibility of the third-party payment gateway. This, I believe, is where Shopify could step up their game and come forth with similar solutions for all merchants, not only Plus.

Not an uncommon thing and doable as long as you dont need to scale or provide various payment methods and support for them

Definitely does not need to scale massively or support merchant requirements other than those of my wife - that and the fact we are not willing to invest $ 100's USD recurring monthly costs for the platform, payment gateway (since Shopify Payments aren't available in our region), and a dozen commercial apps to make up for what's de-facto expected functionality or custoer experience in current e-commerce.

I also noticed some big players in the app space have moved in on the same thought - Bold have released Cashier, but that "admin inside the admin" UX and fact you'd need to manage orders etc. via Bold's app make me... well "shrug". Other than that, massive effort by them and tip my hat!

I've been thinking of pushing for github hosted developer documentation ala msdn so edits dont take a year but meh /shrug

Would be nice. Or some up-to-date and end-to-end samples or a collection of gists for common API usage scenarios.

David_Hopkins
Shopify Partner
7 0 2

Hi Karl,

Thank you very much for providing clarification.

I'm disappointed the Shopify API doesn't allow me complete a checkout properly. It seems like such basic functionality to me. Hopefully these features will be available for use in future projects, but I'm going to have to look for a different solution for my current one.

Thanks again,

David

KarlOffenberger
Shopify Partner
1873 184 901

David Hopkins

Sorry to hear that. I still believe Shopify has lots to offer compared to others which is why I have ultimately picked it in spite of its shortcomings. Some competitors treat come from the blog and content oriented world and only offer commerce features as an afterthought. Others are squarely geared towards enterprises. Then you have a few DIY solutions but beyond the hassle of having to provision them on servers, securing them, maintaining them and getting them certified is way too painful. Last but not least, there are the few comparable competitors to Shopify, but having evaluated many, each have gotchas - some just have a different feature mix but still lack some "need to haves", others might offer the features you want but charge merchants on number of products in their catalog, or how many sales you make etc. etc.

Recent years have brought a few dozen "headless" commerce services but most affordable ones typically focus on the transactional component of ecommerce and do little in the way of product information management, inventory etc. Not to mention they lag behind Shopify in the holistic approach that you get a bit of everything thrown in to get you going sound and well.

So Shopify still remains a great choice IMO but if total control overyour checkout and payments is required, I'd look in to external payment gateways that offer rich API's and hosted checkout forms / widgets that you can integrate in to your Shopify theme.