Storefront APIs
Authentication

Authentication

Get Storefront authToken within Stencil

POST /v2/login

Request

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
  • bcToken
    string
    required

    BigCommerce JWT token
  • customerId
    integer

    Customer ID
  • storeHash
    string

    Store Hash
  • channelId
    integer

    BigCommerce channel ID

example-1

{
"bcToken": "string",
"customerId": 1234,
"storeHash": "string"
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3RfYjJjX29yZGVyX2ltcG9ydEBxcS5jb21tIiwic3RvcmVfaGFzaCI6ImYyb3N4ampueGoiLCJkYiI6ImRlZmF1bHQifQ"
}
}

Get a Storefront authToken for a Specific Customer

POST /io/auth/customers

Request

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
  • storeHash
    string
    required

    >= 1 characters
  • password
    string
    required

    BigCommerce customer password
    >= 1 characters
  • channelId
    number
    required

    Store channel ID
  • name
    string
    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
  • code
    number
    required

  • data
    object
    required

  • meta
    object
    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?