Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 9ec66b5

Browse files
committed
review draft
1 parent 20ecd80 commit 9ec66b5

17 files changed

+460
-683
lines changed

_data/toc/rest-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pages:
9191
url: /rest/tutorials/orders/order-intro.html
9292
include_versions: ["2.1", "2.2", "2.3"]
9393

94-
- label: Order processing with MSI
94+
- label: Order processing with Inventory Management
9595
class: tutorial
9696
url: /rest/tutorials/msi-order-processing/index.html
9797
include_versions: ["2.3"]

guides/v2.3/rest/tutorials/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The REST tutorials provide an introduction to Magento web APIs. In general, the
1111

1212
* The [**order processing** tutorial]({{ page.baseurl }}/rest/tutorials/orders/order-intro.html) demonstrates the lifecycle of an order. Major steps include creating a quote, converting it to an order, issuing an invoice, and shipping the order.
1313

14-
* The [**order processing with MSI**]({{ page.baseurl }}/rest/tutorials/msi-order-processing/index.html) tutorial builds upon the original order processing tutorial. It also configures sources and stocks and other Multi Source Inventory features.
14+
* The [**order processing with Inventory Management**]({{ page.baseurl }}/rest/tutorials/msi-order-processing/index.html) tutorial builds upon the original order processing tutorial. It also configures sources and stocks and other Inventory Management features.
1515

1616
* The [**configurable product** tutorial]({{ page.baseurl }}/rest/tutorials/configurable-product/config-product-intro.html) helps you plan then create a configurable product and its component simple products.
1717

guides/v2.3/rest/tutorials/msi-order-processing/assign-source-to-stock.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: tutorial
33
group: rest-api
44
title: Step 4. Link stocks and sources
5-
subtitle: Order processing with MSI
5+
subtitle: Order processing with Inventory Management
66
menu_title: Step 4. Link stocks and sources
77
menu_order: 40
88
level3_subgroup: msi-tutorial
@@ -15,7 +15,7 @@ functional_areas:
1515

1616
This step links the sources we created in Step 2 with the stocks we created in Step 3.
1717

18-
Each stock can be assigned one or more sources. MSI uses these associations to calculate the virtual aggregated inventory per product.
18+
Each stock can be assigned one or more sources. Magento uses these associations to calculate the virtual aggregated inventory per product.
1919

2020
{:.bs-callout .bs-callout-tip}
2121
You must reindex and flush cache after performing this step.
@@ -96,7 +96,7 @@ Magento returns empty array.
9696
**Required:** After you have assigned a source to stock, use the following command to perform a full reindex and flush the cache. This is required!
9797

9898
``` bash
99-
bin/magento indexer:reindex && php bin/magento cache:flush
99+
bin/magento indexer:reindex && bin/magento cache:flush
100100
```
101101

102102
### Verify this step
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: tutorial
3+
group: rest-api
4+
title: Step 13. Bulk transfer products
5+
subtitle: Order processing with Inventory Management
6+
menu_title: Step 13. Bulk transfer products
7+
menu_order: 130
8+
level3_subgroup: msi-tutorial
9+
return_to:
10+
title: REST Tutorials
11+
url: rest/tutorials/index.html
12+
functional_areas:
13+
- Integration
14+
---
15+
16+
The Driven Backpacks (`24-WB03`) have sold well in the United States, but not in Europe. The Baltimore and Austin warehouses are out of stock. In this step, we'll bulk transfer all of Berlin's stock for this product to Baltimore, and all of Frankfurt's stock to Austin. As a result, the product cannot be shipped from either European source.
17+
18+
In this scenario, there are no pending orders that contain the product, nor is the product on back-order. In production, make sure that you fulfill any pending orders before you bulk transfer a product. You might want to remove the product from the European website before performing the bulk transfer.
19+
20+
## Bulk transfer the product from Berlin to Baltimore
21+
22+
The `POST /V1/inventory/bulk-product-source-transfer` endpoint allows you to specify an array of SKUs to bulk transfer from one source to another, but this example includes only one SKU. If you set the `unassignFromOrigin` attribute to `true`, the origin source is no longer associated with the specified products. If the attribute is `false`, Magento designates the products as being out of stock at the origin source with a quantity of 0.
23+
24+
**Endpoint**
25+
26+
`POST http://<host>/rest/all/V1/inventory/bulk-product-source-transfer`
27+
28+
**Scope**
29+
30+
`all` store views
31+
32+
**Headers**
33+
34+
`Content-Type`: `application/json`
35+
36+
`Authorization`: `Bearer <admin_token>`
37+
38+
**Payload**
39+
40+
``` json
41+
{
42+
"skus": [
43+
"24-WB03"
44+
],
45+
"originSource": "berlin_wh",
46+
"destinationSource": "baltimore_wh",
47+
"unassignFromOrigin": true
48+
}
49+
```
50+
51+
**Response**
52+
53+
`true`
54+
55+
## Bulk transfer the product from Frankfurt to Austin
56+
57+
Use the same endpoint to bulk transfer the product to Austin.
58+
59+
**Payload**
60+
61+
``` json
62+
{
63+
"skus": [
64+
"24-WB03"
65+
],
66+
"originSource": "frankfurt_wh",
67+
"destinationSource": "austin_wh",
68+
"unassignFromOrigin": true
69+
}
70+
```
71+
72+
**Response**
73+
74+
`true`
75+
76+
## Verify this step
77+
78+
In Admin, click **Catalog** > **Products**. Scroll down to the Driven Backpack row.
79+
80+
* The stock has been transferred from Berlin to Baltimore. The Baltimore warehouse now has 32 units.
81+
* The Austin warehouse now has 7 units.
82+
* The **Salable Quantity** column no longer lists European stock.

guides/v2.3/rest/tutorials/msi-order-processing/configure-environment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: tutorial
33
title: Step 1. Configure your environment
4-
subtitle: Order processing with MSI
4+
subtitle: Order processing with Inventory Management
55
menu_title: Step 1. Configure your environment
66
menu_order: 10
77
level3_subgroup: msi-tutorial
@@ -12,11 +12,11 @@ functional_areas:
1212
- Integration
1313
---
1414

15-
This step guides you through the process of configuring your Magento instance so that you can perform the Order Processing with MSI tutorial.
15+
This step guides you through the process of configuring your Magento instance so that you can perform the Order Processing with Inventory Management tutorial.
1616

1717
## Create two websites
1818

19-
**Sales Channels** are entities from which you sell inventory. You can set up Magento websites to be sales channels, and MSI supports extensions for creating other types of channels.
19+
**Sales Channels** are entities from which you sell inventory. You can set up Magento websites to be sales channels, and Magento supports extensions for creating other types of channels.
2020

2121
In this tutorial, we'll create the infrastructure needed to implement a US and a German store.
2222

@@ -83,7 +83,7 @@ In this tutorial, we'll create the infrastructure needed to implement a US and a
8383
3. Click **Create Store View** and assign the following values:
8484

8585
Field | Value
86-
--- | ---
86+
--- | ---
8787
Store | Europe Store
8888
Name | Germany Store View
8989
Code | `de`

guides/v2.3/rest/tutorials/msi-order-processing/create-cart-add-products.md

Lines changed: 57 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: tutorial
3-
title: Step 8. Create a cart and add products to it
4-
subtitle: Order processing with MSI
5-
menu_title: Step 8. Create a cart and add products to it
6-
menu_order: 80
3+
title: Step 7. Create a cart and add products to it
4+
subtitle: Order processing with Inventory Management
5+
menu_title: Step 7. Create a cart and add products to it
6+
menu_order: 70
77
level3_subgroup: msi-tutorial
88
return_to:
99
title: REST Tutorials
@@ -12,7 +12,7 @@ functional_areas:
1212
- Integration
1313
---
1414

15-
Next, we'll create a cart and add the items that we created in [Step 5. Create products](create-products.html).
15+
Next, we'll create a cart and add the items that we modified in [Reassign products to custom sources](reassign-products-to-another-source.html.
1616

1717
## Create a cart
1818

@@ -38,27 +38,27 @@ None
3838

3939
**Response**
4040

41-
The response is the `quoteId`: 3
41+
The response is the `quoteId`: 4
4242

4343
## Check for product availability
4444

45-
In [Step 6. Reassign products to another source](reassign-products-to-another-source.html), we defined the quantities of products `sp1` and `sp2` for the UK source as follows:
45+
In [Step 6. Reassign products to another source](reassign-products-to-another-source.html), we defined the quantities of products `24-WB01` and `24-WB03` for the US source as follows:
4646

4747
Product | Baltimore Warehouse | Austin Warehouse | Reno Warehouse
4848
--- | --- | --- | ---
49-
`sp1` | 50 | 10 | 100
50-
`sp2` | 25 | 0 | 50
49+
`24-WB01` | 35 | 10 | 25
50+
`24-WB03` | 19 | 0 | 42
5151
{:style="table-layout:auto;"}
5252

53-
Later in this step, we'll order 20 `sp1` items and 60 `sp2` items. We can see that we have enough salable items for both products, but let's check programmatically.
53+
Later in this step, we'll order 20 `24-WB01` items and 50 `24-WB03` items. We can see that we have enough salable items for both products, but let's check programmatically.
5454

55-
### Check for product `sp1`
55+
### Check for product `24-WB01`
5656

57-
The `get-product-salable-quantity` endpoint indicates how many items are available for sale for the specified product and source.
57+
The `get-product-salable-quantity` endpoint indicates how many items are available for sale for the specified product (24-WB01) and source (2).
5858

5959
**Endpoint**
6060

61-
`GET http://<host>rest/us/V1/inventory/get-product-salable-quantity/sp1/2`
61+
`GET http://<host>rest/us/V1/inventory/get-product-salable-quantity/24-WB01/2`
6262

6363
**Scope**
6464

@@ -76,15 +76,15 @@ Not applicable
7676

7777
**Response**
7878

79-
`160`
79+
`70`
8080

81-
### Check for product `sp2`
81+
### Check for product `24-WB03`
8282

83-
Use the same endpoint to check the quantity available for product `sp2`.
83+
Use the same endpoint to check the quantity available for product `24-WB03`.
8484

8585
**Endpoint**
8686

87-
`GET http://<host>rest/us/V1/inventory/get-product-salable-quantity/sp2/2`
87+
`GET http://<host>rest/us/V1/inventory/get-product-salable-quantity/24-WB03/2`
8888

8989
**Scope**
9090

@@ -102,15 +102,15 @@ Not applicable
102102

103103
**Response**
104104

105-
`75`
105+
`61`
106106

107107
## Add items to the cart
108108

109109
We have ensured that we have enough physical products in stock to fulfill the potential order.
110110

111111
### Add the first simple product
112112

113-
In this call, we'll add 20 `sp1` items. This portion of the order can be fulfilled from the Baltimore or Reno warehouse.
113+
In this call, we'll add 20 `24-WB01` items. This portion of the order can be fulfilled from the Baltimore or Reno warehouse.
114114

115115
**Endpoint**
116116

@@ -131,9 +131,9 @@ In this call, we'll add 20 `sp1` items. This portion of the order can be fulfill
131131
``` json
132132
{
133133
"cartItem": {
134-
"sku": "sp1",
134+
"sku": "24-WB01",
135135
"qty": 20,
136-
"quote_id": "3"
136+
"quote_id": "4"
137137
}
138138
}
139139
```
@@ -144,56 +144,59 @@ Note the `item_id` for use in subsequent steps.
144144

145145
``` json
146146
{
147-
"item_id": 5,
148-
"sku": "sp1",
147+
"item_id": 3,
148+
"sku": "24-WB01",
149149
"qty": 20,
150-
"name": "Simple Product 1",
150+
"name": "Voyage Yoga Bag",
151151
"product_type": "simple",
152-
"quote_id": "3"
152+
"quote_id": "4"
153153
}
154154
```
155155

156156
### Add the second simple product
157157

158-
Use the same endpoint to add 60 items of `sp2` to the cart. Multiple sources will be required to fulfill this potential order.
158+
Use the same endpoint to add 50 items of `24-WB03` to the cart. Multiple sources will be required to fulfill this potential order.
159159

160160
**Payload**
161161

162162
``` json
163163
{
164164
"cartItem": {
165-
"sku": "sp2",
166-
"qty": 60,
167-
"quote_id": "3"
165+
"sku": "24-WB03",
166+
"qty": 50,
167+
"quote_id": "4"
168168
}
169169
}
170170
```
171171
**Response**
172172

173+
Note the `item_id` for use in subsequent steps.
174+
175+
173176
``` json
174177
{
175-
"item_id": 6,
176-
"sku": "sp2",
177-
"qty": 60,
178-
"name": "Simple Product 2",
179-
"price": 10,
178+
"item_id": 4,
179+
"sku": "24-WB03",
180+
"qty": 50,
181+
"name": "Driven Backpack",
182+
"price": 36,
180183
"product_type": "simple",
181-
"quote_id": "3"
184+
"quote_id": "4"
182185
}
183186
```
184187

185-
### Add a virtual product
188+
### Add a downloadable product
186189

187-
Finally, we'll add a single instance of a virtual product to the cart.
190+
Finally, we'll add a single instance of a downloadable product to the cart.
188191

189192
**Payload**
190193

191194
``` json
192195
{
193196
"cartItem": {
194-
"sku": "vp1",
197+
"sku": "240-LV06",
195198
"qty": 1,
196-
"quote_id": "3"
199+
"quote_id": "4"
197200
}
198201
}
199202
```
@@ -202,13 +205,22 @@ Finally, we'll add a single instance of a virtual product to the cart.
202205

203206
``` json
204207
{
205-
"item_id": 7,
206-
"sku": "vp1",
208+
"item_id": 5,
209+
"sku": "240-LV06",
207210
"qty": 1,
208-
"name": "Gold Club Membership",
209-
"price": 20,
210-
"product_type": "virtual",
211-
"quote_id": "3"
211+
"name": "Yoga Adventure",
212+
"price": 22,
213+
"product_type": "downloadable",
214+
"quote_id": "4",
215+
"product_option": {
216+
"extension_attributes": {
217+
"downloadable_option": {
218+
"downloadable_links": [
219+
3
220+
]
221+
}
222+
}
223+
}
212224
}
213225
```
214226

0 commit comments

Comments
 (0)