Authentication
Get Storefront authToken within Stencil
POST https://api-b2b.bigcommerce.com/api/v2/loginRequest
Get a storefront authToken. You need a BigCommerce Current Customer JWT to make the request. See the B2B Edition Authentication article for more details.
Equivalent Storefront GraphQL API Mutation: authorization
. For more information, see the GraphQL Playground.
Body
object | application/json
bcTokenstring
requiredBigCommerce JWT tokencustomerIdinteger
Customer IDstoreHashstring
Store HashchannelIdinteger
BigCommerce channel ID
example-1
{
"bcToken": "string",
"customerId": 1234,
"storeHash": "string"
}
Response
OK
Body
object | application/json
codenumber
requireddataobject
required
example-1
{
"code": 200,
"message": "SUCCESS",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3RfYjJjX29yZGVyX2ltcG9ydEBxcS5jb21tIiwic3RvcmVfaGFzaCI6ImYyb3N4ampueGoiLCJkYiI6ImRlZmF1bHQifQ"
}
}
Get a Storefront authToken for a Specific Customer
POST https://api-b2b.bigcommerce.com/api/io/auth/customersRequest
Get an authentication token for a specific BigCommerce customer.
Equivalent Storefront GraphQL API Mutation: login
. For more information, see the GraphQL Playground.
Body
object | application/json
storeHashstring
required>= 1 charactersemailstring
requiredBigCommerce customer email>= 1 characterspasswordstring
requiredBigCommerce customer password>= 1 characterschannelIdnumber
requiredStore channel IDnamestring
required>= 1 characters
example-1
{
"storeHash": "string",
"email": "axe@snapmail.cc",
"password": "test12345",
"channelId": 1,
"name": "test",
"beginAt": 1000,
"endAt": 1721930486
}
Response
OK
Body
object | application/json
codenumber
requireddataobject
required
example-1
{
"code": 200,
"data": {
"name": "test9",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImtpZG8yNzZAc25hcG1haWwuY2MiLCJzdG9yZV9oYXNoIjoiMWk2enB4cGUzZyIsImRiIjoiZGVmYXVsdCIsIm5hbWUiOiJ0ZXN0OSIsImNoYW5uZWxfaWRzIjpbMV0sInRva2VuX3R5cGUiOjMsIm5iZiI6MTAwMCwiZXhwIjoyMDAxfQ.EiR__LVAlBVNYtFCZPWJYoPv6UfGiXtULxhK-BCQZjY"
},
"meta": {
"message": "SUCCESS"
}
}
Did you find what you were looking for?