docs: general improvements (#13530)

This commit is contained in:
Shahed Nasser
2025-09-17 08:48:18 +03:00
committed by GitHub
parent 1c4f7bd53a
commit ba9a30757b
7 changed files with 140 additions and 110 deletions
@@ -4,42 +4,49 @@ export const metadata = {
# {metadata.title}
In this document, youll learn about the main concepts in the Inventory Module, and how data is stored and related.
In this guide, you'll learn about the main concepts in the Inventory Module and how data is stored and connected.
## InventoryItem
An inventory item, represented by the [InventoryItem data model](/references/inventory-next/models/InventoryItem), is a stock-kept item, such as a product, whose inventory can be managed.
An inventory item, represented by the [InventoryItem data model](/references/inventory-next/models/InventoryItem), is a stock-kept item whose inventory can be managed. For example, a product.
The `InventoryItem` data model mainly holds details related to the underlying stock item, but has relations to other data models that include its inventory details.
The `InventoryItem` data model holds details about the stock item. It connects to other data models like `InventoryLevel` that store stock and quantity details.
![A diagram showcasing the relation between data models in the Inventory Module](https://res.cloudinary.com/dza7lstvk/image/upload/v1709658103/Medusa%20Resources/inventory-architecture_kxr2ql.png)
### Inventory Shipping Requirement
An inventory item has a `requires_shipping` field (enabled by default) that indicates whether the item requires shipping. For example, if you're selling a digital license that has limited stock quantity but doesn't require shipping.
An inventory item has a `requires_shipping` field that indicates whether the item needs shipping. This field is enabled by default.
When a product variant is purchased in the Medusa application, this field is used to determine whether the item requires shipping. Learn more in [this documentation](../../product/selling-products/page.mdx).
For example, if you're selling a digital license with limited stock that doesn't need shipping, you can set this field to `false`.
When a customer buys a product variant in the Medusa application, this field determines whether the item needs shipping. Learn more in the [Configure Selling Products](../../product/selling-products/page.mdx) guide.
---
## InventoryLevel
An inventory level, represented by the [InventoryLevel data model](/references/inventory-next/models/InventoryLevel), holds the inventory and quantity details of an inventory item in a specific location.
An inventory level, represented by the [InventoryLevel data model](/references/inventory-next/models/InventoryLevel), stores the inventory and quantity details of an inventory item in a specific location.
It has three quantity-related properties:
It has three quantity properties:
- `stocked_quantity`: The available stock quantity of an item in the associated location.
- `reserved_quantity`: The quantity reserved from the available `stocked_quantity`. It indicates the quantity that's still not removed from stock, but considered as unavailable when checking whether an item is in stock.
- `incoming_quantity`: The incoming stock quantity of an item into the associated location. This property doesn't play into the `stocked_quantity` or when checking whether an item is in stock.
- `reserved_quantity`: The quantity reserved from the available `stocked_quantity`. This quantity is still in stock but unavailable when checking if an item is available.
- For example, when an order is placed but not yet fulfilled, the ordered quantity is reserved from available stock.
- `incoming_quantity`: The incoming stock quantity of an item into the associated location. This property doesn't affect the `stocked_quantity` or availability checks.
### Associated Location
The inventory level's location is determined by the `location_id` property. Medusa links the `InventoryLevel` data model with the `StockLocation` data model from the Stock Location Module.
The inventory level's location is set in the `location_id` property. Medusa links the `InventoryLevel` data model with the `StockLocation` data model from the [Stock Location Module](../../stock-location/page.mdx).
---
## ReservationItem
A reservation item, represented by the [ReservationItem](/references/inventory-next/models/ReservationItem) data model, represents unavailable quantity of an inventory item in a location. It's used when an order is placed but not fulfilled yet.
A reservation item, represented by the [ReservationItem](/references/inventory-next/models/ReservationItem) data model, represents unavailable quantity of an inventory item in a location.
The reserved quantity is associated with a location, so it has a similar relation to that of the `InventoryLevel` with the Stock Location Module.
When an order is placed, Medusa creates a reservation item for each inventory item in the order. The reservation item stores the reserved quantity of the inventory item in the location associated with the order's sales channel.
You can also use reservation items for custom use cases. For example, if you're selling event tickets, you can create a reservation item when a customer selects a ticket. Then, you can remove the reservation item if the customer doesn't complete the purchase within a specific time.
The reserved quantity is linked to a location, so it has a similar relationship to the `InventoryLevel` with the [Stock Location Module](../../stock-location/page.mdx).
@@ -4,7 +4,7 @@ export const metadata = {
# {metadata.title}
In this document, youll learn about order claims.
In this guide, you'll learn about order claims.
<Note title="Looking for no-code docs?">
@@ -14,51 +14,53 @@ Refer to this [Medusa Admin User Guide](!user-guide!/orders/claims) to learn how
## What is a Claim?
When a customer receives a defective or incorrect item, the merchant can create a claim to refund or replace the item.
When a customer receives a defective or incorrect item, the merchant can create a claim to refund or replace that item.
The [OrderClaim data model](/references/order/models/OrderClaim) represents a claim.
A claim is represented by the [OrderClaim data model](/references/order/models/OrderClaim).
---
## Claim Type
The `Claim` data model has a `type` property whose value indicates the type of the claim:
The `Claim` data model has a `type` property that indicates the type of claim:
- `refund`: the items are returned, and the customer is refunded.
- `replace`: the items are returned, and the customer receives new items.
- `refund`: The items are returned and the customer receives a refund.
- `replace`: The items are returned and the customer receives new items.
---
## Old and Replacement Items
When the claim is created, a return, represented by the [Return data model](/references/order/models/Return), is also created to handle receiving the old items from the customer.
When you create a claim, a return is also created to handle receiving the old items from the customer. The return is represented by the [Return data model](/references/order/models/Return).
<Note>
Learn more about returns in [this guide](../return/page.mdx).
Refer to the [Returns](../return/page.mdx) guide to learn more about returns.
</Note>
If the claims type is `replace`, replacement items are represented by the [ClaimItem data model](/references/order/models/OrderClaimItem).
If the claim's type is `replace`, the replacement items are represented by the [ClaimItem data model](/references/order/models/OrderClaimItem).
---
## Claim Shipping Methods
A claim uses shipping methods to send the replacement items to the customer. These methods are represented by the [OrderShippingMethod data model](/references/order/models/OrderShippingMethod).
A claim uses shipping methods to send replacement items to the customer. These methods are represented by the [OrderShippingMethod data model](/references/order/models/OrderShippingMethod).
The shipping methods for the returned items are associated with the claim's return, as explained in [this guide](../return/page.mdx#return-shipping-methods).
The shipping methods for returned items are linked to the claim's return, as explained in the [Returns](../return/page.mdx#return-shipping-methods) guide.
---
## Claim Refund
If the claims type is `refund`, the amount to be refunded is stored in the `refund_amount` property.
If the claim's type is `refund`, the refund amount is stored in the `refund_amount` property.
The [Transaction data model](/references/order/models/OrderTransaction) represents the refunds made for the claim.
---
## How Claims Impact an Orders Version
## How Claims Impact an Order's Version
When a claim is confirmed, the orders version is incremented.
When you confirm a claim, the order's version increases.
Learn more about order versions in the [Order Versioning](../order-versioning/page.mdx) guide.