For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
      • Storefront
      • Management
        • Overview
          • Addresses
          • Authentication
            • POSTGet Storefront authToken with Credentials
            • POSTGet B2B Storefront Token
            • GETGet Storefront API authToken
            • POSTGet Server to Server Token
            • DELDelete Backend API Tokens
            • GETList Server to Server Tokens
          • Channels
          • Company
          • Invoice Management
          • Orders
          • Payment
          • Quotes
          • Sales Staff
          • Shopping List
          • Super Admin
          • Users
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTB2BManagementAuthentication

Get B2B Storefront Token

POST
https://api-b2b.bigcommerce.com/api/io/auth/customers/storefront
POST
/api/io/auth/customers/storefront
$curl -X POST https://api-b2b.bigcommerce.com/api/io/auth/customers/storefront \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "customerId": 456
>}'
200Successful
1{
2 "code": 200,
3 "data": {
4 "token": [
5 "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6IjEyM0AxMi5jb20iLCJiY19jdXN0b21lcl9pZCI6MzEzLCJzdG9yZV9oYXNoIjoiaW1rOHp6N2ppcCIsImRiIjoiZGVmYXVsdCIsImJjX2NoYW5uZWxfaWQiOjEsImV4cCI6MTY5MDg1NDI5Mn0.97rY-1aGDFKtLbIePR5g202AHZJ0x2kDjmyzGVGK45"
6 ]
7 },
8 "meta": {
9 "message": "SUCCESS"
10 }
11}
Generates a storefront authToken based on the supplied `customerId` of a storefront customer or Company user. You can use [Get Users](/developer/api-reference/rest/b2b/management/users) to retrieve the IDs of Company users, or you can use [Get All Customers](/developer/api-reference/rest/admin/management/customers/v3) to retrieve IDs for B2C customers and B2B buyers alike. You can also use the [BigCommerce Storefront GraphQL API](/developer/docs/storefront/guides/graphql-storefront-api/authentication#login-mutation) to generate a Customer Access Token (CAT) and include it in the request, but this is not required for a successful response. The storefront authToken obtained from this endpoint is valid for **1 day**.
Was this page helpful?
Previous

Get Storefront authToken with Credentials

Next

Get Storefront API authToken

Built with

Generates a storefront authToken based on the supplied customerId of a storefront customer or Company user. You can use Get Users to retrieve the IDs of Company users, or you can use Get All Customers to retrieve IDs for B2C customers and B2B buyers alike.

You can also use the BigCommerce Storefront GraphQL API to generate a Customer Access Token (CAT) and include it in the request, but this is not required for a successful response.

The storefront authToken obtained from this endpoint is valid for 1 day.

Authentication

X-Auth-Tokenstring
HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

X-Store-Hashstring
HeaderArgumentDescription
X-Store-Hashstore_hashThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.

Request

This endpoint expects an object.
customerIdintegerRequired
The ID of a BigCommerce customer account with a corresponding Company user account.
channelIdintegerOptionalDefaults to 1
The storefront channel ID where the order was placed.
customerAccessTokenobjectOptional

This object contains information related to the Customer Access Token (CAT) being associated with the storefront authToken.

Response

OK
codeintegerDefaults to 200
The HTTP Status code of the response.
dataobject
metaobject