# medusa | Medusa | Knowledge Base | Instagit

The world's most flexible commerce platform.

GitHub Stars: 33.7k

Repository: https://github.com/medusajs/medusa

---

## Articles

### [Where to Find Medusa Workflow and API Route Implementations: A Complete Guide](/medusajs/medusa/examples-medusa-workflow-api-route-implementations)

Discover production-ready Medusa workflow and API route implementations in the official medusajs/medusa repository. Learn practical patterns for creating workflows and API routes.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Extend Medusa's Core Functionality: A Complete Guide for Developers](/medusajs/medusa/how-to-extend-medusa-core-functionality)

Extend 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.

- Tags: how-to-guide
- Published: 2026-05-19

### [Best Practices for Structuring a Medusa Project: A Complete Developer Guide](/medusajs/medusa/best-practices-structuring-medusa-projects)

Learn best practices for structuring Medusa projects with a TypeScript monorepo. Explore clear separation for scalable commerce apps following official conventions.

- Tags: best-practices
- Published: 2026-05-19

### [How to Observe the Execution of Medusa Workflows: 4 Monitoring Methods](/medusajs/medusa/how-to-observe-medusa-workflow-execution)

Learn to observe Medusa workflow execution using 4 monitoring methods. Subscribe to lifecycle events via Redis Pub/Sub, callbacks, or REST APIs for clear insights.

- Tags: how-to-guide
- Published: 2026-05-19

### [Can Medusa Workflows Trigger API Routes? Architecture and Implementation Guide](/medusajs/medusa/can-medusa-workflows-trigger-api-routes)

Discover how Medusa workflows interact with services and repositories, not API routes. Learn the architecture and implementation for efficient headless commerce.

- Tags: architecture
- Published: 2026-05-19

### [How to Test Medusa API Routes: Complete Integration Testing Guide](/medusajs/medusa/how-to-test-medusa-api-routes)

Learn to test Medusa API routes effectively with the createServer fixture. This guide covers integration testing and offers a supertest wrapper for authenticated HTTP requests.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Validate Input Data for Medusa API Routes: A Complete Zod Implementation Guide](/medusajs/medusa/how-to-validate-input-data-medusa-api-routes)

Learn 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.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Handle Errors Gracefully in Medusa API Routes](/medusajs/medusa/how-to-handle-errors-medusa-api-routes)

Learn to handle errors gracefully in Medusa API routes. Centralized middleware maps MedusaError and Zod validation to HTTP codes for standardized JSON responses.

- Tags: how-to-guide
- Published: 2026-05-19

### [Medusa Transaction Management for API Operations: How the Decorator Pattern Ensures Data Consistency](/medusajs/medusa/medusa-transaction-management-api-operations)

Discover how Medusa ensures ACID compliance for API operations. Learn about automatic transaction management using the @InjectTransactionManager decorator to maintain data consistency.

- Tags: internals
- Published: 2026-05-19

### [How to Implement Custom Logic Within Medusa API Routes: A Complete Guide](/medusajs/medusa/how-to-implement-custom-logic-medusa-api-routes)

Learn to implement custom logic within Medusa API routes by exporting HTTP verb functions and resolving services. Master custom TypeScript processing for typed responses.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Build Responses in Medusa API Routes: Complete Guide with Code Examples](/medusajs/medusa/how-to-build-responses-medusa-api-routes)

Learn 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.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Access Request Parameters and Body in Medusa API Routes](/medusajs/medusa/medusa-api-routes-access-parameters-body)

Learn 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.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Handle GET, POST, PUT, and DELETE Request Methods in Medusa API Routes](/medusajs/medusa/medusa-api-routes-request-methods)

Learn how to handle GET POST PUT DELETE request methods in Medusa API routes. Export named async functions from route.ts for robust API development.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Create a Custom Medusa API Route: File-Based Routing Guide](/medusajs/medusa/how-to-create-custom-medusa-api-route)

Learn to create a custom Medusa API route using file-based routing. Simply add a route.ts file to your src/api/ directory and export HTTP method handlers for instant endpoint registration.

- Tags: how-to-guide
- Published: 2026-05-19

### [Medusa API Route Conventions: File-Based Routing and HTTP Handler Patterns](/medusajs/medusa/medusa-api-route-conventions)

Discover Medusa API route conventions with file-based routing and HTTP handler patterns. Learn how to define endpoints using route.ts files and export uppercase HTTP verbs for efficient API development.

- Tags: api-reference
- Published: 2026-05-19

### [How to Integrate External Services with Medusa Workflows: A Complete Guide](/medusajs/medusa/how-to-integrate-external-services-medusa-workflows)

Integrate external services with Medusa workflows by building custom steps with createStep and composing them into robust workflows. Learn to implement rollback safety with this complete guide.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Define Custom Steps in Medusa Workflows: A Complete Guide](/medusajs/medusa/how-to-define-custom-steps-medusa-workflows)

Define custom steps in Medusa workflows with our complete guide. Learn to create callable steps, implement compensation logic, and integrate them seamlessly into your projects.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Trigger a Medusa Workflow Programmatically: Complete Developer Guide](/medusajs/medusa/how-to-trigger-medusa-workflow-programmatically)

Trigger Medusa workflows programmatically using the workflow factory and dependency injection. Learn how to run custom workflows with this developer guide.

- Tags: how-to-guide
- Published: 2026-05-19

### [How to Create a Custom Medusa Workflow: A Complete Developer's Guide](/medusajs/medusa/how-to-create-custom-medusa-workflow)

Master custom Medusa workflows with this developer guide. Learn to define async steps with createStep, compose them with createWorkflow, and auto-register for the workflow engine.

- Tags: how-to-guide
- Published: 2026-05-19

