This section covers checkout options available to headless storefronts.
You can redirect a customer to the BigCommerce hosted checkout page when creating a cart by appending the include=redirect_urls query parameter to the request URL of the Create a Cart endpoint.
The redirect_urls object returned in the response will contain cart_url, checkout_url, and embedded_checkout_url parameters. You can use the checkout_url URL to redirect the customer to the BigCommerce hosted checkout page.
For example:
It is important to note that when you use the hosted checkout option the shoppers are able to navigate to other pages of your store. The following are some of the methods to prevent this.
/checkout) that redirects to the non-BigCommerce storefront.Embedded Checkout lets you embed the BigCommerce hosted checkout into your headless storefront using an iFrame. It relies on the embedCheckout method of the Checkout SDK to display BigCommerce’s PCI compliant Optimized One-Page Checkout on non-native storefronts.
For a sequence of API calls required to create an Embedded Checkout, refer to the Embedded Checkout tutorial.
For a list of supported payment gateways, see Compatible payment gateways.
If you need complete control over the checkout page, you can use the Storefront Checkout API to build a custom checkout experience.
The Storefront Checkout API lets you move the cart to checkout and turn it into an order.