Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9534cc0

Browse files
author
Kevin Harper
committed
draft
1 parent 09d15aa commit 9534cc0

26 files changed

+4022
-0
lines changed

guides/v2.2/b2b/bk-b2b.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: default
3+
group: b2b
4+
subgroup: 01_Introduction
5+
title: B2B Development
6+
landing-page: B2B
7+
menu_title: B2B Development
8+
menu_order: 1
9+
menu_node: parent
10+
version: 2.2
11+
ee_only: true
12+
github_link: b2b/bk-b2b.md
13+
---
14+
15+
16+
The B2B functionality suggests that services and goods are sold to companies and not to individuals.
17+
18+
There are two basic actors in B2B model:
19+
20+
* A **merchant** is an admin user that accesses the system from the Magento Admin panel.
21+
* A **buyer** is any customer associated with a company account who accesses the system from the storefront.
22+
23+
The Company component is the key entity within B2B on which all other features are in some way dependent. It allows joining multiple customers that belong to the same company into a single company account (or corporate account). The company admin is able to build the company structure (divisions, subdivisions and users) in the appropriate hierarchy and provide different user roles and permissions to the company members. Such a hierarchy allows the company admin to control user activity within an account: ordering, quoting, purchasing, access to company credit info or profile, etc. In addition, merchant can configure how the buying company operates at the website: including the payment methods, pricing levels, the ability to negotiate over prices, and the ability to create requisition lists.
24+
25+
Companies have an option to Pay on Account, or in other words make purchases in credit. The merchant allocates credit for a company account and manages credit settings for a company as well as credit reimbursement.
26+
27+
Shared catalogs are the pricing levels that allow setting custom prices per product for different companies on one or multiple websites. By using shared catalogs, a merchant can sell this product with applying different pricing levels for different customer groups.
28+
29+
The merchant and a buyer representing a company can negotiate the price of an order prior to order placement. This functionality is supported within the Negotiable Quote module. It means that before making an order, the buyer can initiate negotiations with the merchant on prices and discounts. Negotiations suggest that the created quote may be submitted, reviewed and modified several times before it is converted into order.
30+
31+
## B2B Modules
32+
33+
Magento B2B ais a set of modules that is installed on top of the Magento 2.x Enterprise Edition. The following table lists the modules provided with B2B.
34+
35+
Name | Description | WebAPI enabled?
36+
--- | --- | ---
37+
B2b | The base module for B2B. It also provides branding elements. | No
38+
BundleSharedCatalog | Enables bundle products to be added to a shared catalog in an B2B environment. | No
39+
Company | Allows a merchant to create a company account and assign multiple members of the company to the account. | Yes
40+
CompanyCredit | Adds the Payment on Account payment method for B2B companies. | Yes
41+
CompanyPayment | Allows a merchant to configure which payment methods are available for B2B companies. | No
42+
ConfigurableSharedCatalog |Enables configurable products to be added to a shared catalog in an B2B environment. | No
43+
GiftCardSharedCatalog | Enables gift cards to be added to a shared catalog in an B2B environment. | No
44+
GroupedSharedCatalog | Enables grouped products to be added to a shared catalog in an B2B environment. | No
45+
NegotiableQuote | Allows a customer and a merchant (admin user) to negotiate product and/or shipping prices before the customer places an order. | Yes
46+
NegotiableQuoteSharedCatalog | Enables the `NegotiableQuote` module to interact with a `SharedCatalog` in an B2B environment. | No
47+
QuickOrder | Allows customers to create a new order from a list of multiple SKUs. | No
48+
RequisitionList | Allows a customer to create multiple lists of frequently-purchased items and use those lists for order placement. | Yes
49+
SharedCatalog | Defines the visibility of products and prices in the catalog and in B2B quotes for different company accounts. | Yes

guides/v2.2/b2b/company-credit.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
layout: default
3+
group: b2b
4+
subgroup: 10_REST
5+
title: Integrate with the CompanyCredit module
6+
menu_title: Integrate with the CompanyCredit module
7+
menu_order: 17
8+
version: 2.2
9+
ee_only: true
10+
level3_menu_node: level3child
11+
level3_subgroup: credit
12+
github_link: b2b/company-credit.md
13+
---
14+
15+
Company credit allows company members to purchase items on credit. This is a specific B2B feature used for transactions between companies only. The merchant allocates an amount (or the credit limit) to a company and then company members can purchase items using this amount with the Payment on Account method. The credit amount used by a company is refunded to the merchant offline. Then the merchant creates a Reimburse transaction in the system to adjust the company balance.
16+
17+
The following diagram illustrates the process flow of orders using the Payment on Account method.
18+
19+
![Payment on credit]({{page.baseurl}}b2b/images/payment-on-credit.png)
20+
21+
## Related information
22+
23+
[Manage company credit]({{page.baseurl}}b2b/credit-manage.html)

guides/v2.2/b2b/company-object.md

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
---
2+
layout: default
3+
group: b2b
4+
subgroup: 10_REST
5+
title: Manage company objects
6+
menu_title: Manage company objects
7+
menu_order: 12
8+
version: 2.2
9+
ee_only: true
10+
level3_menu_node: level3child
11+
level3_subgroup: company
12+
github_link: b2b/company-object.md
13+
---
14+
15+
16+
## Manage company objects
17+
18+
This section describes the REST endpoints used to manage `Company` objects.
19+
20+
**Service Name**
21+
22+
`companyCompanyRepositoryV1`
23+
24+
**REST Endpoints**
25+
26+
{% highlight json %}
27+
POST /V1/company/
28+
PUT /V1/company/:companyId
29+
GET /V1/company/:companyId
30+
DELETE /V1/company/:companyId
31+
GET /V1/company/
32+
{% endhighlight %}
33+
34+
**CompanyInterface Parameters**
35+
36+
The following table lists the parameters defined in `CompanyInterface`.
37+
38+
<table>
39+
<tr>
40+
<th>Name</th><th>Description</th><th>Format</th><th>Requirements</th></tr>
41+
<tr>
42+
<td><code>id</code></td><td>System-generated company ID </td><td>integer </td><td>Required for updates and deletes. </td></tr>
43+
<tr>
44+
<td><code>status</code></td><td>0 - Pending approval<br>1 - Approved<br>2 - Rejected<br>3 - Blocked </td><td>integer </td><td>Optional </td></tr>
45+
<tr>
46+
<td><code>company_name </code></td><td>Company name </td><td>string </td><td>Required to create or update a company. </td></tr>
47+
<tr>
48+
<td><code>legal_name </code></td><td>Legal name </td><td>string </td><td>Optional </td></tr>
49+
<tr>
50+
<td><code>company_email </code></td><td>Official e-mail address of the company. It does not have to be unique. </td><td>string</td><td>Required to create or update a company.</td></tr>
51+
<tr>
52+
<td><code>vat_tax_id </code></td><td>The company's Value Added Tax ID </td><td>string </td><td>Optional </td></tr>
53+
<tr>
54+
<td><code>reseller_id </code></td><td>Unique ID of the company reseller </td><td>string </td><td>Optional </td></tr>
55+
<tr>
56+
<td><code>comment </code></td><td>Additional details about the company</td><td>string</td><td>Optional </td></tr>
57+
<tr>
58+
<td><code>street</code></td><td>Street address where the company is registered. The array can contain one or two lines.</td><td>Array[string]</td><td>Required to create or update a company.</td></tr>
59+
<tr>
60+
<td><code>city</code></td><td>The company's city </td><td>string </td><td>Required to create or update a company.</td></tr>
61+
<tr>
62+
<td><code>country_id</code></td><td>The country where the company is registered.</td><td>string </td><td>Required to create or update a company. </td></tr>
63+
<tr>
64+
<td><code>region</code></td><td>State or province</td><td>string</td><td>Required to create or update a company.</td></tr>
65+
<tr>
66+
<td><code>region_id</code></td><td>An ID assigned to a state or province</td><td>string </td><td>Optional</td></tr>
67+
<tr>
68+
<td><code>postcode</code></td><td>The company's ZIP or postal code</td><td>string </td><td>Required to create or update a company.</td></tr>
69+
<tr>
70+
<td><code>telephone</code></td><td>The company contact's phone number</td><td>string</td><td>Required to create or update a company.</td></tr>
71+
<tr>
72+
<td><code>customer_group_id </code></td><td>Defines the company's shared catalog. A value of `1` assigns the default shared catalog.</td><td>integer</td><td>Required to create or update a company.</td></tr>
73+
<tr>
74+
<td><code>sales_representative_id</code></td><td>User ID of the Sales Representative for the company</td><td>integer</td><td>Optional</td></tr>
75+
<tr>
76+
<td><code>reject_reason</code></td><td>Specifies why a company's request to be a B2B customer is rejected</td><td>string</td><td>Optional </td></tr>
77+
<tr>
78+
<td><code>rejected_at</code></td><td>A timestamp incdicating when the company was rejected.</td><td>string</td><td>Optional</td></tr>
79+
<tr>
80+
<td><code>super_user_id</code></td><td>The `customer_id` of the company administrator. When creating a company, the `customer_id` must already exist. </td><td>integer</td><td>Required to create or update a company.</td></tr>
81+
</table>
82+
83+
84+
### Create a company
85+
86+
The following example creates a company and assigns the default shared catalog (`customer_group_id`). The company admin (`super_user_id`) must be a previously-defined `customer_id`.
87+
88+
**Sample Usage**
89+
90+
`POST /V1/company/`
91+
92+
**Payload**
93+
94+
{% highlight json %}
95+
{
96+
"company": {
97+
"company_name": "Test company",
98+
"company_email": "[email protected]",
99+
"street":[
100+
"100 Big Tree Avenue"
101+
],
102+
"city": "San Francisco",
103+
"country_id": "US",
104+
"region": "CA",
105+
"region_id": "12",
106+
"postcode": "99999",
107+
"telephone": "4155551212",
108+
"super_user_id": 5,
109+
"customer_group_id": 1
110+
}
111+
}
112+
113+
{% endhighlight %}
114+
115+
**Response**
116+
117+
{% highlight json %}
118+
{
119+
"id": 2,
120+
"company_name": "Test company",
121+
"company_email": "[email protected]",
122+
"street": [
123+
"100 Big Tree Avenue"
124+
],
125+
"city": "San Francisco",
126+
"country_id": "US",
127+
"region": "California",
128+
"region_id": "12",
129+
"postcode": "99999",
130+
"telephone": "4155551212",
131+
"customer_group_id": 1,
132+
"sales_representative_id": 1,
133+
"reject_reason": null,
134+
"rejected_at": null,
135+
"super_user_id": 5,
136+
"extension_attributes": {
137+
"quote_config": {
138+
"company_id": "2",
139+
"is_quote_enabled": false
140+
}
141+
}
142+
}
143+
{% endhighlight %}
144+
145+
### Update the company
146+
147+
The following call changes the company status to Rejected (`2`) and explains why.
148+
149+
**Sample Usage**
150+
151+
`PUT /V1/company/2`
152+
153+
**Payload**
154+
155+
{% highlight json %}
156+
{
157+
"company": {
158+
"id": 2,
159+
"company_name": "Test company",
160+
"company_email": "[email protected]",
161+
"customer_group_id": 1,
162+
"street":[
163+
"100 Big Tree Avenue"
164+
],
165+
"city": "San Francisco",
166+
"country_id": "US",
167+
"region": "CA",
168+
"region_id": "12",
169+
"postcode": "99999",
170+
"telephone": "4155551212",
171+
"super_user_id": 5,
172+
"status": 2,
173+
"reject_reason": "Failed background check."
174+
175+
}
176+
}
177+
{% endhighlight %}
178+
179+
**Response**
180+
181+
{% highlight json %}
182+
{
183+
"id": 2,
184+
"company_name": "Test company",
185+
"company_email": "[email protected]",
186+
"street": [
187+
"100 Big Tree Avenue"
188+
],
189+
"city": "San Francisco",
190+
"country_id": "US",
191+
"region": "California",
192+
"region_id": "12",
193+
"postcode": "99999",
194+
"telephone": "4155551212",
195+
"customer_group_id": 1,
196+
"sales_representative_id": 1,
197+
"reject_reason": null,
198+
"rejected_at": null,
199+
"super_user_id": 5,
200+
"extension_attributes": {
201+
"quote_config": {
202+
"company_id": "2",
203+
"is_quote_enabled": true
204+
}
205+
}
206+
}
207+
{% endhighlight %}
208+
209+
### Return all information about a company
210+
211+
This call returns detailed information about the specified company.
212+
**Sample Usage**
213+
214+
`GET /V1/company/2`
215+
216+
**Payload**
217+
218+
None
219+
220+
**Response**
221+
222+
{% highlight json %}
223+
{
224+
"id": 2,
225+
"status": 0,
226+
"company_name": "Test company",
227+
"company_email": "[email protected]",
228+
"street": [
229+
"100 Big Tree Avenue"
230+
],
231+
"city": "San Francisco",
232+
"country_id": "US",
233+
"region": "California",
234+
"region_id": "12",
235+
"postcode": "99999",
236+
"telephone": "4155551212",
237+
"customer_group_id": 1,
238+
"sales_representative_id": 1,
239+
"reject_reason": null,
240+
"rejected_at": null,
241+
"super_user_id": 5,
242+
"extension_attributes": {
243+
"quote_config": {
244+
"company_id": "2",
245+
"is_quote_enabled": true
246+
}
247+
}
248+
}
249+
{% endhighlight %}
250+
251+
252+
### Delete a company
253+
254+
When you delete a company, Magento assigns the "Inactive" status to all company members. The system also removes company ID from the customer profile of all company members.
255+
256+
**Sample Usage**
257+
258+
`DELETE /V1/company/2`
259+
260+
**Payload**
261+
262+
None
263+
264+
**Response**
265+
266+
`true`, indicating the request was successful
267+
268+
### Search for a company
269+
270+
See [Search using REST APIs]({{page.baseurl}}howdoi/webapi/search-criteria.html) for information about constructing a query using the `GET /V1/company/` endpoint.
271+
272+
## Related information
273+
274+
* [Integrate with the Company module]({{page.baseurl}}b2b/company.html)
275+
* [Manage company users]({{page.baseurl}}b2b/company-users.html)
276+
* [Manage company roles]({{page.baseurl}}b2b/roles.html)
277+
* [Manage company structures]({{page.baseurl}}b2b/company-structures.html)

guides/v2.2/b2b/company-parent.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: default
3+
group: b2b
4+
subgroup: 10_REST
5+
title: Company
6+
menu_title: Company
7+
menu_order: 10
8+
version: 2.2
9+
level3_menu_node: level3parent
10+
level3_subgroup: company
11+
github_link: b2b/company-parent.md
12+
---

0 commit comments

Comments
 (0)