docs: editing and general fixes of medusa's learning resources (#7261)

* docs: editing and general fixes of medusa's learning resources

* fix build script

* update ui dependency

* fix build

* adjust next.js steps
This commit is contained in:
Shahed Nasser
2024-05-13 18:55:11 +03:00
committed by GitHub
parent 803e4aad02
commit 7cb90f8e82
79 changed files with 488 additions and 1707 deletions
-193
View File
@@ -1,193 +0,0 @@
import { AcademicCapSolid, BoltSolid } from "@medusajs/icons"
import { LearningPath } from "docs-ui"
export const metadata = {
title: `Order Management System (OMS) Recipe`,
}
# {metadata.title}
In this recipe, you'll find resources to guide you in using Medusa as an Order Management System (OMS).
## Overview
Building or integrating an OMS brings certain challenges: accepting orders from different sales channels, tracking inventory across the sales channels, integrating third-party fulfillment and payment providers with the OMS, and more.
Medusa's commerce modules and customization toolkit lets you integrate it within a larger ecosystem. The commerce modules provide features to allow businesses to accept orders from any sales channel, benefit from multi-warehouse inventory features, and integrate third-party services for fulfillment, payment, and more.
<Note title="Related use-case">
[How Siam Makro used Medusa an OMS](https://medusajs.com/blog/makro-pro/).
</Note>
---
## Source Orders into Medusa
Sales channels in your commerce ecosystem must route their orders into the OMS.
![Routing orders into Medusa OMS](https://res.cloudinary.com/dza7lstvk/image/upload/v1709032160/Medusa%20Book/oms-orders_zf5ta9.jpg)
Medusa's [Store REST APIs](https://docs.medusajs.com/api/store) let you integrate a checkout experience in any storefront. Alternatively, you can use Medusa's [Draft Order APIs](https://docs.medusajs.com/api/admin#draft-orders) to place an order without direct involvement from the customer, such as when placing an order through a POS.
In addition, you can customize the Medusa application to accept orders through a third-party checkout system. This gives you more flexibility over adding orders to Medusa.
For example, you can support importing orders into Medusa through a custom API Route that allows batch-inserting orders. Another example is creating a scheduled job that runs at a specified interval and imports orders from a third-party service.
<CardList items={[
{
href: "https://docs.medusajs.com/api/store#carts",
title: "Store REST APIs",
text: "Learn how to use the Store REST APIs to create an order.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Create API Route",
text: "Learn how to create a custom API Route.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Create Scheduled Jobs",
text: "Learn how to create a scheduled job.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
}
]} />
---
## Route Orders to Third-party Fulfillment Services
To integrate third-party fulfillment providers with the Medusa application, create a fulfillment service or use a fulfillment plugin.
Medusa uses the fulfillment service whenever a fulfillment action is performed, such as when a fulfillment is created for items in an order. The service's methods interact with the third-party provider to handle the desired fulfillment actions.
![Fulfilling orders with Medusa OMS](https://res.cloudinary.com/dza7lstvk/image/upload/v1709032184/Medusa%20Book/oms-fulfillment_qfrpdd.jpg)
In addition, create a subscriber that listen to fulfillment-related events, such as the `order.fulfillment_created` event, to perform actions in the third-party fulfillment provider.
<CardList itemsPerRow={2} items={[
{
href: "#",
title: "Create a Fulfillment Provider",
text: "Learn how to create a fulfillment provider in Medusa.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Events",
text: "Learn about the event bus and how to listen to events.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
}
]} />
---
## Process Payment with Third-Party Providers
To integrate third-party payment providers with the Medusa application, create a payment processor or use payment plugins.
In addition, create a subscriber that listen to payment-related events, such as the `order.payment_captured` event, to perform actions in the third-party payment provider.
<CardList itemsPerRow={2} items={[
{
href: "#",
title: "Payment Plugins",
text: "Check out available official payment plugins.",
startIcon: <BoltSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Create a Payment Processor",
text: "Learn how to create a payment processor.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
}
]} />
---
## Track Inventory Across Sales Channels
Medusa's Inventory, Stock Location, and Sales Channel modules allow merchants to track inventory levels tied to sales channels across stock locations.
When an order is placed, the item's quantity is reserved from the stock location associated with the order's sales channel. Once the item is fulfilled, the reserved quantity is deducted from the item's inventory quantity.
<CardList items={[
{
href: "#",
title: "Multi-warehouse",
text: "Learn about the Multi-warehouse architecture and features.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Sales Channels",
text: "Learn about the Sales Channel architecture and features.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Create a Plugin",
text: "Learn how to create a plugin.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
}
]} />
---
## Handle Returns, Exchanges, and Edits
In Medusa, items in an order can be returned or exchanged; these can be created by the merchant or requested by the customer. A merchant can also edit an order to add, update, or delete items.
When changes are made to an order by any of the mentioned actions, the changes are reflected on the order's totals and associated inventory. The integrated fulfillment and payment providers are used if fulfillment or payment actions are required, such as fulfilling exchanged items.
Medusa also emits events related to these actions, such as `order.return_requested`. So, you can create a subscriber that listens to these events and perform asynchronous actions, such as communicating with third-party services.
<CardList itemsPerRow={2} items={[
{
href: "#",
title: "Order Returns",
text: "Learn about the Order Return architecture and features.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Exchanges (Swaps)",
text: "Learn about the Exchange or Swap architecture and features.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Order Edits",
text: "Learn about the Order Edit feature and how it works.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
},
{
href: "#",
title: "Event Reference",
text: "Check out triggered events in Medusa and their payloads.",
startIcon: <AcademicCapSolid />,
showLinkIcon: false
}
]} />
---
## Additional Development
Refer to other guides in the Medusa Resources or the Medusa Book for additional guidance during your development.