Skip to navigation

Get B2B Storefront Token

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
codeintegerOptionalDefaults to 200
The HTTP Status code of the response.
dataobjectOptional
metaobjectOptional