Overview
Icon for Shiprocket

Shiprocket

Add live shipping rates and fulfillment automation

@sam-ael/medusa-plugin-shiprocket

Production-focused Shiprocket integration for Medusa v2 with fulfillment automation, delivery estimate APIs, and tracking synchronization.

Highlights

  • Shiprocket fulfillment provider integration
  • Delivery estimate endpoint for storefront experiences
  • Tracking sync endpoints for admin and storefront views
  • Webhook ingestion for status updates
  • Hardened API responses and stricter payload validation
  • Webhook idempotency guard and explicit public webhook handling
  • Tracking ownership hardening and AWB validation

Install

yarn add @sam-ael/medusa-plugin-shiprocket

Medusa Configuration

modules: [
{
resolve: "@medusajs/medusa/fulfillment",
options: {
providers: [
{
resolve: "@sam-ael/medusa-plugin-shiprocket",
id: "shiprocket",
options: {
email: process.env.SHIPROCKET_EMAIL,
password: process.env.SHIPROCKET_PASSWORD,
pickup_location: process.env.SHIPROCKET_PICKUP_LOCATION,
},
},
],
},
},
],
plugins: [
{

Environment Variables

SHIPROCKET_EMAIL=your_email@example.com
SHIPROCKET_PASSWORD=your_password
SHIPROCKET_PICKUP_LOCATION=Primary
SHIPROCKET_WEBHOOK_TOKEN=your_webhook_token
SHIPROCKET_DELIVERY_PREFERENCE=FAST
SHIPROCKET_API_TIMEOUT_MS=15000
SHIPROCKET_WEBHOOK_PAYLOAD_RETENTION_DAYS=30

API

Method Endpoint Description Copy to clipboardGET Copy to clipboard/store/shiprocket/delivery-estimate Delivery estimate lookup Copy to clipboardGET Copy to clipboard/store/shiprocket/tracking/:awb Store tracking lookup Copy to clipboardPOST Copy to clipboard/hooks/fulfillment/shiprocket Shiprocket webhook receiver Copy to clipboardGET Copy to clipboard/admin/shiprocket/tracking/:awb Admin tracking details Copy to clipboardPOST Copy to clipboard/admin/shiprocket/tracking/:awb/sync Force tracking/document sync

Security and Reliability Notes

  • Unified error contract: Copy to clipboard{ success: false, code, message, details? }
  • AWB and query validation added for tracking and estimate APIs
  • Webhook token validation with constant-time compare
  • Webhook replay/idempotency keying on AWB + status/timestamp
  • Public route boundaries are explicit
  • Retention cleanup job for webhook raw payload minimization
  • Indexes added for high-frequency lookup fields

Quality Gates

yarn typecheck
yarn lint
yarn test
yarn build

Smoke tests are available under Copy to clipboardsrc/tests.

License

MIT

You may also like

Browse all integrations

Build your own

Develop your own custom integration

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?