Medusa Documentation

website·Indexed 36 days ago

https://docs.medusajs.com

Documentation for Medusa, an open-source commerce framework. It provides guides on building custom features, implementing modules, extending core commerce functionality, and integrating third-party systems using Workflows, Scheduled Jobs, and Subscribers. Includes technical details on application configuration, asymmetric encryption, codemods for version upgrades (v2.11.0+ and v2.13.0+), and customizing the admin dashboard.

Tokens
852.6K
Snippets
3.1K
Records
4K
Agent score
70%

What's inside Medusa

  1. Overview of Medusa Auth Module features

    The Medusa Auth Module is a standalone commerce module providing out-of-the-box authentication capabilities. Key features include:

    • Basic User Authentication: Email and password credential verification.
    • Third-Party and Social Authentication: Integration with platforms like Google and GitHub.
    • Custom Actor Types: Ability to create and authenticate custom user types (e.g., managers) and guard routes based on these types.
    • Email Verification: Mandatory verification for new registrations and logins.
    • Multi-Factor Authentication (MFA): Support for TOTP (time-based one-time passwords), backup recovery codes, and configurable disable policies.
    • Custom Authentication Providers: Ability to integrate external third-party services via custom providers.
  2. Overview of Medusa Inventory Module features

    The Inventory Module is a standalone commerce module in Medusa that provides the following core capabilities:

    • Inventory Items Management: Store and manage stock-kept items (e.g., product variants).
    • Inventory Across Locations: Track and manage inventory levels across multiple locations, such as different warehouses.
    • Reservation Management: Reserve specific quantities of inventory items at locations for orders or other business needs.
    • Inventory Availability: Check if an inventory item has the required quantity available for purchase.
    • Inventory Kits: Create and manage kits for a single product to support bundled or multi-part product use cases.
  3. Overview of Sales Channel module links

    The Sales Channel module maintains relationships with several other commerce modules. These links are either 'Stored' (persisted in a pivot table for many-to-many relationships) or 'Read-only' (used for querying across modules without a pivot table).
    First Data ModelSecond Data ModelTypeDescription
    ApiKeySalesChannelStored - many-to-many
    CartSalesChannelRead-only - has one
    OrderSalesChannelRead-only - has one
    ProductSalesChannelStored - many-to-many
    SalesChannelStockLocationStored - many-to-many
  4. Overview of Notification Module Providers

    A Notification Module Provider handles the actual delivery of a message. By default, Medusa uses the Local Notification Module, which logs notifications to the terminal instead of sending them. Other available providers include SendGrid, Mailchimp, Resend, Slack, and Twilio SMS.
  5. Overview of the Medusa Loyalty Module

    The Loyalty Module (part of the Loyalty Plugin) provides commerce features for managing loyalty programs in Medusa v2.14.0+. Key capabilities include:

    • Gift Card Products: Create physical or digital gift cards as purchasable products.
    • Gift Card Management: Issue, redeem, and track gift cards using unique codes.
    • Cart Integration: Allow gift cards to be applied as payment during the checkout process.
  6. Overview of Medusa Quote Management implementation

    The Quote Management system for Medusa allows for a B2B-style quoting workflow. The implementation enables the following lifecycle:

    1. Quote Request: Customers can request a quote for a specific set of products.
    2. Merchant Management: Merchants use the Medusa Admin dashboard to review quotes, edit item prices and quantities, reject quotes, or send counter-offers.
    3. Customer Response: Customers can either accept or reject the quote sent by the merchant.
    4. Order Conversion: Once a customer accepts a quote, the system automatically converts that quote into a standard Medusa order.

    Implementation requires customizations to both the Medusa server and the Medusa Admin dashboard.

  7. Overview of Medusa Middlewares

    Middlewares in Medusa are functions executed before a route handler when a request is sent to an API Route. They are used for guarding routes, parsing non-JSON content types, manipulating request data, and applying CORS. Since Medusa's server is based on Express, any standard Express middleware can be used.
  8. Overview of the Medusa Search Module

    The Search Module provides full-text search functionality, including relevance ranking, filters, facets, highlighting, and vector search. It works by indexing data into a search engine (such as PostgreSQL or Medusa Search for Cloud users). The module manages the lifecycle of physical indexes, including creation, migration, initial seeding, and real-time updates via events. To ensure zero downtime during schema changes, the module builds new index versions alongside active ones, switching only after the new version is fully populated.
  9. Overview of Medusa AI-native commerce platform

    Medusa is an AI-native commerce platform designed for high customization and automated workflows. It consists of three primary components:

    1. Commerce Modules: Core functionalities for inventory tracking, cart totals, payments, and order management.
    2. Framework: A system for building agentic flows, custom API endpoints, business logic, data models, workflows, automations, and third-party integrations.
    3. Admin Dashboard: A customizable interface for merchants to configure and operate their store.
  10. Overview of Medusa Payment Module features

    The Payment Module is a standalone commerce module that provides out-of-the-box functionality for managing payments. Key features include:

    • Payment Processing: Ability to authorize, capture, and refund payments for resources.
    • Payment Collection Management: Organizing and storing all payments associated with a single resource (e.g., a cart).
    • Third-Party Integration: Support for payment providers like Stripe or the ability to integrate custom providers.
    • Saved Payment Methods: Managing customer payment methods within third-party providers.
    • Webhook Handling: Processing webhook events sent from third-party payment providers.
  11. Overview of the Draft Orders Plugin

    The Draft Orders Plugin allows admin users to create and manage draft orders on behalf of customers via the Medusa Admin. This is particularly useful for customer support scenarios or offline orders (e.g., phone or in-store). It provides a UI for the Medusa Admin dashboard to leverage existing draft order data models and API routes.
  12. Overview of Medusa Tax Module features

    The Tax Module provides out-of-the-box commerce features for managing taxes, including:

    • Tax Settings Per Region: Configure unique tax settings for different tax regions.
    • Tax Rates and Rules: Manage default tax rates for regions and implement conditioned tax rate overrides.
    • Tax Line Retrieval: Calculate and retrieve tax lines for cart/order line items and shipping methods using tax providers.
    • Custom Tax Providers: Implement custom logic to calculate tax lines differently based on the tax region.