Apaczka
Apaczka.pl shipping for Medusa v2: 20+ Polish and international carriers, parcel lockers and pickup points, live rates, labels, COD, courier pickups, returns and webhook tracking.
Apaczka.pl for Medusa
Ship with 20+ Polish and international carriers from your Medusa store through one Apaczka.pl account. InPost, DPD, DHL, UPS, GLS, Pocztex, Orlen Paczka, FedEx and more.
Installation · Configuration · All options · What it does · Demo mode · Sandbox · Storefront
Requirements
- Medusa 2.22 or newer, Node.js 20.19+ or 22.12+
- An Apaczka.pl account with WebAPI access (Apaczka panel → Settings → API)
Installation
The package has no runtime dependencies of its own. It uses the Medusa packages your app already has (, , the admin SDK, UI and icons, and ) as peer dependencies.
Register it (Configuration) and run the migrations:
npx medusa db:migrateTrying a local build
To test unreleased changes in an app before publishing:
() rebuilds and republishes on every change.
Configuration
The plugin (shipment records, admin UI, webhooks, jobs) and the fulfillment provider (rates, labels) share one options object:
If or is missing, or an option is invalid, Medusa still starts. The plugin stays disabled, logs one line () and shows the reason on the Apaczka page in the admin menu, under the tabs. Nothing is sent to Apaczka until you fix the options and restart.
Every option is described in docs/configuration.md: pricing, parcels, pickups, COD, insurance, notifications, tracking, caching and code hooks.
Environment variables
The plugin reads only its options. These are the variables the example above maps into them; copy .env.template to start.
| Variable | Used for | |
|---|---|---|
| Apaczka panel → Settings → API | ||
| Keep it out of git. Used only to sign requests and verify webhooks, never logged | ||
| or . Sandbox and production credentials are different | ||
| Public URL of your backend, for push tracking | ||
| sandbox tests only | See Testing against the Apaczka sandbox | |
| sandbox tests only | ||
| sandbox tests only | also creates and cancels a real sandbox order |
Create shipping options
- In the admin, open Settings → Locations, pick a location and enable the apaczka fulfillment provider.
- In a shipping zone, click Create option, choose the apaczka provider and pick a service, such as "InPost Paczkomat" or "DPD Kurier — COD" (service names come from your Apaczka account).
- Choose a Fixed price or Calculated (a live Apaczka quote, with your pricing rules applied).
The Settings tab of the Apaczka page shows whether the connection works and which services your account has.
Add the point picker to your storefront
For locker and pickup-point services, the customer has to choose a point. Copy the storefront kit into your storefront and send the point with the shipping method:
What it does
- Every service on your account. Read from Apaczka, never hardcoded, and refreshed daily. Each service is available as a standard, cash-on-delivery and return shipping option.
- Live rates or flat rates per shipping option, with markups, rounding, free-shipping thresholds, per-service overrides and a fallback price so checkout keeps working if Apaczka is down.
- Parcel lockers and pickup points. Point validation at checkout (including COD support at the point) and a map-and-list point picker for the storefront.
- Labels automatically or by hand. PDF or ZPL for thermal printers. In manual mode staff can adjust parcels, service, pickup, COD, insurance and the point before creating the shipment.
- Courier pickups for one shipment or many (batch), using the pickup days Apaczka offers.
- Return labels created as soon as a return is requested.
- Tracking by signed webhooks with polling as a backup. Fulfillments are marked shipped and delivered in Medusa, and events are emitted for your own notifications.
- Apaczka page in the admin menu with every shipment in one list: search by waybill, Apaczka or order number, filters by status and returns, labels, tracking refresh, a courier pickup or a hand-over protocol for several shipments at once, a Settings tab with a connection check and the options in use, and a Guide tab. Plus a panel on each order page. In Polish and English.
- Multi-warehouse. The sender address comes from each stock location, with per-location overrides.
- Built to be safe. HMAC request signing, webhook signature verification against the raw request body, no retries on order creation (so no duplicate orders), every workflow step undone on failure, money handled as integers, and secrets masked in logs and never returned by the admin API.
What it does not do
- No customer notifications of its own. The plugin emits events () and can turn on Apaczka's own e-mail/SMS notifications. Sending your own e-mails or texts is up to your subscribers.
- Nothing the Apaczka API does not offer. No invoices or billing, no claims handling, no address book sync. Those stay in the Apaczka panel.
- One Apaczka account per Medusa instance. Each stock location can have its own sender address, but all shipments go through the same account.
- No live currency conversion. Apaczka prices in PLN. For other cart currencies you set fixed rates () or use flat-rate options.
- No storefront code in the npm package. The point picker is copy-in source in storefront/, so your storefront does not pull in Medusa's backend packages.
How it works
- Creating shipments. With (the default), the Apaczka order is created when you create a fulfillment in Medusa, and the label is attached to it. With , the fulfillment is created first and staff create the shipment from the Apaczka shipments panel on the order page. That lets them check the price and adjust parcels, pickup, COD or the point first.
- Parcel weight. Parcels are weighed from the variants' (grams by default, ). A variant without a weight counts as (1 kg) per unit. The shipment form warns about such products, and Settings → Parcel weight lists every variant without a weight and can hold automatic shipments that contain one, so a person checks the parcel before the carrier gets a guessed weight.
- Sender address. Built from the stock location's address, merged with (global defaults) and (per location).
- Cash on delivery. Each parcel collects only what is still unpaid. Split orders are divided across parcels so the total is never collected twice.
- What runs where. Medusa's fulfillment provider can't see payments, other shipments of the order or the full stock location. So COD shipments, and shipments whose sender needs the stock location's address, are created by the plugin a moment after the fulfillment, through the same workflow as the order panel. If Apaczka rejects one, the reason shows in the order panel with a button to retry.
- Returns. Return shipping options work like outbound ones. The return label is created right after the return is requested (or by hand in manual mode).
- Tracking. Apaczka pushes signed status updates to . A job polls active shipments every 30 minutes as a backup. The plugin marks fulfillments shipped and delivered, and emits events you can subscribe to.
- Cancellation. Cancelling a fulfillment in Medusa cancels the Apaczka order. Apaczka refuses once the carrier has the parcel, and the plugin shows that message.
Webhooks
Set and every order is created with its own webhook URL. You can also paste once into the Apaczka panel (Settings → WebAPI). Requests are rejected unless their HMAC signature matches your app secret.
Events
| Event | When |
|---|---|
| An Apaczka order was created for a fulfillment | |
| Any status change (, ) | |
| The carrier took the parcel | |
| Waiting in a locker or pickup point | |
| Delivered | |
| Failed delivery attempt, notice left, unknown status | |
| Returned to sender (including uncollected parcels) | |
| Canceled | |
| A courier pickup was booked |
Customizing
Most behaviour is set through options: pricing per service, parcel sizing, pickup windows, COD payout account, insurance, Apaczka's own e-mail/SMS notifications, label format, content templates, and which services appear in the admin.
For anything else there are code hooks, so you don't need a fork:
The workflows are exported for use in your own code:
You can also pass when creating a fulfillment through Medusa's API: skips automatic creation, and adjusts the shipment.
API
| Route | |
|---|---|
| Search parcel points (cached on the server) | |
| One point | |
| Apaczka push tracking (signed) | |
| Connection check and configuration summary | |
| Services, additional options and package types | |
| Shipments with tracking history and order numbers | |
| Price a shipment before creating it | |
| Create the shipment (with overrides) | |
| Refresh tracking now | |
| Label (PDF/ZPL), also used as the Medusa label URL | |
| Drop-off code | |
| Hand-over (turn-in) confirmation PDF for several shipments | |
| Available courier pickup days | |
| Book a courier pickup |
Demo mode
To show the plugin without an Apaczka account, set (no or needed):
A built-in client then answers every call itself and nothing is sent to Apaczka:
- Services: five sample services (InPost Paczkomat and Kurier, DPD Classic and Pickup, Pocztex Kurier, IDs 9101–9105) that become shipping options as usual, with COD and return variants.
- Prices: a base price per parcel, more per started kilogram above 1 kg and for COD; gross is net + 23% VAT.
- Parcel points: eight sample InPost and DPD points in Polish cities, for the storefront point picker.
- Shipments: created from fulfillments or the order page, with a waybill number, a price, a PDF (or ZPL) label marked as a demo, a drop-off code, courier pickups and hand-over protocols.
- Tracking moves on by itself: picked up after 2 minutes, at the sorting centre after 5, on the way after 10, delivered after 20. Every fifth shipment has a failed delivery attempt first and is delivered 10 minutes later. "Refresh tracking" shows the progress at once; the fulfillment is marked shipped and delivered like with real tracking.
- Cancellation works only in the first 2 minutes, before the carrier takes the parcel.
The admin page shows a "Demo mode" bar and the Settings tab shows the environment. Demo orders are kept in memory; after a restart their details are rebuilt from the order ID, so existing shipments keep working. Don't use demo mode in production: the shipments are not real.
Testing against the Apaczka sandbox
Use with sandbox credentials while developing. Production orders are real orders with real couriers and invoices.
-
Ask Apaczka support for sandbox access. The sandbox host () may only accept requests from allowlisted IP addresses. If requests time out, check that first.
-
Create API credentials in the sandbox panel. They differ from production.
-
Run the read-only checks (signing, service structure, valuation, points):
-
Optionally, also create and cancel a real sandbox order:
-
To try the whole flow, point a Medusa app at the sandbox (), create a fulfillment and check the order panel.
Sandbox limitations (from Apaczka): and are not available, may time out, the service list is smaller and its IDs differ from production, and courier pickups through the API must be enabled on the account by Apaczka support.
Troubleshooting
| Problem | Fix |
|---|---|
| "Invalid signature" / settings page shows not connected | Check /, and that matches the credentials. Sandbox and production keys are different. |
| Shipping options fail at checkout | A calculated option failing makes Medusa fail the whole list. Set , and make sure the cart has a full shipping address. |
| "Apaczka prices are in PLN, but the cart is in EUR" | Add , or use fixed prices for that currency. |
| Shipment stays "Not created" with a sender-address reason | Fill in the stock location's address, or set / . |
| COD orders are rejected | Set (IBAN) or . |
| Courier booking fails | Ask Apaczka support to enable "pickup via API" on your account. |
| No tracking updates | Check the webhook URL on the settings page. Polling also needs the shipment to have a tracking number. |
| Log says | Options are missing or invalid. The line names the fields; fix them and restart. |
Development
See docs/development.md for the code layout, conventions and tests, and the repository guide for the shared tooling.
License
Built and maintained by Bitshaft, a Medusa and e-commerce engineering studio. Need help with an implementation or a custom integration? Get in touch.
Apaczka and Apaczka.pl are trademarks of Alsendo sp. z o.o. This plugin is an independent integration built on the public Apaczka WebAPI v2. See TRADEMARKS.md.

