medusa
The world's most flexible commerce platform.
Discover production-ready Medusa workflow and API route implementations in the official medusajs/medusa repository. Learn practical patterns for creating workflows and API routes.
How to Extend Medusa's Core Functionality: A Complete Guide for DevelopersExtend Medusa's core functionality with custom modules, Workflows SDK, and new API routes. Learn how to enhance your e-commerce platform without core code changes.
Best Practices for Structuring a Medusa Project: A Complete Developer GuideLearn best practices for structuring Medusa projects with a TypeScript monorepo. Explore clear separation for scalable commerce apps following official conventions.
How to Observe the Execution of Medusa Workflows: 4 Monitoring MethodsLearn to observe Medusa workflow execution using 4 monitoring methods. Subscribe to lifecycle events via Redis Pub/Sub, callbacks, or REST APIs for clear insights.
Can Medusa Workflows Trigger API Routes? Architecture and Implementation GuideDiscover how Medusa workflows interact with services and repositories, not API routes. Learn the architecture and implementation for efficient headless commerce.
How to Test Medusa API Routes: Complete Integration Testing GuideLearn to test Medusa API routes effectively with the createServer fixture. This guide covers integration testing and offers a supertest wrapper for authenticated HTTP requests.
How to Validate Input Data for Medusa API Routes: A Complete Zod Implementation GuideLearn how to validate input data for Medusa API routes using Zod. Discover how Medusa's built-in middleware ensures type-safe request bodies for robust API handling.
How to Handle Errors Gracefully in Medusa API RoutesLearn to handle errors gracefully in Medusa API routes. Centralized middleware maps MedusaError and Zod validation to HTTP codes for standardized JSON responses.
Medusa Transaction Management for API Operations: How the Decorator Pattern Ensures Data ConsistencyDiscover how Medusa ensures ACID compliance for API operations. Learn about automatic transaction management using the @InjectTransactionManager decorator to maintain data consistency.
How to Implement Custom Logic Within Medusa API Routes: A Complete GuideLearn to implement custom logic within Medusa API routes by exporting HTTP verb functions and resolving services. Master custom TypeScript processing for typed responses.
How to Build Responses in Medusa API Routes: Complete Guide with Code ExamplesLearn to build responses in Medusa API routes. Fetch paginated data, enrich results, and return uniform JSON using MedusaResponse. Full code examples provided for your integration.
How to Access Request Parameters and Body in Medusa API RoutesLearn how to access request parameters and body in Medusa API routes. Effortlessly retrieve URL params, query filters, and validated request body data for your custom endpoints.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →