Server to Server Management APIs
Auth

Auth

API auth manage

Get Server to Server Tokens

POST /auth/backend

Request

Get Server to Server Tokens.

Administrators are the only role allowed to create API tokens.

Authentication

  • authToken in header

Body

object | application/json
  • storeHash
    string
    required

    Your store unique store_hash
    >= 1 characters
  • password
    string
    required

    You can use the backend user password to log into the B2B Edition APP.
    >= 1 characters
  • name
    string
    required

    The token name, if you want to specify it.

example-1

{
"storeHash": "string",
"email": "string",
"password": "string",
"name": "test"
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • data
    array[object]
    required

  • meta
    object
    required

example-1

{
"code": 200,
"data": [
{
"name": "fullPermsToken",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3RfYjJjX29yZGVyX2ltcG9ydEBxcS5jb21tIiwic3RvcmVfaGFzaCI6ImYyb3N4ampueGoiLCJkYiI6ImRlZmF1bHQifQ.L_u_enljWoYBbPPskmYEQVHldHIaTcWMIB-SdFah850"
}
],
"meta": {
"message": "SUCCESS"
}
}

Delete Backend API Tokens

DELETE /auth/backend

Request

Delete backend API tokens.

Authentication

  • authToken in header

Body

object | application/json
  • name
    string

    The token name, which will be used as a query parameter.
  • id
    integer
    required

    Token ID

example

curl --request DELETE \
--url https://api-b2b.bigcommerce.com/api/io/auth/backend \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

  • data
    array[]

example-1

{
"code": 200,
"data": [],
"meta": {
"message": "SUCCESS"
}
}

Get All Server to Server Tokens

GET /backend/tokens

Request

Get all Server to Server tokens

Authentication

  • authToken in header

Parameters

  • limit in query with default of 10 - integer
    Pagination limit
  • offset in query0 - integer
    Pagination offset

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/io/backend/tokens \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
  • code
    integer

  • data
    array[object]

  • meta
    object

example-1

{
"code": 0,
"data": [
{
"id": 0,
"name": "string",
"email": "string",
"storeHash": "string",
"token": "string",
"eventChannel": "string"
}
],
"meta": {
"pagination": {
"totalCount": 0,
"offset": 0,
"limit": 10
},
"message": "string"
}
}

Get a Storefront API authToken

GET /auth/storefront

Request

Get a storefront API authToken

Authentication

  • authToken in header

Parameters

  • jwtToken in query - string
    required
    BC JWT token
  • channelId in query - string
    The BigCommerce channel ID. Do not use this parameter if you do not have an opened multi-storefront.

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/io/auth/storefront \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
  • code
    number
    required

  • data
    object
    required

  • meta
    object
    required

example-1

{
"code": 200,
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InRlc3RfYjJjX29yZGVyX2ltcG9ydEBxcS5jb21tIiwic3RvcmVfaGFzaCI6ImYyb3N4ampueGoiLCJkYiI6ImRlZmF1bHQifQ.L_u_enljWoYBbPPskmYEQVHldHIaTcWMIB-SdFah850"
},
"meta": {
"message": "SUCCESS"
}
}

Get Storefront authToken with Credentials

POST /auth/customers

Request

BigCommerce customer gets an authentication token

Authentication

  • authToken in header

Body

object | application/json
  • storeHash
    string
    required

    Your store unique store_hash
    >= 1 characters
  • password
    string
    required

    BC customer password
    >= 1 characters
  • channelId
    number
    required

    BigCommerce channel ID
  • name
    string
    required

    The token name, if you want to specify it.
    >= 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"
}
}

Get a B2B Storefront Token

POST /auth/customers/storefront

Request

Get B2B storefront token by v3 io token

Authentication

  • authToken in header

Body

object | application/json
  • customerId
    integer
    required

    BigCommerce customer ID
  • channelId
    integer

    BigCommerce channel ID
  • customerAccessToken
    object

    BigCommerce Customer Access Token

Example 1

{
"customerId": 999,
"channelId": 1,
"customerAccessToken": {
"value": "sometoken",
"expires_at": "2024-12-31T00:00:00.0Z"
}
}

Response

OK

Body

object | application/json
  • code
    number

  • data
    object

  • meta
    object

Example 1

{
"code": 200,
"data": {
"token": [
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6IjEyM0AxMi5jb20iLCJiY19jdXN0b21lcl9pZCI6MzEzLCJzdG9yZV9oYXNoIjoiaW1rOHp6N2ppcCIsImRiIjoiZGVmYXVsdCIsImJjX2NoYW5uZWxfaWQiOjEsImV4cCI6MTY5MDg1NDI5Mn0.97rY-1aGDFKtLbIePR5g202AHZJ0x2kDjmyzGVGK45"
]
},
"meta": {
"message": "success"
}
}

See something you can improve? Edit this file on GitHub

Did you find what you were looking for?