If you’re just about to dive into the BigCommerce platform and want some ideas for where to start, check out the first two articles in this series: Thinking in SaaS and The Main Pillars.
This time around, we’re going to dive a bit deeper into the true backbone of the “open SaaS” platform, and a toolset with which you’ll become well familiar in your developer journey: The BigCommerce APIs. Let’s break the various API systems down in a few different ways.
The broadest categories into which BigCommerce APIs fall are according to the API request architecture or “protocol”.
A couple API endpoints, namely the Current Customer API and Customer Login API, fall outside these two categories.
So what can be done with the various BigCommerce APIs? Since “basically everything” is a bit of a glib answer, let’s break things down into some helpful categories.
The primary purpose of the storefront operations in this category is to support headless storefronts, or else to support separate apps that require a customer’s store context. With the power of these API interactions, a fully functional customer experience can be achieved with a front-end that is decoupled from BigCommerce.
Store content includes things like catalog details and page content. Extensive GraphQL coverage in this area makes fetching data specific to the customer’s context easy. The various GET endpoints available in the REST management APIs (see below) can be used to fetch the same details.
Customer login and registration is a key component and involves a few different endpoints/options depending on your needs.
Cart and checkout data can be accessed and managed both with the REST Storefront API and the GraphQL API.
For everything under this heading, REST is the API method in question. Here, we’re talking not about client-side requests, but typical server-to-server CRUD operations to manage your BigCommerce store’s configuration and content. These APIs are the connective tissue that allows your custom apps to extend BigCommerce in myriad ways.
Not fitting entirely in our other categories are:
A final set of APIs worth mentioning is one in which the direction of data is flipped: For these APIs, it is BigCommerce issuing requests to your own custom application, rather than the other way around. As such, we’re really talking about prescribed schemas rather than APIs BC actually implements.
Your BigCommerce Single-Click App can be registered to provide shipping and tax rates for BC stores that install it, in which case the app must implement the Shipping Provider API or Tax Provider API in order for BigCommerce to fetch rate data.
Pardon the interruption
We are Certified BigCommerce Partners. We do everything from BigCommerce builds to customizations to integrations. If you are looking for a qualified agency to partner with in bringing your site to the next level, get in touch!
![]()
Another way we can slice the various BigCommerce APIs is according to the endpoints they use. The important distinguishing factor in this respect is the fact that a customer’s session is relevant for some operations.
The REST Storefront API, GraphQL Storefront API, Customer Login API and Current Customer API are all accessed using paths on your BigCommerce store’s own domain, which facilitates the reading and setting of the user’s session cookie associated with the store.
All other BigCommerce APIs are accessed on a common domain, at api.bigcommerce.com with an identifying store or account ID as a URL segment.
Just as the context and purpose of a particular operation affects the endpoint and protocol used for it, the same is true for the appropriate authentication strategy. BigCommerce uses several different techniques for different contexts.
The REST Storefront API is accessed on your store’s domain and relies on the user’s session context for cart and checkout operations. No authentication is required for these requests, but they must come from the same origin as the domain in the request URI (i.e., your storefront).
Most REST operations and the GraphQL Account API rely on authentication via a long-lived token generated in one of the following ways:
These OAuth tokens are granted specific scopes allowing only the operations that are necessary for their purpose. And having no expiration, they are meant only for API requests from a secure environment where the token will not be exposed to an end user.
In some cases, your application must use an endpoint with a typical OAuth token to request a separate, short-lived token.
This is the primary mechanism for the GraphQL Storefront API, which can make use of:
The first two cases allow for secure requests from a user’s browser, where an authenticated request combined with the user’s session cookie will result in appropriate product listings, pricing, etc., that is specific to the customer context. (Essentially the same use case as the REST Storefront API, but simply a different authentication strategy.)
By contrast, a customer impersonation token is designed for imposing a specific customer context on the response data without a session, and therefore such tokens are meant for server-to-server requests, not for being exposed in a user’s browser!
The Payments API also relies on a one-time-use payment access token generated with a secure REST request.
In a couple instances, the challenge of a client-side request is combined with either the need for handling sensitive data or the need for mutual authentication. In these cases, the JSON web tokens (JWT) involved use encrypted/signed payloads that must be decrypted to complete the operation.
Single sign-on with the Customer Login API requires BigCommerce to verify that the user’s request originates with an app that has permission to log the customer in. The app uses its “client secret” to encrypt the customer’s details into a JWT that is then sent with the client-side request.
The Current Customer API is similar, but the need for authentication is flipped. The app trying to verify a BC customer is who they say they are must verify that the response came from BigCommerce. So in this case, it is BigCommerce that encrypts the customer details - again, using the app’s “client secret”.
In both of these situations, the app must be registered in the BigCommerce Developer Portal in order to generate the client secret used for signing and verification. And in both cases, decrypting the payload using the same secret verifies the identity of the sender.
This has been quite the whirlwind ride! We’ve hardly covered BigCommerce’s APIs in sufficient depth to be ready to sit down and start writing requests from scratch. And yet, if you’re anything like me, the sheer amount of documentation to dive into for these systems can actually be an impediment when you’re trying to wrap your head around the broad concepts. We’ve broken the APIs down in several different ways, exploring those distinctions from the standpoint of the scenarios they serve and why that context creates the need for different strategies. That’s extraordinarily helpful for me as I try to keep complex systems straight, and I hope it has been for you as well!
Chris Nanninga
Director of Training Development