Cart and Checkout

Jul 4th 2022

Storefront Cart and Checkout

The Storefront APIs are for managing the contents of a shopper's cart and checkout using JavaScript in the context of a storefront session.

When to use the Storefront APIs

  • Analytics and Tracking
  • Retrieving cart data client-side
  • Quick Order Form
  • Upsell applications

Using the Fetch API

The Fetch API is an alternative to XMLHttpRequest for making http requests in JavaScript. You can use the Fetch API to interact with the Storefront APIs and return a shopper's cart, checkout, or order.

Most modern browsers, except Internet Explorer, support Fetch API. We recommend using a Polyfill for Internet Explorer 10+ and XMLHttpRequest for earlier versions.

To learn more about using the Fetch API with the Storefront see our Working with the Storefront Cart and Checkout APIs tutorial.

You can run fetch requests from the browser console to test, or you can use the Scripts API to inject JavaScript into your theme's footer.