Creating Channels

Before you can display products on a headless storefront, you need to create and configure a sales channel for that storefront using the REST Management Channels API.

1

Prepare

You need a primary domain name for your headless storefront and an additional domain for the storefront’s checkout page. Subdomains are permitted. Ensure the domain is not currently associated with existing channels/storefronts, especially the default storefront managed in the control panel account area.

The API calls that associate domains with your store do not verify domain name ownership.

2

Get a storefront seat

Limits: Every store comes with a default limit of one active storefront that comes for free along with a store. To add additional storefront seats, contact your BigCommerce representative.

You can open a headless storefront seat by setting the status of the default BigCommerce storefront to inactive. This will break a store that’s already transacting on the default storefront, so contact your BigCommerce representative if you have questions about taking this step.

3

Create the channel

Send a request to the Create a channel endpoint to create a channel for your headless platform. Note the channel ID returned in the response; you’ll use it in successive steps.

4

Add the headless site URL

To tell BigCommerce the URL of your headless store, use the Create a channel site endpoint, along with your channel ID and primary domain name.

5

Add a checkout URL

Currently, all checkout pages are hosted. Set the checkout domain for the headless storefront by sending a request to the Upsert a site’s checkout URL endpoint. You can configure the headless checkout url with www_redirect settings using the Settings API.

6

Add 3P SSL to the checkout domain

Optionally, you can add a 3P SSL certificate for the checkout domain by sending a request to the Upsert a site’s SSL/TLS certificate information endpoint.

7

Create tokens for the GraphQL Storefront API

After setting up the channel, you’re almost ready to authenticate requests to the GraphQL Storefront API. Choose the token type that matches your use case:

  • Private tokens — Use for server-to-server integrations. Private tokens do not require an allowed_cors_origin.
  • Customer impersonation tokens — Use when you need to make requests on behalf of a specific customer from your server.
  • Storefront tokens — Use for browser-based (client-side) applications. When creating a storefront token, supply your channel site as an allowed_cors_origin; otherwise, your cross-origin requests will be rejected.

You can Create tokens using the REST Management API with your new channel ID.

After you have a token, you’re ready to get started using the GraphQL Storefront API.

Next steps

Resources