Shipping

DPD integration for Medusa

Ship with DPD from Medusa: five shipping options (courier and DPD Pickup, each with or without cash on delivery, plus returns), the pickup point checked at checkout, and the fulfillment turned into a DPD shipment from a plan a person reads first. Labels and handover protocols stay in the database, statuses come from the DPD InfoServices, and Medusa can mark fulfillments shipped and delivered on its own.

See it in the demo admin
DPD: The integration page in the Medusa admin, demo mode with sample data.
The integration page in the Medusa admin, demo mode with sample data.
DPD: The pickup point map in the checkout of our demo store.
The pickup point map in the checkout of our demo store.

What exactly
this integration does

  • Five shipping options

    DPD courier and DPD Pickup, both with cash on delivery or without, plus a return option. The courier needs a full address, DPD Pickup a point id and the receiver's phone or e-mail, and COD a currency allowed for the country.

  • The point picked at checkout

    The storefront shows DPD's PudoFinder map or its own list of points from the store routes. The checkout checks the point fresh and keeps its data with the shipping method, and an outage of the point search never stops sales.

  • A plan a person reads

    Before anything reaches DPD, the admin shows the receiver, the sender, the boxes with weight and size, the COD and the exact request. When the order changed in the meantime, the send comes back with a new plan.

  • A shipment exactly once

    An unclear answer from DPD (a timeout, a network error) never ends in a second parcel: the plugin looks the shipment up in DPD by its reference first, and only then lets it be created again.

  • Handover to the courier

    Up to 100 labeled shipments of one sender in one DPD protocol, then optionally the courier order. The protocol stays in the database, and printing it again is a deliberate action, never a retry.

  • Statuses and fulfillments in Medusa

    A job of its own asks the DPD InfoServices about every waybill. The status writer marks the fulfillment shipped when DPD has the parcel, and delivered when every waybill of the shipment is delivered.

How it guards
your data

  • Two switches per writer

    The option is the hard switch, the toggle in Settings the day to day one, stored with who flipped it and when. Separate for shipments, courier orders and statuses.

  • COD once per order

    The COD amount is what is still due, on one shipment of the order only. An order paid online never gets cash on delivery.

  • Credentials stay on the server

    The DPD login, password and keys only ride requests from the backend, masked in logs, errors and the admin. Labels and protocols come back from the database without asking DPD again.

  • Medusa never takes a shipment back

    A fulfillment is shipped only once DPD confirms it has the parcel, never from the handover alone. A parcel on its way back to the store is never marked delivered.

Setup
in three steps

The full list of options, events and API routes is in the package README on GitHub.

Paste it into Claude Code, Cursor or another AI assistant in your Medusa project: it installs and configures the integration, with writes off.

  1. 1
    Install the package from npm.
    npm install @koda-plus/medusa-plugin-dpd
  2. 2
    Add the plugin to medusa-config.ts.
                            const dpd = {
      login: process.env.DPD_LOGIN,
      password: process.env.DPD_PASSWORD,
      masterFid: process.env.DPD_MASTER_FID,
      sender: process.env.DPD_SENDER, // JSON with the sender address
      // mode: "live",          // sandbox by default
      // Writes: off unless allowed here AND armed in the admin.
      // shipmentWriter: true,  // create shipments, labels and handover protocols
      // pickupWriter: true,    // order the DPD courier for a handover
      // infoLogin, infoPassword, infoChannel: DPD InfoServices, statuses in live mode
      // fulfillmentStatusWriter: true, // mark Medusa fulfillments shipped and delivered
      // demo: true, // sample shipments from your orders, nothing sent to DPD
    }
    
    plugins: [{ resolve: "@koda-plus/medusa-plugin-dpd", options: dpd }],
    modules: [
      {
        resolve: "@medusajs/medusa/fulfillment",
        options: {
          providers: [
            { resolve: "@medusajs/medusa/fulfillment-manual", id: "manual" },
            { resolve: "@koda-plus/medusa-plugin-dpd/providers/dpd", id: "dpd", options: dpd },
          ],
        },
      },
    ]
                          
  3. 3
    Run the migrations and open the integration in the Medusa admin.
    npx medusa db:migrate
Free 15-minute call

Tell us about your project,
we'll tailor the rest to you

A 15-minute call is enough for us to know whether we are a fit for your project.
We start from what you need, not from an off-the-shelf solution.

See our demo

Contact us

Remigiusz in a navy shirt and glasses
I use iMessage I use WhatsApp
Adrian in a grey turtleneck and glasses
I use iMessage I use WhatsApp