Manage company users
A company user is a customer (buyer) that is assigned extended attributes that identify the company the user belongs to. Use the POST /V1/customers
call, which is included with Magento Magento Open Source and Magento Commerce, and specify the company_attributes
extended attributes to create a company user.
This topic discusses only the features of the customerCustomerRepositoryV1
service that are specific to B2B. See Create a customer for an example of creating a standard customer.
Manage company users
This section describes the REST endpoints used to manage company users.
Service Name
customerCustomerRepositoryV1
REST Endpoints
Company user parameters
The following table lists the parameters that can be used to create a company user.
Name | Description | Format | Requirements |
---|---|---|---|
customer_id |
System-generated customer ID. | integer | Not applicable for create operations. |
company_id |
System-generated company ID. | integer | Required to create or update a company user. |
job_title |
A string that describes the company user’s responsibilities. | Required to create or update a company. | |
status |
Indicates whether the company user is active or inactive | integer | 0 - inactive; 1 - active |
telephone |
Telephone number | string | Required to create a company user. |
Create a company user
The POST /V1/customers
call creates a Magento customer. B2B extends the customerAccountManagementV1
service so that you can create a company user.
Sample Usage
POST /V1/customers
Payload
Add the company_attributes
code block to the payload that is required to create a standard customer.
Full example:
Response
Modify a company user
The following example changes the status of a company user to inactive.
If you change the status
to inactive, the account is locked. If the company user has child users, the system re-assigns the child users to the parent of the deactivated user.
Sample Usage
PUT /V1/customers/13
Payload
Response
Delete a company user
If the specified company user has child users, the system re-assigns the child users to the parent of the deleted user. The user account is deleted from Magento with all of its content, except quotes and orders. The user’s orders and quotes remain visible to the seller.
Magento locks the deleted user’s quotes and changes their status to Closed. The system does not allow to make changes on such quotes.
Sample Usage
DELETE /V1/customers/13
Payload
Not applicable
Response
true
, indicating the request was successful