User

Get a Company by User ID

GET /customers/{userId}/companies

Request

Returns information for the Company account that corresponds to the provided user ID.

Equivalent Storefront GraphQL API Query: userCompany. For more information, see the GraphQL Playground.

You must use the userId value for the Company user to return the correct Company; the customerId value of the corresponding BigCommerce customer account is not supported.

Authentication

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

Parameters

  • userId in path - string
    required
    The unique ID for the customer account.

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Get a Company User List

GET /companies/{companyId}/users

Request

Returns a list of users associated with a Company account.

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

Authentication

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

Parameters

  • companyId in path - string
    required
    The unique numeric ID of the Company account.
  • role[] in query - string
    The ID of the role assigned to the Company user account as defined at Specifying User Role.

    Allowed: 0 | 1 | 2

  • limit in query with default of 10 - string
    The total number of items per page of the response.
  • offset in query - string
    The number of items to skip before the current page of the response.
  • q in query - string
    The search string for the request.
  • minLastModifiedTime in query - string
    The earliest Unix timestamp for when the Company account was modified that can be returned.
  • maxLastModifiedTime in query - string
    The latest Unix timestamp for when the Company account was modified that can be returned.
  • minLastCreatedTime in query - string
    The earliest Unix timestamp for when the Company account was created that can be returned.
  • maxLastCreatedTime in query - string
    The earliest Unix timestamp for when the Company account was created that can be returned.

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Create a Company User

POST /companies/{companyId}/users

Request

Creates a user associated with a particular Company account.

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

If you enter an email address in the email field that is associated with a BigCommerce customer account, and the customer account does not already have a corresponding Company user account, it will link the existing customer account with the new Company user. If the email is not associated with a customer account, a new one will be created with the Company user.

You can confirm if a particular email address is associated with a BigCommerce customer account by using the Validate a Frontend User Email endpoint.

Authentication

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

Parameters

  • companyId in path - string
    required
    The unique numeric ID of the Company account.

Body

object | application/json
  • firstName
    string
    required

    The user's first name.
    Example: Marie
  • lastName
    string
    required

    The user's last name.
    Example: Curie
  • userRole
    number
    required

    The ID of the role assigned to the Company user account as defined at Specifying User Role.

    Allowed: 0 | 1 | 2

    Example: 1
  • phone
    string
    required

    The phone number associated with the user's account.
    Example: 8001234567

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Check Existence of a Customer Email

GET /users/validations/existence
⚠️
This endpoint is deprecated.

Request

This endpoint previously validated extra fields for a particular Company user by email address.

Authentication

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

Parameters

  • storeHash in query - string
    required
    The unique alphanumeric store hash for the BigCommerce store.
  • email in query - string
    required
    The email of the customer to be validated.
  • extraFieldName in query - string
    The name of the extra field.
  • extraFieldValue in query - string
    The value of the extra field.

example

Response

OK

Body

object | application/json
  • code
    number

    Default: 200

  • message
    string

  • data
    object

SUCCESS

Get User List

GET /users

Request

Returns a list of a Company’s users by role.

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

The role parameter allows you to filter for users that have a predefined Company role. You can also view all users in a Company, or users with an unknown role.

Authentication

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

Parameters

  • q in query - string
    The search string for the request.
  • role in query - string
    required

    The ID of the role assigned to the Company user account as given below.

    ValueCode
    0Admin
    1Senior Buyer
    2Junior Buyer
    3Super Admin
    4Unknown

    Allowed: 0 | 1 | 2 | 3 | 4

  • limit in query with default of 10 - string
    The total number of items per page of the response.
  • offset in query - string
    The number of items to skip before the current page of the response.

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Create a User

POST /users

Request

Creates a new user in a Company account.

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

If you enter an email address in the email field that is associated with a BigCommerce customer account, and the customer account does not already have a corresponding Company user account, it will link the existing customer account with the new Company user. If the email is not associated with a customer account, a new one will be created with the Company user.

This endpoint will send a welcome email to the new user as if they had created their account via the Storefront UI.

When you create an account this way, the user must reset their password to log in to the storefront unless they already have an existing BigCommerce customer account.

Authentication

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

Body

object | application/json
  • firstName
    string
    required

    The user's first name.
    Example: Marie
  • lastName
    string
    required

    The user's last name.
    Example: Curie
  • companyId
    string
    required

    Unique numeric ID of the Company account.
    Example: 123456
  • phoneNumber
    string
    required

    The phone number associated with the user's account.
    Example: 8001234567
  • role
    string
    required

    The ID of the role assigned to the Company user account as defined at Specifying User Role.

    Allowed: 0 | 1 | 2

    Example: 1

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Get User Information

GET /users/{userId}

Request

Returns Company user information. The userId parameter accepts both the Company user ID and the BigCommerce customer account ID.

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
    The unique ID for the customer account.
  • isBcId in query - string
    Indicates whether the userId parameter is the BigCommerce Customer ID. A value of 1 indicates that it is.

example

Response

OK

Body

object | application/json
  • message
    string

  • code
    number

    Default: 200

  • data
    object

example

Update User Information

PUT /users/{userId}

Request

Updates information about an existing Company user. The userId parameter accepts both the Company user ID and the BigCommerce customer account ID.

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
    The unique ID for the customer account.

Body

object | application/json
  • firstName
    string
    required

    The user's first name.
    Example: Marie
  • lastName
    string
    required

    The user's last name.
    Example: Curie
  • phoneNumber
    string
    required

    The phone number associated with the user's account.
    Example: 8001234567
  • role
    string
    required

    The ID of the role assigned to the Company user account as defined at Specifying User Role.

    Allowed: 0 | 1 | 2

    Example: 1

example

Response

OK

Body

object | application/json
  • code
    number

    Default: 200

  • message
    string

  • data
    object

SUCCESS

Delete a User

DELETE /users/{userId}

Request

Deletes a Company 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
    The unique ID for the customer account.

example

Response

OK

Body

object | application/json
  • code
    number

    Default: 200

  • message
    string

  • data
    object

SUCCESS

Did you find what you were looking for?