Magento 2 B2B Company Guide: Revealing Company Structure & Import
If you want to migrate from the existing Magento B2B website, you may face a problem when companies cannot be moved with the help of the default Magento 2 tools. Neither can you synchronize the existing Magento 2 B2B company structure between several websites. Thus, you should run the transfer manually, recreating the entire storefront section manually. But what if there is a more user-friendly way of importing and exporting Magento 2 B2B companies? In the following article, we shed light on what a Magento B2B company account is. You will learn the nuances of the Magento 2 company structure; and after that, we will guide you through the corresponding data import process. You will learn the attributes used in the import of B2B company accounts to Magento 2. We also explain the meaning of a CSV file for importing company roles. After that, you will find out how to run the Magento 2 B2B company import.
Table of contents
What Is a Magento 2 B2B Company?
A Magento 2 company account is Adobe Commerce’s B2B feature designed to simplify the corporate shopping experience by enabling business customers – companies – to create multiple subaccounts with role-based permissions. As a store administrator, you can rely on the B2B company functionality to adjust promotions and prices to suit the demand of your business partners, creating highly customized offers.
The following advantages of a Magento 2 B2B company account illustrate this business feature:
- As a store owner, you can have multiple company accounts with custom structures in each.
- Each account has a smart hierarchy with different roles and permissions for placing orders.
- Company store credit as a payment method exclusive for the Magento 2 B2B company account feature.
- As a store administrator, you can manage all company accounts in the admin.
Magento 2 Company Account Workflow
The Magento 2 B2B company account workflow is associated with the following processes:
- First of all, make sure that the Magento 2 B2B extension is installed on your Adobe Commerce storefront.
- Next, enable the Company Account configuration under Stores -> Configuration -> General > B2B Features. Set Enable Company to Yes – this enables customers to edit company information at the Account Dashboard on the front end.
- Now, your business customers get the ability to create B2B company accounts and set up a custom structure from company members. Magento 2 asks for such data as company name and contact information, legal address, and, of course, company administrator details.
- Next, a notification email is sent to a merchant (store administrator). If they confirm the new business account, a company admin is invited to set a password and manage the new B2B company account.
- Next, a company admin can edit the information about the company on a company profile page as well as specify a company structure. Company users can also be added, modified, or deleted there as well. And don’t forget about the opportunity to create a group of permissions and roles, and assign them to each member of your company.
- On the other hand, a store administrator or merchant can also edit company accounts from the admin. It is possible to customize B2B company data within the following sections: Account Information, Company Hierarchy, Legal Address, Company Admin, Company Credit, and Advanced Settings.
Magento 2 B2B Company Structure Explained
A company administrator can easily set up a company account to reflect the actual business structure. In Magento 2, the default company structure includes only one company administrator. However, it is possible to create a complex hierarchy tree that consists of multiple teams, where users are organized in teams within a hierarchy of divisions and subdivisions. Different teams and users can have different approval rules for purchase orders.
The company structure is represented as a tree In the company administrator’s account dashboard.
While it initially consists of only the company administrator, more accounts can be added. For instance, you can see a company tree that consists of the main admin account and an individual user account in the name of the company administrator in the image below.
Company administrator functions, however, are available only when the admin is logged in as the company administrator. Next, they can edit the Magento 2 B2B company structure as follows:
- Choose Company Structure in the left panel.
- Click Add Team under Business Structure. It is only necessary to specify the team’s title and optionally add a description. Add as many teams as you need.
- Next, create a hierarchy of teams by selecting the parent team and clicking Add Team. Take the same steps as described above. Create as many teams, divisions, and subdivisions as your business requires.
Note that it is possible to drag teams or divisions to other locations in the structure. Use the Add User button to add users to teams. Just select a team you wish to add a new member to, press the button, and assign a user. But what if all these and many other manipulations over business company accounts in Magento 2 can be automated?
How to Import Magento 2 B2B Company Structure & Other Details
Below, we explore how to automate your Magento 2 B2B company workflow with the help of import processes. You will need the Improved Import & Export extension and its B2B Add-On.
Next, you can import B2B companies to Magento 2 with the help of an import table with the company attributes. FireBear team composed the
Magento 2 B2B Company Attributes
Below is the table with all Magento 2 B2B company attributes, their description, and sample values.
Attribute Name | Reference | Values | Value Example |
company_name | Required attributeName of the company | Can contain any symbols | My Company |
status | Required attribute Indicates the status of the company |
0 – pending approval1 – active
2 – rejected 3 – blocked |
1 |
company_email | Required attribute Email of the company. Please note that this is a dedicated email of the company, not the company representative.This field also serves as a unique company identifier. |
Valid email address with the domain name | test@test.com |
sales_representative_id | The ID of the sales representative | It is an ID of the admin account. To get the ID, navigate to System>Permissions>All Users, and in the ID column check the ID | 5 |
sales_representative_email | Custom attribute.Email of the sales representative’s account at the store.
Instead of using sales_representative_id. You can use this attribute to add a representative by account email. |
If sales_representative_id has any value – it has a higher priority over sales_representative_email.Any email address accepted | representative@test.com |
legal_name | Company Legal Name. Part of the account information. Companies can have both names and legal names. | Can contain any symbols | Company gmbh |
vat_tax_id | VAT of the company | Can only contain valid VAT numbers | EU999000999 |
reseller_id | ID of the company’s reseller | Can contain any symbols | 321 |
comment | A comment that can be left for the company. Visible only to the store administrator | Can contain any symbols | This company is the best |
street | Required attribute The street value of the company’s legal address |
Can contain any symbols | First St. |
city | Required attribute City value of the company’s legal address |
Can contain any symbols | New York |
country_id | Country value of the company’s legal address | The Magento 2 code of the county. |
US |
region | Region of the company address | The region field is used for the Countries where you can’t select a region from the dropdown. Here you are suggested to type the region name manually.
For countries with selectable regions use region_id column. |
Kyiv Oblast |
region_id | The region of the company address | region_id field is used for the countries where you CAN select a region from the dropdown.Here you are suggested to type the region code of the country.
For countries with NON-selectable regions use the region column. Magento 2 region codes can be found |
14 |
postcode | Required attribute The postcode value of the company’s legal address |
Can contain only numerals | 12345 |
telephone | Required attribute Telephone value of the company’s legal address |
Can contain only numerals | 123123123 |
customer_group_id | Required attribute Customer group ID of the company. Mainly used to identify with which shared catalog the company is associated. |
Can be found at the Customers>Customer Groups gridCan contain only numerals | 12 |
customer_group_code | Customer group NAME of the company. Mainly used to identify with which shared catalog the company is associated. | Instead of using customer_group_id. You can use this attribute to assign a group by name. If customer_group_id has any value – it has a higher priority over customer_group_code. | Default |
reject_reason | The reason the company has been rejected for approval | Can contain any symbols | I don’t like their colors |
website_id | The ID of the store view, the company belongs to | Can contain only numerals | 2 |
Email address of the company’s admin – a customer account that can run the company from the store’s frontend | Valid email address with the domain name | test@test.com | |
prefix | Prefix of the company’s admin name | Can contain any symbols | Mr. |
job_title | Required attribute Job title of the company’s admin |
Can contain any symbols | CEO |
firstname | First name of the company’s admin | Can contain any symbols | John |
middlename | The middle name of the company’s admin | Can contain any symbols | Jr. |
lastname | Last name of the company’s admin | Can contain any symbols | Doe |
suffix | Suffix of the company’s admin name | Can contain any symbols | esq. |
gender | Gender of the company’s admin | empty – no gender specified1 – male
2– female |
2 |
credit_limit | Credit limit of the company’s credit | Can contain only numerals | 10000 |
balance | The outstanding balance of the company | Only numerals are allowed | 5000 |
currency_code | Credit currency of the company | Only currency codes are allowed | USD |
exceed_limit | Allow To Exceed Credit Limit setting | 1 – a company can exceed the credit limit; 0 – a company cannot exceed the credit limit | 1 |
credit_comment | Comment on changing the credit and credit balance | Can contain any symbols | Confirmed with John Doe |
is_quote_enabled | Allow Quotes setting of the company. Allows companies to ask for negotiable quotes on the shopping cart page. | 1 – quote enabled0 – quote disabled | 1 |
applicable_payment_method | IDs of the applicable payment methods of the company’s account | Can contain only numerals | 12 |
use_config_settings | Defines if the default store configuration should be applied to the applicable payment methods of the company | 1 – default store configuration0 – custom payment methods | 1 |
available_payment_methods | Codes of the payment methods available for the company at the store | Can contain any symbols | amazon_payment |
Company Roles Attributes | |||
role_name | The name of the customer’s role in the company | Can contain any symbols | Manager |
company_email | Email address of the company the role belongs to | Must be an email address with a proper domain name | email@address.com |
user_emails | Email addresses of the store customers that should be added as company employees | Must be email addresses with proper domain names. Multiple email addresses are separated by a comma with no spaces. | john@doe.com |
permissions | Permissions of the company role to access particular elements of the company account at the store | We advise exporting roles first to get an idea of all available values for permissions | Magento_NegotiableQuote::view_quotes,Magento_Sales::all |
Important Magento 2 Company Import Considerations
Note that you can use only the required attributes to create a B2B company account.
Create and assign the main admin to a company
The company’s main admin account can be created automatically using the email, firstname, and lastname attributes.
To assign a sales representative to the company, you need to use the admin account ID, which can be found under System>Permissions>All Users in the ID column. Specify it in the sales_representative_id column of the import file. Alternatively, you can use the account email for this purpose. Specify it in the sales_representative_email column.
NOTE: if both sales_representative_id and sales_representative_email columns have values for the same company, only the value in the sales_representative_id column is used
Sales_representative_id has priority over sales_representative_email.
Assigning a company to a customer group
You can assign a company to the customer group only by the customer group ID available under Customer>Customer groups in the ID column. Use the customer_group_id column to provide this information.
Alternatively, you can assign a company to a customer group using the customer group name. Use the customer_group_code column. Just put the name of the customer group the company should belong to.
NOTE: if both customer_group_id and customer_group_code columns for the same company have values, only the value of the customer_group_id is considered.
Magento 2 B2B Company Import
After composing a table with B2B company data, you can import companies to Magento 2 using the standard import procedure of the Improved Import & Export extension. Follow these steps:
- Proceed to System -> Improved Import / Export -> Import Jobs and hit the Add New Job button.
- Configure General Settings. You can automate the Magento 2 B2B company import here if it is a regular process.
- Visit the Import Settings section to select B2B Companies in the Entity dropdown as your import entity.
- Choose Add/Update to add new Magento 2 B2B companies and update the existing ones.
- Now, select a file type, data source, and a couple more parameters to import your B2B companies to Magento 2.
- Save the job, and run the Magento 2 B2B company import.
You can find more nuances associated with the import process here: Improved Import & Export Extension Manual. Also, contact us to get help with the Magento 2 company import.
Final Words
While Magento 2 doesn’t let you import and export B2B companies with all the associated data, you can freely get the missing functionality with Improved Import & Export and its B2B Add-on. Follow the link below and contact our support if you have any questions regarding the import of company roles, structure, and other parameters to Magento 2:
Get Improved Import & Export Magento 2 Extension
Get Improved Import & Export Magento 2 B2B Add-On