Makesend
Enable Bangkok-area same-day delivery
Makesend Fulfillment Plugin for MedusaJS
A MedusaJS plugin that integrates Makesend logistics services for Thai e-commerce fulfillment. Built specifically for Medusa v2.11.3+.
Features
- ✅ Fulfillment Provider - Native integration using Medusa v2 fulfillment architecture
- ✅ Shipping Rate Calculation - Real-time pricing via Makesend API
- ✅ Order Creation - Automatically create Makesend shipments when fulfilling orders
- ✅ Order Cancellation - Cancel shipments through the Makesend API
- ✅ Webhook Support - Receive status updates and parcel size adjustments with automatic fulfillment tracking
- ✅ Admin Tracking Widget - View tracking information directly in order details page
- ✅ Temperature Control - Support for Normal, Chill, and Frozen deliveries
- ✅ Postal Code Lookup - Automatic Thai address validation and district mapping
- ✅ Custom Workflows - Integrated Medusa workflows for shipment creation and fulfillment
- ✅ Testing Scripts - Built-in webhook testing tools for local development
Installation
Configuration
1. Add Environment Variables
Create or update your file:
MAKESEND_API_KEY=your_makesend_api_key2. Configure Medusa
Add the plugin to your :
3. Create Shipping Options
After installation, create shipping options in Medusa Admin:
- Navigate to Settings → Fulfillment
- Select Makesend provider
- Create shipping options using the fulfillment option IDs below
Provider Options
The Makesend provider supports the following configuration options:
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Your Makesend API key for authentication | |
| string | No | Base URL for Makesend API endpoints | ||
| string | No | Base URL for tracking links | ||
| string | No | Base URL for shipping label links | ||
| string | No | - | URL for Makesend to send status update webhooks | |
| string | No | - | URL for Makesend to send parcel size update webhooks | |
| boolean | No | Enable debug logging for API requests |
Example with all options:
Fulfillment Options
The plugin provides three shipping options:
| Option ID | Name | Temperature |
|---|---|---|
| Makesend Standard Delivery | Normal (0) | |
| Makesend Chill Delivery | Chill (1) | |
| Makesend Frozen Delivery | Frozen (2) |
Supported Parcel Sizes
| ID | Code | Size |
|---|---|---|
| 6 | s80 | S+ (S80) |
| 7 | s100 | M (S100) |
Webhooks
Automatic Webhook Setup
When you provide and/or in the plugin configuration, the plugin will automatically register these webhooks with Makesend during module initialization. No manual configuration in the Makesend dashboard is required.
The plugin will:
- Initialize the Makesend client with your API key
- Attempt to register the status update webhook if URL is provided
- Attempt to register the parcel size webhook if URL is provided
- Log the results to your Medusa logs
- Continue gracefully if webhook registration fails (won't block module loading)
Status Updates
Endpoint:
Automatically updates fulfillment tracking when shipment status changes. Supported status codes:
- - Order pending pickup
- - Package shipped
- - Arrived at hub
- - Package sorted
- - Out for delivery
- - Successfully delivered (marks fulfillment as delivered)
- - Delivery attempt failed
- - Returned to sender
- - Shipment canceled
Parcel Size Updates
Endpoint:
Receives notifications when actual parcel size differs from declared size.
Testing Webhooks Locally
The plugin includes scripts for testing webhooks during development:
See scripts/README.md for detailed testing documentation.
API Routes
Store Routes
| Endpoint | Method | Description |
|---|---|---|
| GET | Plugin health check | |
| POST | Receive status update webhooks from Makesend | |
| POST | Receive parcel size update webhooks from Makesend |
Admin Routes
| Endpoint | Method | Description |
|---|---|---|
| GET | Admin plugin health check | |
| GET | Get list of Thai provinces | |
| GET | Get districts filtered by province | |
| GET | Get supported parcel sizes | |
| GET/POST | Get or update Makesend settings |
Admin UI
The plugin provides several admin extensions:
Makesend Tracking Widget
Displays on the order details page with:
- Tracking ID with external link to Makesend tracking
- Receiver information
- Pickup and delivery locations
- Status history timeline with timestamps
- Delivery proof information (when available)
Settings Page
Navigate to Settings → Makesend to configure:
- API credentials
- Sender information (name, phone, address)
- Default pickup location
- Default parcel sizes
- Temperature control preferences
Reference Data
The plugin includes comprehensive Thai logistics data in the directory:
- - Thai provinces (77 provinces)
- - Districts with province associations
- - Sub-districts with district associations
- - Complete address database with postal codes
- - Supported parcel sizes (S80, S100)
- - Parcel type categories
- - Available pickup time slots
- - Pricing reference data
- - Complete list of shipment status codes
- - Bank codes for COD transactions
Custom Workflows
The plugin provides Medusa workflows for managing shipments:
Creates a shipment in Makesend when fulfilling an order. Automatically:
- Fetches shipping option and stock location details
- Creates Makesend order via API
- Returns shipment data for fulfillment
Complete fulfillment workflow that:
- Validates order and fulfillment data
- Creates Makesend shipment
- Updates fulfillment with tracking information
See src/workflows/README.md for workflow documentation.
Currency Note
Makesend API uses Satang (1 Baht = 100 Satang) for all monetary values. The plugin handles this automatically when calculating prices.
Development
Documentation
- Makesend API Documentation - Complete API reference
- Supported Parcel Sizes - Parcel size specifications
- Webhook Testing Guide - Testing webhooks locally
Requirements
- Node.js >= 20
- MedusaJS v2.11.3 or higher
- Makesend API account and API key
- TypeScript 5.x (for development)
Repository
Author
CivicAgrotech Co., Ltd.
Website: https://civicagrotech.com
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch ()
- Commit your changes ()
- Push to the branch ()
- Open a Pull Request
License
MIT

