Storefront APIs
Company

Company

Company refers to a collection of customers. BigCommerce B2B Edition special provided company member management and convenience of company purchasing.

Create A Company

POST /frontend/companies

Request

Create a company on the storefront. Equivalent Storefront GraphQL API Mutation: companyCreate. For more information, see the GraphQL Playground.

Authentication

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

Body

object | application/json
  • addressLine1
    string
    required

    Company address line
  • addressLine2
    string
    required

    Another company address line
  • city
    string
    required

    Company city
  • companyEmail
    string
    required

    Company email
    Example: kobe@bu.com
  • companyFirstName
    string
    required

    First name of company admin manager
    Example: xxxx
  • companyLastName
    string
    required

    Last name of company admin manager
    Example: xxxxx
  • companyName
    string
    required

    Company name
    Example: KobeTestCrop
  • companyPhoneNumber
    string
    required

    Company phone number
    Example: 17316289569
  • customerId
    string
    required

    Company admin manager's customer user ID in BigCommerce
  • extraFields
    array[object]

  • state
    string
    required

    Company state
  • storeHash
    string
    required

    Store Hash
    Example: storeHash
  • zipCode
    string
    required

    Company zip code
  • country
    string
    required

    Company country

example

{
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"companyEmail": "kobe@bu.com",
"companyFirstName": "xxxx",
"companyLastName": "xxxxx",
"companyName": "KobeTestCrop",
"companyPhoneNumber": "17316289569",
"customerId": "string",
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
],
"state": "string",
"storeHash": "storeHash",
"zipCode": "string",
"country": "string"
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 0,
"message": "string",
"data": {
"companyId": 1233
}
}

Get Company Extra Fields

GET /companies/extra-fields/storefront

Request

Get company extra fields. Equivalent Storefront GraphQL API Query: companyExtraFields. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • storeHash in query - string
    required
    Store Hash

example

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

Response

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    array[object]
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": [
{
"fieldName": "company_tax_exempt_code",
"labelName": "Company Tax Exempt Code",
"dataType": "0",
"isRequired": "0"
}
]
}

Get Company by User ID

GET /customers/{userId}/companies

Request

Get company information by user ID. Equivalent Storefront GraphQL API Query: userCompany. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • userId in path - string
    required
    B2B Edition user ID

example

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

Response

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"companyName": "company a",
"bcGroupName": "company a",
"companyStatus": "1",
"description": "Company a",
"addressLine1": "",
"addressLine2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"companyId": "5716",
"catalogId": "5",
"extraFields": [
{
"fieldName": "company_tax_exempt_code",
"labelName": "Company Tax Exempt Code",
"dataType": "0",
"isRequired": "0",
"fieldValue": ""
}
]
}
}

Create Company User

POST /companies/{companyId}/users

Request

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

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique ID of this company

Body

object | application/json
  • firstName
    string
    required

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

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

    User's phone number
    >= 1 characters
  • userRole
    number
    required

    User role

example-1

{
"firstName": "Ada",
"lastName": "MK",
"email": "test@test12.com",
"phone": "1234567",
"userRole": 1
}

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": 7838
}
}

Get Company User List

GET /companies/{companyId}/users

Request

Query company's 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

  • companyId in path - string
    required
    Unique ID of this company
  • minLastModifiedTime in query - string
    Minimum last modified time
  • maxLastModifiedTime in query - string
    Maximum last modified time
  • minLastCreatedTime in query - string
    Minimum last created time
  • maxLastCreatedTime in query - string
    Maximum last created time
  • offset in query - string
    Pagination offset
  • limit in query - string
    Pagination limit
  • q in query - string
    Query string
  • role[] in query - string
    User role, 0: Admin, 1:Senior Buyer, 2: Junior Buyer

    Allowed: 0 | 1 | 2

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/[companyId]/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": "7837",
"phoneNumber": "12345678",
"role": "0",
"email": "admin@admin.com",
"uuid": "",
"createdAt": "1622444011",
"updatedAt": "1622444501",
"firstName": "test",
"lastName": "test",
"catalogId": "5"
}
],
"pagination": {
"totalCount": 1,
"offset": 0,
"limit": 10
}
}
}

Validate Frontend User Email

GET /companies/validations/frontend/user-emails/{email}

Request

Check if the user email is valid for current company. Equivalent Storefront GraphQL API Query: userEmailCheck. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • email in path - string
    required
    Email address of the user
  • companyId in query - string
    Company ID
  • role in query - string
    required
    User role , 0: "Admin" 1: "Senior Buyer" 2: "Junior Buyer" 3: "Sales Rep" 4: "UNKNOWN"

    Allowed: 0 | 1 | 2 | 3 | 4

  • storeHash in query - string
    required
    Store Hash

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/validations/frontend/user-emails/[email]' \
--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": {
"isValid": "0",
"userInfo": {
"id": "7831",
"firstName": "Ada",
"lastName": "Brook",
"phoneNumber": "",
"role": "0",
"email": "example@example.com"
}
}
}

Get Countries List

GET /companies/addresses/countries

Request

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

Authentication

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

Parameters

  • storeHash in query - string
    Store hash

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/companies/addresses/countries \
--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": 0,
"message": "string",
"data": {
"list": [
{
"id": 1,
"countryName": "Albania",
"countryCode": "AL",
"states": []
}
]
}
}

Get Address Edit Permission

GET /companies/addresses/permission

Request

Get whether there is the permission to modify addresses(storefront). Equivalent Storefront GraphQL API Query: addressConfig. For more information, see the GraphQL Playground.

Authentication

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

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/companies/addresses/permission \
--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": {
"isAllow": "1",
"isEnabled": "1"
}
}

Get Company Address List

GET /companies/{companyId}/addresses

Request

Get company address book by company ID. Equivalent Storefront GraphQL API Query: addresses. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/[companyId]/addresses' \
--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": {
"addresses": {
"addressId": {
"addressId": 1410,
"firstName": "Ada",
"lastName": "Bo",
"isShipping": 1,
"isBilling": 1,
"addressLine1": "address 1",
"addressLine2": "address 2",
"city": "New York",
"country": {
"countryName": "United States",
"countryCode": "US"
},
"zipCode": "10013",
"state": {
"stateName": "New York",
"stateCode": "NY"
},
"phoneNumber": "17161017095",
"label": "labels"
}
},
"defaultShippingId": "1410",

Create an Address of a Company

POST /companies/{companyId}/addresses

Request

Create a new address of a company. Equivalent Storefront GraphQL API Mutation: addressCreate. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID

Body

object | application/json
Extra Field Values
  • addressLine1
    string
    required

    One address line
  • addressLine2
    string

    Another one address line
  • city
    string
    required

    Address city
  • country
    object
    required

    Address country info
  • firstName
    string
    required

    Address first name
  • isBilling
    string

    Boolean object should be '0' or '1'
  • isDefaultBilling
    string

    Boolean object should be '0' or '1'
  • isDefaultShipping
    string

    Boolean object should be '0' or '1'
  • isShipping
    string

    Boolean object should be '0' or '1'
  • label
    string

  • phoneNumber
    string

    Address phone number
  • state
    object

    Address state info
  • zipCode
    string

    Zipcode of address city
  • extraFields
    array[object]

example-1

{
"label": "label",
"firstName": "Ada",
"lastName": "Bob",
"addressLine1": "line1",
"addressLine2": "line1",
"city": "AS",
"zipCode": "10013",
"phoneNumber": "16732680944",
"country": {
"countryName": "Argentina",
"countryCode": "AR"
},
"state": {
"stateName": "Mendoza",
"stateCode": "M"
},
"isShipping": "1",
"isBilling": "1",
"isDefaultShipping": "1",
"isDefaultBilling": "1"
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "Success",
"data": {
"addressId": "1415"
}
}

Search Company Address

GET /companies/{companyId}/addresses/searches

Request

Get company address book by companyId. Equivalent Storefront GraphQL API Query: addresses. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID
  • limit in query with default of 10 - string
    required
    Pagination limit
  • offset in query with default of 0 - string
    required
    Pagination offset
  • q in query - string
    Query string

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/[companyId]/addresses/searches' \
--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": {
"addressBookStatus": "1",
"defaultAddress": {
"companyId": "5716",
"companyName": "company name",
"companyAddress": "",
"companyCountry": "",
"companyCountryCode": "",
"companyState": "",
"companyStateCode": "",
"companyCity": "",
"companyZipCode": "",
"firstName": "",
"lastName": "",
"phoneNumber": "123456789",
"label": ""
},
"list": [
{
"companyId": "5716",
"companyName": "company name",
"companyAddress": "line1 line1",
"companyCountry": "Argentina",
"companyCountryCode": "AR",

Search Address with Multiple Filter

POST /companies/{companyId}/addresses/searches

Request

Get address book by company ID and use this post because of we are creating a multiple search. Equivalent Storefront GraphQL API Query: addresses. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID

Body

object | application/json
  • filters
    object

  • offset
    number

    Pagination offset
  • limit
    number

    Pagination limit
  • q
    string

    Query 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": {
"pagination": {
"totalCount": 1,
"offset": 0,
"limit": 10
},
"list": [
{
"addressId": "1410",
"firstName": "Ada",
"lastName": "Bo",
"addressLine1": "address 1",
"addressLine2": "address 2",
"city": "New York",
"state": {
"stateName": "Ohio",
"stateCode": "OH"
},
"country": {
"countryName": "United States",
"countryCode": "US"
},
"phoneNumber": "17161017095",
"zipCode": "10013",
"isShipping": "1",

Get an Address

GET /companies/{companyId}/addresses/{addressId}

Request

Get an address info by companyId. Equivalent Storefront GraphQL API Query: address. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID
  • addressId in path - string
    required
    Unique address ID

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/[companyId]/addresses/[addressId]' \
--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

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

example-1

{
"code": 0,
"message": "string",
"data": {
"label": "string",
"firstName": "string",
"lastName": "string",
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"zipCode": "string",
"phoneNumber": "string",
"country": {
"countryName": "string",
"countryCode": "string"
},
"state": {
"stateName": "string",
"stateCode": "string"
},
"isShipping": "string",
"isBilling": "string",
"isDefaultShipping": "string",
"isDefaultBilling": "string",
"addressId": "string"
}
}

Update an address's Info

PUT /companies/{companyId}/addresses/{addressId}

Request

Update an address's info. Equivalent Storefront GraphQL API Mutation: addressUpdate. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID
  • addressId in path - string
    required
    Unique address ID

Body

object | application/json
  • label
    string
    required

    >= 1 characters
  • firstName
    string
    required

    >= 1 characters
  • lastName
    string
    required

    >= 1 characters
  • addressLine1
    string
    required

    >= 1 characters
  • addressLine2
    string
    required

    >= 1 characters
  • city
    string
    required

    >= 1 characters
  • zipCode
    string
    required

    >= 1 characters
  • phoneNumber
    string
    required

    >= 1 characters
  • country
    object
    required

  • state
    object
    required

  • isShipping
    string
    required

    >= 1 characters
  • isBilling
    string
    required

    >= 1 characters
  • isDefaultShipping
    string
    required

    >= 1 characters
  • isDefaultBilling
    string
    required

    >= 1 characters
  • addressId
    string
    required

    >= 1 characters
  • extraFields
    array[object]

example-2

{
"label": "string",
"firstName": "string",
"lastName": "string",
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"zipCode": "string",
"phoneNumber": "string",
"country": {
"countryName": "string",
"countryCode": "string"
},
"state": {
"stateName": "string",
"stateCode": "string"
},
"isShipping": "string",
"isBilling": "string",
"isDefaultShipping": "string",
"isDefaultBilling": "string",
"addressId": "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": {
"addressId": "1415"
}
}

Mark an Address as Active or Inactive

PUT /companies/{companyId}/addresses/{addressId}/activation

Request

Mark an address as active or inactive. Equivalent Storefront GraphQL API Mutation: addressDelete. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID
  • addressId in path - string
    required
    Unique address ID

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "Success",
"data": {
"addressId": "1415"
}
}

Get Company Default Addresses

GET /companies/{companyId}/default-addresses

Request

Get default addresses by companyId. Equivalent Storefront GraphQL API Query: defaultBillingAddress and defaultShippingAddress. For more information, see the GraphQL Playground.

Authentication

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

Parameters

  • companyId in path - string
    required
    Unique company ID

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/companies/[companyId]/default-addresses' \
--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": {
"shipping": {
"addressId": "1414",
"firstName": "Ada",
"lastName": "Bob",
"addressLine1": "line1",
"addressLine2": "line1",
"country": {
"countryName": "Argentina",
"countryCode": "AR"
},
"state": {
"stateName": "Mendoza",
"stateCode": "M"
},
"city": "AS",
"phoneNumber": "16732680944",
"zipCode": "10013",
"label": "label"
},
"billing": {
"addressId": "1414",
"firstName": "Ada",
"lastName": "Bob",
"addressLine1": "line1",
"addressLine2": "line1",

See something you can improve? Edit this file on GitHub

Did you find what you were looking for?