GraphQL Cart & Checkout Now Available in Open Beta!
We’re thrilled to announce a couple of updates to our Storefront GraphQL API offering: Cart & Checkout!
This update to our existing Storefront API makes it possible for developers to query storefront data from within a Stencil theme, or from external websites or applications in a headless shopper experience. The Storefront GraphQL API is a flexible interface for building shopper experiences, and Cart and Checkout are now available in our Open Beta!
Who did we build this for & why did we build it?
You asked, we listened! This update was built for you - our BigCommerce developer community! Specifically, this is most relevant to storefront developers who build headless storefronts and want more robust GraphQL API coverage and simplified flows for their storefront implementation.
This update will allow developers to fetch cart details and other storefront details and reduce the number of calls required to build a storefront. This update also means that we now have all the GraphQL capabilities needed to power an end-to-end shopper experience in GraphQL.
What is GraphQL & Cart Checkout?
Our GraphQL Storefront API provides the same access to cart and checkout objects as the REST Storefront API. Access to this cart and checkout data in the graph, alongside related data, makes it easier to build headless storefront applications.
Now, developers can use GraphQL on the frontend to create a frictionless, end-to-end shopper experience. To learn more, check out our GraphQL Cart & Checkout developer documentation.
With the new Cart and Checkout GraphQL APIs, you can:
- Create a new cart by adding an item to a cart
- Add products to an existing cart
- Remove products from a cart
- Adjust quantities of items in a cart
- Adjust product option selection for items in a cart
- Fill out the information for the various steps of checkout (like billing address and shipping address)
- Convert a cart into a pending order (ready for payment) and provide the appropriate credentials to take payment via the Payments API
To see a list of example GraphQL mutations and variables, click here! These examples can help you get started forming your own mutations and queries, and you can test them in our GraphQL playground!
For guidance on how to get started using our GraphQL playground, check out our documentation on Accessing the GraphQL Playground.
I’m interested! What’s next?
If you’re ready to go, go ahead and get started! This is an open beta, which means it is currently available to anyone building in the BigCommerce ecosystem. To learn more about implementation and details, check out our GraphQL Cart & Checkout documentation to help you get started.
This is an Open Beta, so your feedback is greatly appreciated and will be used to further improve what we already have built. Please feel free to reach out to our DevRel team anytime with questions or feedback on this update.
If you still have questions or want to submit feedback, feel free to comment on this article, tweet at us, or email our DevRel team!