B2B Edition
User

User

Update A Company User

PUT /companies/{companyId}/user/{userId}
⚠️
This endpoint is deprecated.

Request

Update a company user info

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • userId in path - string
    required
  • authToken in header - string
    required
    Auth token in header

Body

object | application/json
Extra Field Values
  • firstName
    string

  • lastName
    string

  • phone
    string

  • uuid
    string

  • userRole
    string

  • acceptWelcomeEmail
    string

  • channelIds
    array[integer]

    BigCommerce channel id list.
  • companyRoleId
    integer

    The company role id. This field is only applicable to the company's RBAC feature. If your store doesn't utilize this feature, please do not use this field. When it has a value, it will override the value of the userRole field.
  • extraFields
    array[object]

example

{
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}

Response

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

{
"code": 0,
"data": {
"customerId": 0,
"userId": 0
},
"message": "string"
}

Get Company Users

GET /companies/{companyId}/users
⚠️
This endpoint is deprecated.

Request

Get company users, with pagination data

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • authToken in header - string
    required
    Auth token in header.
  • offset in query - number
    Pagination offset default: 0
  • limit in query - number
    Pagination limit default: 10
  • role[] in query - string
    user role(0=admin 1=senior_buyer 2=junior_buyer 3=sales_rep) eg. role[]=1, 2
  • isIncludeExtraFields in query - string
    0 or 1

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/io/companies/[companyId]/users' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

Response Success

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

{
"code": 200,
"data": {
"list": [
{
"catalogId": "1",
"createdAt": "1574999690",
"email": "test323@test.com",
"firstName": "test",
"id": "123",
"lastName": "test2",
"phoneNumber": "",
"role": "1",
"updatedAt": "1574999690",
"uuid": "A123456",
"channelList": []
}
],
"pagination": {
"limit": 10,
"offset": 0,
"totalCount": 1
}
},
"message": "SUCCESS"
}

Update Company User

PUT /companies/{companyId}/users
⚠️
This endpoint is deprecated.

Request

Update company user's field, user identified by email field.fields can not omit

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • authToken in header - string
    required
    Auth token in header.

Body

object | application/json
Extra Field Values
  • acceptWelcomeEmail
    string

    (0=will not receive email 1=will receive email)

    Allowed: 0 | 1

  • firstName
    string
    required

  • lastName
    string
    required

  • phone
    string

  • userRole
    string

    user role(0=admin 1=senior_buyer 2=junior_buyer 3=sales_rep)
  • uuid
    string

  • channelIds
    array[integer]

    BigCommerce channel id list
  • companyRoleId
    integer

    The company role id. This field is only applicable to the company's RBAC feature. If your store doesn't utilize this feature, please do not use this field. When it has a value, it will override the value of the userRole field.
  • extraFields
    array[object]

example

{
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}

Response

Response Success

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

{
"code": 200,
"data": {
"customerId": "2",
"userId": "2"
},
"message": "Success"
}

Create A Company User

POST /companies/{companyId}/users
⚠️
This endpoint is deprecated.

Request

Create a company user, which belongs company

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • authToken in header - string
    required
    Auth token in header.

Body

object | application/json
Extra Field Values
  • acceptWelcomeEmail
    string

    (0=will not receive email 1=will receive email)

    Allowed: 0 | 1

  • firstName
    string
    required

  • lastName
    string
    required

  • phone
    string
    required

  • userRole
    string

    user role(0=admin 1=senior_buyer 2=junior_buyer 3=sales_rep)
  • uuid
    string

  • channelIds
    array[integer]

    BigCommerce channel id list
  • originChannelId
    integer

    BigCommerce channel id, used for BigCommerce customer origin channel id. This field takes effect only when the store default b2b channel is not configured
  • companyRoleId
    integer

    The company role id. This field is only applicable to the company's RBAC feature. If your store doesn't utilize this feature, please do not use this field. When it has a value, it will override the value of the userRole field.
  • extraFields
    array[object]

example

{
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}

Response

Response Success

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

{
"code": 200,
"data": {
"customerId": "2",
"userId": "2"
},
"message": "Success"
}

Bulk Create Company User

POST /companies/{companyId}/users/bulk_create
⚠️
This endpoint is deprecated.

Request

Create company users in batch

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • authToken in header - string
    required
    Auth token in header.

Body

object | application/json
Request body
  • acceptWelcomeEmail
    string

    (0=will not receive email 1=will receive email)

    Allowed: 0 | 1

  • users
    array[object]

example

{
"acceptWelcomeEmail": "0",
"users": [
{
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}
]
}

Response

Response Success

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

{
"code": 200,
"data": {
"failedItems": [],
"successfulItems": [
{
"customerId": 2,
"email": "test323@test121.com",
"firstName": "test11",
"lastName": "test2",
"phone": "122331211",
"userRole": 1
},
{
"customerId": 2,
"email": "test323@test22.com",
"firstName": "test12",
"lastName": "test2",
"phone": "122331212",
"userRole": 1
}
]
},
"message": "Success"
}

Get A Company User

GET /companies/{companyId}/users/{customerId}
⚠️
This endpoint is deprecated.

Request

Get a company user's info, by company and customer id

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • customerId in path - string
    required
  • authToken in header - string
    required
    Auth token in header.

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/io/companies/[companyId]/users/[customerId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

Response Success

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Extra Field Values
    Example: {"extraFields":[{"fieldName":"string","fieldValue":"string"}]}
  • message
    string

    Response message

example

{
"code": 200,
"data": {
"catalogId": "1",
"createdAt": "1574999690",
"email": "test323@test.com",
"firstName": "test",
"id": "123",
"lastName": "test2",
"phoneNumber": "",
"role": "1",
"updatedAt": "1574999690",
"uuid": "A123456",
"channelList": []
},
"message": "SUCCESS"
}

Delete A Company User

DELETE /companies/{companyId}/users/{customerId}
⚠️
This endpoint is deprecated.

Request

Delete a company user, if this user is the only one administrator of company, will return a 500 Error

Authentication

  • authToken in header

Parameters

  • companyId in path - string
    required
  • customerId in path - string
    required
  • authToken in header - string
    required
    Auth token in header

example

curl --request DELETE \
--url 'https://api-b2b.bigcommerce.com/api/v2/io/companies/[companyId]/users/[customerId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

Deleted successful

Body

object | application/json
  • code
    number

    Response status code
  • data
    object

    Response data
  • message
    string

    Response message

example

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