Cart and Checkout
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.
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.