InPost fulfillment provider for MedusaJS v2 - Paczkomat locker and courier integration via ShipX API
InPost fulfillment provider plugin for MedusaJS v2. Integrates with the InPost ShipX API to support Paczkomat locker and courier delivery.
npm install medusa-inpost-fulfillment
Add the plugin to your :
import { defineConfig } from "@medusajs/framework/utils";export default defineConfig({// ...plugins: [{resolve: "@medusajs/medusa/fulfillment",options: {providers: [// default provider{resolve: "@medusajs/medusa/fulfillment-manual",id: "manual",},{resolve: "medusa-inpost-fulfillment/providers/inpost",id: "inpost",options: {// RequiredapiToken: process.env.INPOST_API_TOKEN,organizationId: process.env.INPOST_ORGANIZATION_ID,// Optional — use InPost sandbox environment (default: false)sandbox: true,// Optional — default parcel template for locker shipments// "small" | "medium" | "large" (default: "small")defaultParcelTemplate: "small",// Required for courier shipments — sender detailssender: {company_name: "My Store",first_name: "John",last_name: "Doe",email: "shipping@mystore.com",phone: "500100200",address: {street: "Marszalkowska",building_number: "1",city: "Warsaw",post_code: "00-001",country_code: "PL",},},},},],},},],});
| Variable | Description |
|---|---|
| Your InPost ShipX API token | |
| Your InPost organization ID |
After installing the plugin, create shipping options in the Medusa admin that use the InPost fulfillment provider. The plugin exposes two services:
| Service ID | Description |
|---|---|
| Paczkomat locker delivery | |
| Courier home delivery |
InPost uses different apps for locker and courier shipments:
Note on sandbox for courier shipments: WebTrucker has no sandbox equivalent, so courier shipments created in sandbox will not appear in any UI. In sandbox, a correctly created courier shipment will simply reach status via the API — that is the sandbox success criterion. Only production courier shipments are visible in WebTrucker.
For Paczkomat locker delivery, the storefront must pass (the Paczkomat machine ID) when adding a shipping method to the cart:
await sdk.store.cart.addShippingMethod(cartId, {option_id: lockerShippingOptionId,data: {target_point: "WAW123", // Paczkomat machine ID},});
You can use the InPost Geowidget to let customers pick a Paczkomat on a map.
For courier delivery, no additional data is needed — the receiver address is taken from the cart's shipping address:
await sdk.store.cart.addShippingMethod(cartId, {option_id: courierShippingOptionId,});
For courier shipments, the plugin aggregates parcel dimensions from cart item variants (the , , , and fields on product variants). If no dimensions are set, defaults are used (200x200x100mm, 1kg).
For locker shipments, a parcel template (, , or ) is used instead, configurable via the option or per-shipment via in fulfillment data.
When a fulfillment is cancelled in Medusa, the plugin attempts to cancel the corresponding shipment in InPost.
Important: InPost only allows cancelling shipments that are still in or status. Once a shipment has been confirmed (label purchased/dispatch order issued), the InPost API will reject the cancel request. In that case, the plugin logs a warning and lets Medusa mark the fulfillment cancelled locally only — the physical shipment must be cancelled manually in InPost Manager (for locker shipments) or WebTrucker (for courier shipments).
The plugin supports retrieving shipment labels as PDF documents through Medusa's fulfillment documents API.
Return shipments are not created automatically — they should be created manually in InPost Manager, as Medusa's return flow does not provide sufficient data (e.g., target locker for locker returns).
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| Yes | — | InPost ShipX API token | ||
| Yes | — | InPost organization ID | ||
| No | Use sandbox API environment | |||
| No | Default parcel template for locker shipments | |||
| For courier | — | Sender details (required for courier shipments) | ||
| No | — | Sender company name | ||
| No | — | Sender first name | ||
| No | — | Sender last name | ||
| Yes | — | Sender email | ||
| Yes | — | Sender phone number | ||
| Yes | — | Sender address |
MIT