Skip to content

Commit c7c92b7

Browse files
bc-Vincebc-terra
andauthored
DEVDOCS-6473 - Unified Storefront GraphQL: Account registration workflows (#1077)
Created new guide doc for the registerCompany mutation # [DEVDOCS-6473](https://bigcommercecloud.atlassian.net/browse/DEVDOCS-6473) ## What changed? * The BigCommerce's GraphQL Storefront API now has a mutation registering new Company accounts as an existing storefront customer. * This PR adds a guide for using the `registerCompany` mutation, and adds a reference to the new guide in the REST Storefront Companies API reference article. ## Release notes draft * Created a new article to cover the `registerCompany` mutation for B2B Edition storefronts. ## Anything else? ping {names} [DEVDOCS-6473]: https://bigcommercecloud.atlassian.net/browse/DEVDOCS-6473?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Terra Hyde <[email protected]>
1 parent 13ff14f commit c7c92b7

File tree

2 files changed

+238
-29
lines changed

2 files changed

+238
-29
lines changed

docs/b2b-edition/specs/storefront/storefront/company.yaml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ info:
1818
1919
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.
2020
21-
**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.
21+
> **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.
2222
2323
### Company Users and Customer Accounts
2424
@@ -29,12 +29,12 @@ info:
2929
| BigCommerce customer account | B2B Edition Company user account |
3030
| --- | --- |
3131
| **Defines:** | **Defines:** |
32-
| - Store credit | - Storefront channel access |
33-
| - Abandoned cart saver and product review email consent | - Basic user information like name and email address |
34-
| - Account password and password reset | - Assigned buyer role |
35-
| - Tax exempt code | - Company user extra fields |
36-
| - Account signup form fields | |
37-
| - Data collection consent | |
32+
| Store credit | Storefront channel access |
33+
| Abandoned cart saver and product review email consent | Basic user information like name and email address |
34+
| Account password and password reset | Assigned buyer role |
35+
| Tax exempt code | Company user extra fields |
36+
| Account signup form fields | |
37+
| Data collection consent | |
3838
3939
### Specifying User Role
4040
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:
@@ -56,7 +56,7 @@ security:
5656
tags:
5757
- name: Companies
5858
- name: Addresses
59-
- name: User
59+
- name: Users
6060

6161
paths:
6262
/frontend/companies:
@@ -71,6 +71,8 @@ paths:
7171
7272
Equivalent Storefront GraphQL API Mutation: `companyCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
7373
74+
> 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.
75+
7476
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.
7577
parameters: []
7678
requestBody:
@@ -172,7 +174,7 @@ paths:
172174
get:
173175
tags:
174176
- Companies
175-
- User
177+
- Users
176178
summary: "Get a Company by User ID"
177179
operationId: getcompanybyuserid
178180
description: |-
@@ -231,7 +233,7 @@ paths:
231233
get:
232234
tags:
233235
- Companies
234-
- User
236+
- Users
235237
summary: "Get a Company User List"
236238
operationId: get-companies-companyId-users
237239
description: |-
@@ -466,7 +468,7 @@ paths:
466468
properties:
467469
addresses:
468470
type: object
469-
description: "Addresses are returned as member objects within this object using the addressId as the member key."
471+
description: "Addresses are returned as member objects within this object using the `addressId` as the member key."
470472
properties:
471473
addressId:
472474
allOf:
@@ -513,7 +515,7 @@ paths:
513515
isShipping: 1
514516
isBilling: 0
515517
phoneNumber: "8001234567"
516-
addressLine1: "11305 Four Points Drive"
518+
addressLine1: "512 Bluebonnet Lane"
517519
addressLine2: "Building 2"
518520
city: "Austin"
519521
state:
@@ -570,7 +572,7 @@ paths:
570572
isDefaultShipping: "0"
571573
isDefaultBilling: "0"
572574
phoneNumber: "8001234567"
573-
addressLine1: "11305 Four Points Drive"
575+
addressLine1: "512 Bluebonnet Lane"
574576
addressLine2: "Building 2"
575577
city: "Austin"
576578
state:
@@ -610,7 +612,7 @@ paths:
610612
summary: "Search Company Addresses"
611613
operationId: get-companies-companyId-addresses-searches
612614
description: |-
613-
Returns all addresses associated with a Company account that match the query string `q`
615+
Returns all addresses associated with a Company account that match the query string `q`.
614616
615617
Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
616618
parameters:
@@ -742,7 +744,7 @@ paths:
742744
label: "Austin Warehouse"
743745
firstName: "Marie"
744746
LastName: "Curie"
745-
addressLine1: "11305 Four Points Drive"
747+
addressLine1: "512 Bluebonnet Lane"
746748
addressLine2: "Building 2"
747749
city: "Austin"
748750
state:
@@ -779,7 +781,7 @@ paths:
779781
description: |-
780782
Returns a specific address based on the `companyId` and `addressId` in the path.
781783
782-
Equivalent Storefront GraphQL API Query: address. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
784+
Equivalent Storefront GraphQL API Query: `address`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
783785
parameters: []
784786
responses:
785787
"200":
@@ -823,7 +825,7 @@ paths:
823825
isDefaultShipping: "0"
824826
isDefaultBilling: "0"
825827
phoneNumber: "8001234567"
826-
addressLine1: "11305 Four Points Drive"
828+
addressLine1: "512 Bluebonnet Lane"
827829
addressLine2: "Building 2"
828830
city: "Austin"
829831
state:
@@ -893,7 +895,7 @@ paths:
893895
isDefaultShipping: "0"
894896
isDefaultBilling: "0"
895897
phoneNumber: "8001234567"
896-
addressLine1: "11305 Four Points Drive"
898+
addressLine1: "512 Bluebonnet Lane"
897899
addressLine2: "Building 2"
898900
city: "Austin"
899901
state:
@@ -965,7 +967,7 @@ paths:
965967
summary: "Get Company Default Addresses"
966968
operationId: get-companies-companyId-default-addresses
967969
description: |-
968-
Returns a Company’s default shipping and billing addresses. Use Update Address Information to change which addresses are set as the defaults.
970+
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.
969971
970972
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).
971973
parameters: []
@@ -1005,7 +1007,7 @@ paths:
10051007
firstName: "Marie"
10061008
lastName: "Curie"
10071009
phoneNumber: "8001234567"
1008-
addressLine1: "11305 Four Points Drive"
1010+
addressLine1: "512 Bluebonnet Lane"
10091011
addressLine2: "Building 2"
10101012
city: "Austin"
10111013
state:
@@ -1024,7 +1026,7 @@ paths:
10241026
firstName: "Marie"
10251027
lastName: "Curie"
10261028
phoneNumber: "8001234567"
1027-
addressLine1: "11305 Four Points Drive"
1029+
addressLine1: "512 Bluebonnet Lane"
10281030
addressLine2: "Building 2"
10291031
city: "Austin"
10301032
state:
@@ -1041,7 +1043,7 @@ paths:
10411043
parameters: []
10421044
get:
10431045
tags:
1044-
- User
1046+
- Users
10451047
summary: "Check Existence of a Customer Email"
10461048
operationId: get-users-validations-existence
10471049
description: "This endpoint previously validated extra fields for a particular Company user by email address."
@@ -1071,7 +1073,7 @@ paths:
10711073
parameters: []
10721074
get:
10731075
tags:
1074-
- User
1076+
- Users
10751077
summary: "Get User List"
10761078
operationId: get-users
10771079
description: |-
@@ -1109,7 +1111,7 @@ paths:
11091111
$ref: "#/components/schemas/responsePagination"
11101112
post:
11111113
tags:
1112-
- User
1114+
- Users
11131115
summary: "Create a User"
11141116
operationId: post-users
11151117
description: |-
@@ -1180,7 +1182,7 @@ paths:
11801182
- $ref: "#/components/parameters/userId"
11811183
get:
11821184
tags:
1183-
- User
1185+
- Users
11841186
summary: "Get User Information"
11851187
operationId: get-users-userId
11861188
description: |-
@@ -1223,7 +1225,7 @@ paths:
12231225
$ref: "#/components/schemas/userEmail"
12241226
put:
12251227
tags:
1226-
- User
1228+
- Users
12271229
summary: "Update User Information"
12281230
operationId: put-users-userId
12291231
description: |-
@@ -1254,7 +1256,7 @@ paths:
12541256
$ref: "#/components/responses/genericResponse"
12551257
delete:
12561258
tags:
1257-
- User
1259+
- Users
12581260
summary: "Delete a User"
12591261
operationId: delete-users-userId
12601262
description: |-
@@ -1274,7 +1276,7 @@ components:
12741276
addressLine1:
12751277
type: string
12761278
description: "The first line of the address"
1277-
example: "11305 Four Points Drive"
1279+
example: "512 Bluebonnet Lane"
12781280
addressLine2:
12791281
type: string
12801282
description: "The second line of the address"
@@ -1388,7 +1390,7 @@ components:
13881390
companyAddress:
13891391
type: string
13901392
description: "The local address information for the address."
1391-
example: "11305 Four Points Drive, Building 2"
1393+
example: "512 Bluebonnet Lane, Building 2"
13921394
companyCity:
13931395
$ref: "#/components/schemas/companyCity"
13941396
companyState:

0 commit comments

Comments
 (0)