Skip to content

Commit 5750ed9

Browse files
author
Jo
committed
first draft
1 parent 33e8257 commit 5750ed9

File tree

9 files changed

+68
-43
lines changed

9 files changed

+68
-43
lines changed

docs/partials/inventory/paidorder.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
The following flowchart depicts the process of paying for an order.
2+
3+
![The payment workflow.](/assets/payment-workflow-1.png)
4+
5+
Stock is managed as follows:
6+
7+
1. When a customer attempts to add products to a cart, the inventory service checks if there is enough available stock. If there is not enough stock available, you receive a 400 HTTP response with a warning. The response does not describe what products cannot be added, nor does it return how many products are in stock.
8+
2. If a customer successfully adds products to a cart, the customer can checkout to create an unpaid order.
9+
3. A final check on the available stock is performed.
10+
4. After creating the unpaid order, the payment for an order can be taken. When a customer attempts to pay for an order, the inventory service reserves the stock before the payment is processed internally. At any time before the point of payment, a customer might lose their order, if the customer is slower than everyone else.
11+
5. When the payment succeeds, that stock is still allocated, and the items belong to the customer, unless for any reason they are reallocated before shipment. For example, if the customer cancels, or you realize the order is fraudulent, then you can reallocate the inventory.
12+
13+
During split payments, stocks are allocated only if the first transaction for an order is complete. If the transaction fails, the stocks are deallocated. Once the first transaction is complete, the stocks are not allocated for the subsequent transactions as they are already reserved for the order. The stocks are deallocated and return to available when the the order is canceled.
14+
15+
6. Finally, when the order is marked as shipped, that stock is fully decremented. This means the allocation number is reduced, and therefore the total, and the products are no longer in the warehouse.
16+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
The following flowchart depicts the process of an unpaid order.
3+
4+
![The order is created from the cart during the checkout process.](/assets/unpaidorder.png)
5+
6+
Stock is managed as follows:
7+
8+
1. When a customer attempts to add products to a cart, the inventory service checks if there is enough available stock. If there is not enough stock available, you receive a 400 HTTP response with a warning. The response does not describe what products cannot be added, nor does it return how many products are in stock.
9+
2. If a customer successfully adds products to a cart, the customer can checkout to create an unpaid order.
10+
3. A final check on the available stock is performed.
11+
4. After creating the unpaid order, the payment for an order can be taken. When a customer attempts to pay for an order, the inventory service reserves the stock before the payment is processed internally. At any time before the point of payment, a customer might lose their order, if the customer is slower than everyone else.
12+
5. If the payment fails, the temporary stock allocation is removed, and the stock becomes available again for anyone to buy.
13+

docs/partials/inventory/workflow.mdx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
1-
### Order flow
1+
Inventory transactions refer to the various actions that take place to adjust stock levels, such as receiving, storing, or shipping goods. Inventory transactions are tied to orders as each step of an order triggers changes in inventory levels.
22

3-
There are three mandatory steps to complete an order in relation to inventory:
3+
When processing an order, there are three mandatory inventory-related steps that must be completed.
44

5-
1. Added to a cart
6-
2. Checked out
7-
3. Paid
8-
4. Shipped (optional)
9-
10-
#### Unpaid order flow
11-
12-
The following flowchart depicts the process of an unpaid order.
13-
14-
![The order is created from the cart during the checkout process.](/assets/order-flow.png)
15-
16-
#### Payment flow
17-
18-
The following flowchart depicts the process of paying for an order.
19-
20-
![The payment workflow.](/assets/payment-workflow-1.png)
21-
22-
### How stock is managed
23-
24-
Stock is managed as follows:
25-
26-
1. When a customer attempts to add products to a cart, the inventory service checks if there is enough available stock. If there is not enough stock available, you receive a 400 HTTP response with a warning. The response does not describe what products cannot be added, nor does it return how many products are in stock.
27-
2. If a customer successfully adds products to a cart, the customer can checkout to create an unpaid order.
28-
3. A final check on the available stock is performed.
29-
4. After creating the unpaid order, the payment for an order can be taken. When a customer attempts to pay for an order, the inventory service reserves the stock before the payment is processed internally. At any time before the point of payment, a customer might lose their order, if the customer is slower than everyone else.
30-
31-
If the payment fails, the temporary stock allocation is removed, and the stock becomes available again for anyone to buy.
32-
33-
If the payment succeeds, that stock is still allocated, and the items belong to the customer, unless for any reason they are reallocated before shipment. For example, if the customer cancels, or you realize the order is fraudulent, then you can reallocate the inventory.
34-
5. Finally, when the order is marked as shipped, that stock is fully decremented. This means the allocation number is reduced, and therefore the total, and the products are no longer in the warehouse.
35-
36-
During split payments, stocks are allocated only if the first transaction for an order is complete. If the transaction fails, the stocks are deallocated. Once the first transaction is complete, the stocks are not allocated for the subsequent transactions as they are already reserved for the order. The stocks are deallocated and return to available when the the order is canceled.
5+
1. Adding a product to a cart.
6+
1. (*Optional*) Choosing a location
7+
1. Checking out a cart.
8+
1. Paying for an order.
9+
1. (*Optional*) Shipping an order.

guides/key-concepts/inventory/workflow.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"position": 25,
3+
"label": "Workflow",
4+
"collapsible": true
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Paid Order Flow
3+
nav_label: Paid Order Flow
4+
sidebar_position: 10
5+
---
6+
7+
import PaidOrder from "/docs/partials/inventory/paidorder.mdx";
8+
9+
<PaidOrder></PaidOrder>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Unpaid Order Flow
3+
nav_label: Unpaid Order Flow
4+
sidebar_position: 15
5+
---
6+
7+
import UnpaidOrder from "/docs/partials/inventory/unpaidorder.mdx";
8+
9+
<UnpaidOrder></UnpaidOrder>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Overview
3+
nav_label: Overview
4+
sidebar_position: 5
5+
---
6+
7+
import InventoryWorkflow from "/docs/partials/inventory/workflow.mdx";
8+
9+
<InventoryWorkflow></InventoryWorkflow>

static/assets/unpaidorder.png

41.2 KB
Loading

0 commit comments

Comments
 (0)