Skip to navigation

Get Storefront API authToken

Returns an existing storefront authToken from an existing JSON Web Token (JWT). You can obtain a JWT using a request to the Current Customer API. See Authentication for hosted storefronts for instructions.

The channelId field is optional for stores with multiple storefronts, since the JWT is tied to a specific storefront session. Including it does enforce strict adherence of token-related activity to channel-specific rules and behaviors. However, it is not necessary at all for single-storefront stores because there is only one storefront channel.

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

Headers

X-Store-HashstringRequired
The unique store hash associated with a BigCommerce store that has B2B Edition enabled.

Query parameters

jwtTokenstringRequired

The JSON Web Token (JWT) obtained from a signed-in Company user. See Current Customer API to learn how to request a JWT.

channelIdstringOptional

The storefront channel ID associated with the storefront login session. Use 1 for your store’s default storefront channel. In a multi-storefront environment, this parameter enforces strict adherence of token-related activity to channel-specific rules and behaviors.

Note: Inclusion of this parameter in single-storefront environments will result in unpredictable behavior.

Response

OK
codeintegerOptionalDefaults to 200
The HTTP Status code of the response.
dataobjectOptional
metaobjectOptional

Errors

401
Unauthorized Error