@piranhastudios/parcels2go
v0.0.3
Published
A starter for Medusa plugins.
Maintainers
Readme
@piranhastudios/parcels2go
Parcels2Go fulfillment provider plugin for Medusa v2. Adds Parcels2Go as a fulfillment option in your Medusa store, with OAuth credential management and an Admin UI for connecting your account.
Features
- Parcels2Go fulfillment provider (rate quoting, shipment creation, cancellation, returns, label retrieval)
- OAuth credential storage and management
- Admin UI page for connecting/disconnecting your Parcels2Go account
- Sandbox and production mode support
Requirements
- Node.js >= 20
- Medusa >= 2.12.4
- A Parcels2Go account with an OAuth application (Client ID + Client Secret)
Installation
In your Medusa backend, run:
npx medusa plugin:add @piranhastudios/parcels2goThen run migrations to create the OAuth credentials table:
npx medusa db:migrateConfiguration
Add the following to your medusa-config.ts:
import { loadEnv, defineConfig, Modules } from "@medusajs/framework/utils";
import { PARCELS2GO_CREDENTIALS_MODULE } from "@piranhastudios/parcels2go/modules/parcels2go/credentials-index";
module.exports = defineConfig({
modules: {
// Register the credentials storage module
parcels2goCredentials: {
resolve: "@piranhastudios/parcels2go/modules/parcels2go/credentials-index",
},
// Add the fulfillment provider
[Modules.FULFILLMENT]: {
resolve: "@medusajs/medusa/fulfillment",
dependencies: [PARCELS2GO_CREDENTIALS_MODULE],
options: {
providers: [
// ... your other providers
{
resolve: "@piranhastudios/parcels2go/modules/parcels2go",
id: "parcels2go",
options: {
// Set to false (or remove) for production
sandbox: true,
},
},
],
},
},
},
});Connecting Your Account
- In the Medusa Admin, go to Extensions → Parcels2Go
- Enter your Client ID and Client Secret from your Parcels2Go OAuth application
- Click Connect to Parcels2Go
Once connected, the status will show as active and the provider will be ready to use in your shipping options.
To create a Parcels2Go OAuth application:
- Log in to your Parcels2Go account
- Navigate to your API / Developer settings and create a new OAuth client
- Copy the Client ID and Client Secret into the Admin UI form

Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| PARCELS2GO_SANDBOX | Set to "true" to use the sandbox API | "false" |
API Routes
The plugin registers the following admin API endpoints:
| Method | Path | Description |
|--------|------|-------------|
| POST | /admin/parcels2go/connect | Authenticate with Client ID & Secret and store the OAuth token |
| GET | /admin/parcels2go/status | Check connection status and token expiry |
| POST | /admin/parcels2go/disconnect | Remove stored credentials |
Compatibility
Compatible with Medusa >= 2.12.4.
