User

Check Existence of Customer Email

GET /users/validations/existence

Request

This endpoint is deprecated.

Validate extra fields.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • email in query - string
    required
    Email address
  • storeHash in query - string
    required
    Store Hash
  • extraFieldName in query - string
    Extra field name
  • extraFieldValue in query - string
    Extra field value

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/users/validations/existence \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number

  • message
    string

example-1

{
"code": 200,
"message": "Success"
}

Get User List

GET /users

Request

Get user list. Equivalent Storefront GraphQL API Query: users. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • limit in query with default of 10 - string
    Pagination limit
  • offset in query with default of 0 - string
    Pagination offset
  • q in query - string
    Query string
  • role in query - string
    required
    User role, "":"ALL", "0":"Admin", "1":"Senior Buyer",“2”: "Junior Buyer","3": "Sales Rep","4": "UNKNOWN"

    Allowed: 0 | 1 | 2 | 3 | 4

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/users \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"list": [
{
"id": "1",
"firstName": "Ado",
"lastName": "Bob",
"role": "1",
"createdAt": "1594019538",
"updatedAt": "1596796306",
"email": "example@example.com",
"phoneNumber": "123456789"
}
],
"pagination": {
"totalCount": 1,
"offset": "0",
"limit": "10"
}
}
}

Create a User

POST /users

Request

Create a user. Equivalent Storefront GraphQL API Mutation: userCreate. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Body

object | application/json
  • companyId
    string
    required

    Unique company ID
    >= 1 characters
  • firstName
    string
    required

    User's first name
    >= 1 characters
  • lastName
    string
    required

    User's last name
    >= 1 characters
  • phoneNumber
    string
    required

    User's phone number
  • role
    string
    required

    "0":"Admin", "1":"Senior Buyer",“2”: "Junior Buyer"

    Allowed: 0 | 1 | 2

    >= 1 characters

example

{
"companyId": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phoneNumber": "string",
"role": "0"
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"userId": "7843",
"bcId": "8230",
"firstName": "Jo",
"lastName": "Sweet",
"email": "Jo.Sweet@example.com",
"role": "0"
}
}

Get User Information

GET /users/{userId}

Request

Get user infomation by userId. Equivalent Storefront GraphQL API Query: user. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • userId in path - string
    required
    user ID or BigCommerce customer ID
  • isBcId in query - string
    whether above userId as BigCommerce Customer ID, "1" for true

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/users/[userId]' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"roleId": "0",
"userId": "7843",
"firstName": "Jo",
"lastName": "Sweet",
"phoneNumber": "",
"email": "Jo.Sweet@example.com"
}
}

Update User Information

PUT /users/{userId}

Request

Update user information. Equivalent Storefront GraphQL API Mutation: userUpdate. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • userId in path - string
    required
    user ID or BigCommerce customer ID

Body

object | application/json
  • firstName
    string
    required

    User's first name
    >= 1 characters
  • lastName
    string
    required

    User's last name
    >= 1 characters
  • phoneNumber
    string
    required

    User's phone number
    >= 1 characters
  • role
    string
    required

    User role
    >= 1 characters

example

{
"firstName": "string",
"lastName": "string",
"email": "string",
"phoneNumber": "string",
"role": "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": {}
}

Delete User

DELETE /users/{userId}

Request

Delete user. Equivalent Storefront GraphQL API Mutation: userDelete. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • userId in path - string
    required
    user ID or BigCommerce customer ID

example

curl --request DELETE \
--url 'https://api-b2b.bigcommerce.com/api/v2/users/[userId]' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {}
}
Did you find what you were looking for?