Skip to content

Commit

Permalink
DEVDOCS-5655: [update] b2b-company.yml (#534)
Browse files Browse the repository at this point in the history
<!-- Ticket number or summary of work -->
# [DEVDOCS-5655]


## What changed?
Updated company.yml

## Release notes draft
N/A
## Anything else?
<!-- Add related PRs, salient notes, additional ticket numbers, etc. -->

ping {names}


[DEVDOCS-5655]:
https://bigcommercecloud.atlassian.net/browse/DEVDOCS-5655?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Nate Stewart <[email protected]>
  • Loading branch information
bc-traciporter and becomevocal authored Oct 9, 2024
1 parent 10b5eb8 commit eed8091
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 167 deletions.
200 changes: 37 additions & 163 deletions docs/b2b-edition/specs/storefront/storefront/company.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ info:
description: Company refers to a collection of customers. BigCommerce B2B Edition special provided company member management and convenience of company purchasing.
servers:
- url: 'https://api-b2b.bigcommerce.com/api/v2'
security:
- BearerToken: []
paths:
/frontend/companies:
post:
deprecated: false
description: |-
Create a company on frontend.
<br>Equivalent Storefront GraphQL API Mutation: `companyCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Create a company on the storefront.
Equivalent Storefront GraphQL API Mutation: `companyCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
operationId: createcompany(fronted)
parameters: []
requestBody:
Expand Down Expand Up @@ -216,16 +218,14 @@ paths:
operationId: get-companies-extra_fields-storefront
description: |-
Get company extra fields.
<br>Equivalent Storefront GraphQL API Query: `companyExtraFields`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
security:
- authToken: []
Equivalent Storefront GraphQL API Query: `companyExtraFields`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters: []
'/customers/{userId}/companies':
get:
deprecated: false
description: |-
Get company info by user ID
<br>Equivalent Storefront GraphQL API Query: `userCompany`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Get company information by user ID
Equivalent Storefront GraphQL API Query: `userCompany`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
operationId: getcompanybyuserid
parameters: []
responses:
Expand Down Expand Up @@ -371,8 +371,6 @@ paths:
summary: Get Company by User ID
tags:
- Company
security:
- authToken: []
parameters:
- schema:
type: string
Expand Down Expand Up @@ -431,7 +429,7 @@ paths:
userId: 7838
description: |-
Create company user
<br>Equivalent Storefront GraphQL API Mutation: `userCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `userCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
requestBody:
content:
application/json:
Expand Down Expand Up @@ -481,8 +479,6 @@ paths:
userRole: 1
tags:
- Company
security:
- authToken: []
get:
summary: Get Company User List
operationId: get-companies-companyId-users
Expand Down Expand Up @@ -633,7 +629,7 @@ paths:
limit: 10
description: |-
Query company's user list.
<br>Equivalent Storefront GraphQL API Query: `users`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `users`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters:
- schema:
type: string
Expand Down Expand Up @@ -681,9 +677,7 @@ paths:
description: 'User role, 0: Admin, 1:Senior Buyer, 2: Junior Buyer'
tags:
- Company
security:
- authToken: []
'/companies/validations/fronted/user-emails/{email}':
'/companies/validations/frontend/user-emails/{email}':
parameters:
- schema:
type: string
Expand Down Expand Up @@ -783,8 +777,8 @@ paths:
email: [email protected]
operationId: get-companies-validations-fronted-user-emails-email
description: |-
Check if user email can be used for current company,user info and available status will be respond.(fronted)
<br>Equivalent Storefront GraphQL API Query: `userEmailCheck`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Check if the user email is valid for current company.
Equivalent Storefront GraphQL API Query: `userEmailCheck`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters:
- schema:
type: string
Expand Down Expand Up @@ -2620,7 +2614,7 @@ paths:
operationId: get-companies-addresses-countries
description: |-
Get countries list.
<br>Equivalent Storefront GraphQL API Query: `countries`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `countries`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters:
- schema:
type: string
Expand Down Expand Up @@ -2682,130 +2676,9 @@ paths:
operationId: get-companies-addresses-permission
description: |-
Get whether there is the permission to modify addresses(storefront).
<br>Equivalent Storefront GraphQL API Query: `addressConfig`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
'/companies/validations/backend/user-emails/{email}':
parameters:
- schema:
type: string
name: email
in: path
required: true
description: User's email
get:
summary: Check User Email Availability
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
x-examples:
example-1:
code: 200
message: Success
data:
isValid: '0'
userInfo:
id: '7831'
firstName: levi
lastName: tuo
phoneNumber: ''
role: '0'
email: [email protected]
properties:
code:
type: number
message:
type: string
minLength: 1
data:
type: object
required:
- isValid
- userInfo
properties:
isValid:
type: string
minLength: 1
description: Is vaild of this email
userInfo:
type: object
required:
- id
- firstName
- lastName
- phoneNumber
- role
- email
properties:
id:
type: string
minLength: 1
description: Unique user ID
firstName:
type: string
minLength: 1
description: User's first name
lastName:
type: string
minLength: 1
description: User's last name
phoneNumber:
type: string
description: User's phone number
role:
type: string
minLength: 1
description: User role
email:
type: string
minLength: 1
description: User's email
required:
- code
- message
- data
examples:
example-1:
value:
code: 200
message: Success
data:
isValid: '0'
userInfo:
id: '7831'
firstName: Ada
lastName: Brook
phoneNumber: ''
role: '0'
email: [email protected]
operationId: get-companies-validations-backend-user-emails-email
parameters:
- schema:
type: string
in: query
name: companyId
description: Company ID
- schema:
type: string
enum:
- '0'
- '1'
- '2'
- '3'
- '4'
in: query
name: role
description: 'User role, 0: "Admin" 1: "Senior Buyer" 2: "Junior Buyer" 3: "Sales Rep" 4: "UNKNOWN"'
required: true
description: Check if a user email can be used for a company; user info and available status will be in the reponse(backend)
Equivalent Storefront GraphQL API Query: `addressConfig`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
x-internal: true
'/companies/{companyId}/addresses':
parameters:
- schema:
Expand Down Expand Up @@ -2888,7 +2761,7 @@ paths:
description: Address last name
isShipping:
type: number
description: Is this address use for shipping
description: Is this address use for shipping.
isBilling:
type: number
description: If this address use for billing.
Expand Down Expand Up @@ -2920,7 +2793,7 @@ paths:
zipCode:
type: string
minLength: 1
description: Zipcode of address city
description: Zip code of address city
state:
type: object
description: Address state info
Expand Down Expand Up @@ -3002,8 +2875,8 @@ paths:
canEnterNewAddress: false
operationId: get-companies-companyId-addresses
description: |-
Get company address book by companyId.
<br>Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Get company address book by company ID.
Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
post:
Expand Down Expand Up @@ -3139,7 +3012,7 @@ paths:
addressId: '1415'
description: |-
Create a new address of a company.
<br>Equivalent Storefront GraphQL API Mutation: `addressCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `addressCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
'/companies/{companyId}/addresses/searches':
Expand Down Expand Up @@ -3415,7 +3288,7 @@ paths:
operationId: get-companies-companyId-addresses-searches
description: |-
Get company address book by companyId.
<br>Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
parameters:
- schema:
type: string
Expand Down Expand Up @@ -3644,7 +3517,7 @@ paths:
billingAddressId: '1415'
description: |-
Get address book by company ID and use this post because of we are creating a multiple search.
<br>Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
requestBody:
content:
application/json:
Expand Down Expand Up @@ -3893,7 +3766,7 @@ paths:
operationId: get-companies-companyId-addresses-addressId
description: |-
Get an address info by companyId.
<br>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).
tags:
- Company
put:
Expand Down Expand Up @@ -3940,7 +3813,7 @@ paths:
addressId: '1415'
description: |-
Update an address's info.
<br>Equivalent Storefront GraphQL API Mutation: `addressUpdate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `addressUpdate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
requestBody:
content:
application/json:
Expand Down Expand Up @@ -4238,11 +4111,9 @@ paths:
addressId: '1415'
description: |-
Mark an address as active or inactive.
<br>Equivalent Storefront GraphQL API Mutation: `addressDelete`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `addressDelete`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
security:
- authToken: []
'/companies/{companyId}/default-addresses':
parameters:
- schema:
Expand Down Expand Up @@ -4493,7 +4364,7 @@ paths:
operationId: get-companies-companyId-default-addresses
description: |-
Get default addresses by companyId.
<br>Equivalent Storefront GraphQL API Query: `defaultBillingAddress` and `defaultShippingAddress`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `defaultBillingAddress` and `defaultShippingAddress`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- Company
/users/validations/existence:
Expand Down Expand Up @@ -4797,7 +4668,7 @@ paths:
required: true
description: |-
Get user list.
<br>Equivalent Storefront GraphQL API Query: `users`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `users`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- User
post:
Expand Down Expand Up @@ -4874,7 +4745,7 @@ paths:
role: '0'
description: |-
Create a user.
<br>Equivalent Storefront GraphQL API Mutation: `userCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `userCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
requestBody:
content:
application/json:
Expand Down Expand Up @@ -5013,7 +4884,7 @@ paths:
operationId: get-users-userId
description: |-
Get user infomation by userId.
<br>Equivalent Storefront GraphQL API Query: `user`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Query: `user`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- User
parameters:
Expand Down Expand Up @@ -5100,7 +4971,7 @@ paths:
- role
description: |-
Update user information.
<br>Equivalent Storefront GraphQL API Mutation: `userUpdate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `userUpdate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- User
delete:
Expand Down Expand Up @@ -5140,18 +5011,21 @@ paths:
data: {}
description: |-
Delete user.
<br>Equivalent Storefront GraphQL API Mutation: `userDelete `. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
Equivalent Storefront GraphQL API Mutation: `userDelete `. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).
tags:
- User
components:
schemas: {}
securitySchemes:
authToken:
name: authToken
BearerToken:
name: BearerToken
description: |-
### Authentication header
| Header | Argument | Description |
|:-------|:---------|:------------|
|`Authorization`|`Bearer {{B2B_JWT_TOKEN}}`| You can obtain this token using the steps described in the [REST Storefront API](/b2b-edition/docs/authentication#rest-storefront-api) section of the [Authentication for hosted storefront](https://developer.bigcommerce.com/b2b-edition/docs/authentication) article. |
type: apiKey
in: header
security:
- authToken: []
tags:
- name: Company
- name: User
Loading

0 comments on commit eed8091

Please sign in to comment.