For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • Overview
  • Learning Plans
    • Developer Foundations
    • Composable Developer
    • Stencil Developer
    • B2B Developer
  • Courses
        • Cart and Checkout
        • Lab - Query Practice
        • Lab - Create a Cart and Checkout Flow in Postman
        • Optional Lab - Complete Checkout Flow with Payment
      • Conclusion
    • Learning Changelog
Dev Portal
LogoLogo
On this page
  • Overview
  • GraphQL Cart and Checkout Features
  • Limitations
  • Handling Payments
  • Resources
CoursesGraphQL Storefront APIModule 6: Cart and Checkout

Cart and Checkout

Was this page helpful?
Previous

Lab - Create a Search and Filter Flow in Postman

Next

Lab - Query Practice

Built with

Plan: Developer Foundations

Lesson 21 of 28 · 15 min

Overview

BigCommerce’s GraphQL Storefront API provides the same access to cart and checkout objects as the REST Storefront API. Having access to cart and checkout data in the graph alongside related data makes it easier to build headless storefront applications.

GraphQL Cart and Checkout Features

You can use front-end GraphQL to create an end-to-end shopper experience. Cart and checkout-related mutations and queries can do the following:

  • Add products to a cart
  • View or manage a cart
  • Fill out checkout details
  • Determine the cost of shipping and select a shipping method
  • Create cart metafields
  • Create cart redirect URLs
  • Complete checkout by converting a cart into an order
  • Generate a payment access token (only in a Stencil storefront environment)

Limitations

GraphQL Storefront API Cart and Checkout does not support the following features:

  • File upload product options
  • Buy Online, Pick Up in Store
  • Checkout directly from the Product Details page, or Buy Now carts

Handling Payments

For PCI compliance-related reasons, the GraphQL Storefront API does not handle payments. You can use the Payments API to process payments, including store credits and gift certificates.

  • Payments API Overview
  • Payments API Reference

The GraphQL Storefront API returns the checkout ID and order ID, which you can use to get accepted payment methods and create a payment access token. You can also generate a payment access token using the GraphQL Storefront completeCheckout mutation if you are working in a Stencil storefront environment.

GraphQL will also return the customer ID, which you can use to get stored payment instruments. To learn more about authenticating REST endpoints, use the API reference and locate the Authentication section at the top of each endpoint.

Resources

  • GraphQL Storefront API: Cart and Checkout
  • GraphQL Playground