Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions docs/b2b-edition/specs/storefront/storefront/company.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ info:

A Company user is a buyer with a [BigCommerce customer account](https://developer.bigcommerce.com/docs/rest-management/customers-v2#get-all-customers) associated with a B2B Edition Company account. The Users Storefront API allows you to perform common user management tasks as a B2B buyer, such as viewing and updating user information, adding users to a Company account, and deleting them.

**NOTE:** When performing storefront user management tasks as a Company user, you must confirm that the user’s Company role has the necessary permissions for the task. See [Company Roles and Permissions](https://developer.bigcommerce.com/b2b-edition/apis/rest-management/company#company-roles-and-permissions) for a complete list of permissions and their scopes.
> **NOTE:** When performing storefront user management tasks as a Company user, you must confirm that the user’s Company role has the necessary permissions for the task. See [Company Roles and Permissions](https://developer.bigcommerce.com/b2b-edition/apis/rest-management/company#company-roles-and-permissions) for a complete list of permissions and their scopes.

### Company Users and Customer Accounts

Expand All @@ -29,12 +29,12 @@ info:
| BigCommerce customer account | B2B Edition Company user account |
| --- | --- |
| **Defines:** | **Defines:** |
| - Store credit | - Storefront channel access |
| - Abandoned cart saver and product review email consent | - Basic user information like name and email address |
| - Account password and password reset | - Assigned buyer role |
| - Tax exempt code | - Company user extra fields |
| - Account signup form fields | |
| - Data collection consent | |
| Store credit | Storefront channel access |
| Abandoned cart saver and product review email consent | Basic user information like name and email address |
| Account password and password reset | Assigned buyer role |
| Tax exempt code | Company user extra fields |
| Account signup form fields | |
| Data collection consent | |

### Specifying User Role
The role field uses numeric values to assign a role to a Company user account. B2B Edition’s predefined Company roles correspond the following values:
Expand All @@ -56,7 +56,7 @@ security:
tags:
- name: Companies
- name: Addresses
- name: User
- name: Users

paths:
/frontend/companies:
Expand All @@ -71,6 +71,8 @@ paths:

Equivalent Storefront GraphQL API Mutation: `companyCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).

> The `registerCompany` mutation in the BigCommerce Storefront GraphQL API also allows you to create a new Company account as a storefront customer. See [Company Account Registration](/docs/storefront/graphql/b2b/company-account-registration) to learn more.

If you have configured required information fields in your store’s Extra Fields settings for Company accounts or Company users, you must include the field’s name and value in the `extraFields` array of the request body. For more information on extra fields, see [B2B Edition Settings](https://support.bigcommerce.com/s/article/B2B-Edition-Settings) in the Help Center.
parameters: []
requestBody:
Expand Down Expand Up @@ -172,7 +174,7 @@ paths:
get:
tags:
- Companies
- User
- Users
summary: "Get a Company by User ID"
operationId: getcompanybyuserid
description: |-
Expand Down Expand Up @@ -231,7 +233,7 @@ paths:
get:
tags:
- Companies
- User
- Users
summary: "Get a Company User List"
operationId: get-companies-companyId-users
description: |-
Expand Down Expand Up @@ -466,7 +468,7 @@ paths:
properties:
addresses:
type: object
description: "Addresses are returned as member objects within this object using the addressId as the member key."
description: "Addresses are returned as member objects within this object using the `addressId` as the member key."
properties:
addressId:
allOf:
Expand Down Expand Up @@ -513,7 +515,7 @@ paths:
isShipping: 1
isBilling: 0
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand Down Expand Up @@ -570,7 +572,7 @@ paths:
isDefaultShipping: "0"
isDefaultBilling: "0"
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand Down Expand Up @@ -610,7 +612,7 @@ paths:
summary: "Search Company Addresses"
operationId: get-companies-companyId-addresses-searches
description: |-
Returns all addresses associated with a Company account that match the query string `q`
Returns all addresses associated with a Company account that match the query string `q`.

Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters:
Expand Down Expand Up @@ -742,7 +744,7 @@ paths:
label: "Austin Warehouse"
firstName: "Marie"
LastName: "Curie"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand Down Expand Up @@ -779,7 +781,7 @@ paths:
description: |-
Returns a specific address based on the `companyId` and `addressId` in the path.

Equivalent Storefront GraphQL API Query: address. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `address`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters: []
responses:
"200":
Expand Down Expand Up @@ -823,7 +825,7 @@ paths:
isDefaultShipping: "0"
isDefaultBilling: "0"
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand Down Expand Up @@ -893,7 +895,7 @@ paths:
isDefaultShipping: "0"
isDefaultBilling: "0"
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand Down Expand Up @@ -965,7 +967,7 @@ paths:
summary: "Get Company Default Addresses"
operationId: get-companies-companyId-default-addresses
description: |-
Returns a Company’s default shipping and billing addresses. Use Update Address Information to change which addresses are set as the defaults.
Returns a Company’s default shipping and billing addresses. Use [Update Address Information](#update-address-information) to change which addresses are set as the defaults.

Equivalent Storefront GraphQL API Query: `defaultBillingAddress` for the billing address and `defaultShippingAddress` for the shipping address. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters: []
Expand Down Expand Up @@ -1005,7 +1007,7 @@ paths:
firstName: "Marie"
lastName: "Curie"
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand All @@ -1024,7 +1026,7 @@ paths:
firstName: "Marie"
lastName: "Curie"
phoneNumber: "8001234567"
addressLine1: "11305 Four Points Drive"
addressLine1: "512 Bluebonnet Lane"
addressLine2: "Building 2"
city: "Austin"
state:
Expand All @@ -1041,7 +1043,7 @@ paths:
parameters: []
get:
tags:
- User
- Users
summary: "Check Existence of a Customer Email"
operationId: get-users-validations-existence
description: "This endpoint previously validated extra fields for a particular Company user by email address."
Expand Down Expand Up @@ -1071,7 +1073,7 @@ paths:
parameters: []
get:
tags:
- User
- Users
summary: "Get User List"
operationId: get-users
description: |-
Expand Down Expand Up @@ -1109,7 +1111,7 @@ paths:
$ref: "#/components/schemas/responsePagination"
post:
tags:
- User
- Users
summary: "Create a User"
operationId: post-users
description: |-
Expand Down Expand Up @@ -1180,7 +1182,7 @@ paths:
- $ref: "#/components/parameters/userId"
get:
tags:
- User
- Users
summary: "Get User Information"
operationId: get-users-userId
description: |-
Expand Down Expand Up @@ -1223,7 +1225,7 @@ paths:
$ref: "#/components/schemas/userEmail"
put:
tags:
- User
- Users
summary: "Update User Information"
operationId: put-users-userId
description: |-
Expand Down Expand Up @@ -1254,7 +1256,7 @@ paths:
$ref: "#/components/responses/genericResponse"
delete:
tags:
- User
- Users
summary: "Delete a User"
operationId: delete-users-userId
description: |-
Expand All @@ -1274,7 +1276,7 @@ components:
addressLine1:
type: string
description: "The first line of the address"
example: "11305 Four Points Drive"
example: "512 Bluebonnet Lane"
addressLine2:
type: string
description: "The second line of the address"
Expand Down Expand Up @@ -1388,7 +1390,7 @@ components:
companyAddress:
type: string
description: "The local address information for the address."
example: "11305 Four Points Drive, Building 2"
example: "512 Bluebonnet Lane, Building 2"
companyCity:
$ref: "#/components/schemas/companyCity"
companyState:
Expand Down
Loading