Overview
The Stock Location Module manages physical warehouse and store locations where inventory is stocked. It provides location management capabilities essential for multi-location inventory tracking and fulfillment. Key Features:- Multiple stock location management
- Location addresses with full details
- Location metadata for customization
- Integration with inventory tracking
- Integration with fulfillment
When to Use
Use the Stock Location Module when you need to:- Manage multiple warehouses or stores
- Track inventory at different locations
- Support multi-location fulfillment
- Store location addresses and contact info
- Implement ship-from-store functionality
- Handle distributed inventory
- Configure location-specific settings
Data Models
StockLocation
Represents a physical location where inventory is stored.string
required
Unique stock location identifier (prefix:
sloc_)string
required
Location name (e.g., “Main Warehouse”, “NYC Store”)
string
ID of the associated address
StockLocationAddress
Full location address
object
Additional custom data
StockLocationAddress
Address details for a stock location.string
required
Unique address identifier
string
required
Address line 1
string
Address line 2
string
City
string
required
Two-letter ISO country code
string
State or province
string
Postal/ZIP code
string
Phone number
object
Additional custom data
Service Interface
The Stock Location Module service is available at@medusajs/medusa/stock-location.
Create Stock Location
Create a new stock location.CreateStockLocationDTO | CreateStockLocationDTO[]
required
StockLocationDTO | StockLocationDTO[]
The created stock location(s)
Retrieve Stock Location
Get a stock location with its address.string
required
The ID of the stock location to retrieve
StockLocationDTO
The retrieved stock location
List Stock Locations
List all stock locations.FilterableStockLocationProps
StockLocationDTO[]
Array of stock locations
Update Stock Location
Modify a stock location.string
required
ID of the stock location to update
UpdateStockLocationDTO
required
Delete Stock Location
Remove a stock location.Integration Examples
With Inventory Module
Manage inventory at stock locations.With Fulfillment Module
Create fulfillments from stock locations.With Order Module
Fulfill orders from specific locations.Common Scenarios
Multi-Warehouse Setup
Retail Store Locations
Drop Ship Locations
Best Practices
-
Location Naming: Use clear, descriptive names that include:
- Location type (warehouse, store, supplier)
- Geographic identifier (city, region)
- Purpose if applicable (returns center, outlet)
-
Complete Addresses: Always provide complete address information including:
- Full street address
- City and province/state
- Country code (two-letter ISO)
- Postal code
- Contact phone number
-
Metadata Usage: Store location-specific settings in metadata:
- Operating hours
- Capacity limits
- Location type
- Special handling instructions
- Ship-from-store capability
- Regional identifiers
-
Location Strategy: Plan your location structure based on:
- Fulfillment speed requirements
- Shipping cost optimization
- Inventory distribution
- Returns handling
-
Integration: Link stock locations with:
- Inventory levels (required)
- Fulfillment providers
- Service zones
- Return locations
- Soft Deletes: Consider using metadata flags to “deactivate” locations instead of deleting them to preserve historical data.
Related Modules
- Inventory Module - Track inventory at locations
- Fulfillment Module - Fulfill from locations
- Order Module - Location-based fulfillment