Drusoft Shipping for Sameday

Description

Drusoft Shipping for Sameday connects a WooCommerce store in Bulgaria to the Sameday courier. Customers see live Sameday prices at checkout and choose delivery to their door, to an easybox locker or to a SAMEDAY point; the merchant creates, prints and cancels waybills from the order screen.

Important Compatibility Note

This plugin is currently not compatible with the WooCommerce Block Cart and Block Checkout pages. Please ensure your store uses the classic shortcode-based Cart ([woocommerce_cart]) and Checkout ([woocommerce_checkout]) pages.

For Your Customers

  • Three delivery options — to an address (24H), to an easybox locker, or to a SAMEDAY point.
  • Live prices — each option is priced by Sameday for the actual parcel, city and payment method.
  • City list — the customer picks a region, then a city from a searchable list (Latin or Cyrillic); the postcode fills itself.
  • Only what the city has — easybox and SAMEDAY point are offered only in cities that have one, with a searchable list of that city’s locations.
  • Map picker — a map of every easybox and SAMEDAY point in the country, opened on the customer’s city, with filters and search. Picking a location elsewhere sets the region, city and delivery type by itself.
  • Full lockers hidden — locations Sameday reports as over capacity are not offered.

For Merchants

  • HPOS Compatible — Fully supports WooCommerce High-Performance Order Storage.
  • Automated Data Sync — Uses Action Scheduler to refresh Bulgarian cities and Sameday pickup locations daily, so checkout never waits on the API.
  • Fallback prices — if Sameday cannot be reached, checkout still shows a price from a table you configure.
  • Waybill Management — Create, print (PDF) and cancel waybills from the order edit screen, or create them automatically when an order becomes Processing or On hold.
  • Cash on delivery collected correctly — the waybill always carries the order total, never a stale checkout estimate.
  • Declared value — off, above a threshold, or always.
  • Open before paying — optionally add Sameday’s „Отвори преди да платиш“ extra to every waybill for delivery to an address.
  • Demo and production — switch between Sameday’s demo and live environments in the settings.
  • Bulgarian (bg_BG) Translation Included.

Also Ship via Speedy or Econt?

This plugin has siblings for the other Bulgarian couriers: Drusoft Shipping for Speedy and Drusoft Shipping for Econt. All three share the same checkout experience, map picker and order screens, and are built to run side by side on one checkout.

External Services

This plugin relies on the Sameday API, a third-party service provided by Деливъри Солюшънс ЕООД (Delivery Solutions EOOD, operator of the Sameday brand in Bulgaria), to deliver its shipping functionality. The plugin cannot operate without a valid Sameday API account.

The checkout map also loads map tiles from OpenStreetMap.

What the service is

Sameday is a courier company operating in Bulgaria, Romania and Hungary. Its REST API lets merchants price shipments, create and cancel waybills, download labels, and retrieve cities and pickup locations (easybox lockers and SAMEDAY points).

What data is sent and when

Authentication: the API username and password are exchanged once for a token, which is cached and sent as an X-AUTH-TOKEN header on later requests.

  • Recipient data (name, phone, email, city, county, address, postcode, chosen pickup location) — sent when a shipping price is calculated at checkout and when a waybill is created.
  • Shipment details (pickup point id, weight, package count, service, cash-on-delivery amount, declared value, order number, item descriptions) — sent when a price is calculated and when a waybill is created.
  • Waybill numbers — sent when a label is downloaded or a waybill is cancelled.
  • No customer data is sent during the daily location sync, which only downloads cities and pickup locations.

Map tiles are requested from OpenStreetMap by the customer’s browser only when the customer opens the map picker; the request reveals the customer’s IP address and the map area viewed.

Service links

Bundled Libraries

The map picker uses Leaflet 1.9.4 (https://leafletjs.com/), bundled locally in
assets/vendor/leaflet/ rather than loaded from a CDN, so no request leaves the visitor’s
browser until they open the map. Leaflet is distributed under the BSD 2-Clause License; its
licence text ships alongside it at assets/vendor/leaflet/LICENSE.

Sameday API Endpoints

This plugin communicates with one host per environment:

  • api.sameday.bg — production
  • sameday-api-bg.demo.zitec.com — demo

Authentication

  • POST /api/authenticate — Exchanges the username and password for a token, cached until shortly before it expires.

Location Data

  • GET /api/geolocation/city — Bulgarian cities with their county, stored in wp_drushfs_cities.
  • GET /api/client/ooh-locations — easybox lockers and SAMEDAY points, stored in wp_drushfs_lockers.
  • GET /api/client/services — Services enabled for the account.
  • GET /api/client/pickup-points — The merchant’s pickup points, for the settings screen.

Pricing

  • POST /api/awb/estimate-cost — Price for a shipment, used at cart and checkout.

Shipment Management

  • POST /api/awb — Creates a waybill.
  • GET /api/awb/download/{awbNumber} — Downloads the label PDF.
  • DELETE /api/awb/{awbNumber} — Cancels a waybill.
  • GET /api/client/awb/{reference} — Looks a shipment up by order number.
  • GET /api/client/status-sync — Shipment status changes.

Rate Limiting & Caching

  • Local database tables — Cities and pickup locations are synced once per day and queried locally.
  • Token caching — One authentication per token lifetime rather than one per request.
  • Quote caching — Prices are cached for 15 minutes per shipment shape.
  • Map data — The pickup list is loaded per city; the map’s country-wide list is fetched only when the customer opens the map and is cached for an hour.

Screenshots

Installation

  1. Upload the drusoft-shipping-for-sameday folder to the /wp-content/plugins/ directory.
  2. Ensure WooCommerce is installed and active.
  3. Activate the plugin through the Plugins menu in WordPress.
  4. Navigate to WooCommerce > Settings > Shipping > Shipping Zones.
  5. Add or edit a shipping zone (e.g. “Bulgaria”).
  6. Click Add shipping method and select Sameday.
  7. Choose the environment, enter your Sameday API username and password, and click Save Changes. The credentials are checked immediately and the first location sync runs.
  8. Select your pickup point and the delivery options you want to offer, then save again.

FAQ

What Sameday credentials do I need?

An API username and password issued by Sameday for your contract. Demo credentials and production credentials are separate — ask Sameday’s integration team for both.

Does this plugin support the WooCommerce Block Checkout?

Not yet. The plugin currently requires the classic shortcode-based Checkout page ([woocommerce_checkout]).

How are pickup locations kept up to date?

The plugin uses the WooCommerce Action Scheduler to refresh cities, easybox lockers and SAMEDAY points from the Sameday API once a day. You can monitor the scheduled action (drushfs_sync_locations_event) under WooCommerce > Status > Scheduled Actions. The settings screen shows when the last refresh ran.

How is shipping cost calculated?

Each delivery option is priced live by Sameday’s estimate-cost endpoint for the parcel weight, destination, cash-on-delivery amount and declared value. Quotes are cached for 15 minutes so a checkout does not call the API on every keystroke. If Sameday cannot be reached, the fallback prices from the settings are used instead.

Why is the SAMEDAY point option missing at checkout?

Each pickup option appears only when the customer’s city has such a location. A city with no SAMEDAY point offers address delivery and, if it has one, easybox.

Can I automatically generate waybills?

Yes. Enable Create automatically in the shipping method settings. A waybill is created when an order becomes “Processing” or “On hold”; an order that already has one is never given a second.

The browser console shows a 404 for “…/undefinedwc/store/v1/cart” on the cart page. Is that this plugin?

No. That request is made by WooCommerce’s own Mini-Cart block (the cart icon in the header of block themes such as Twenty Twenty-Five) when the cart itself is the classic shortcode page this plugin requires. WooCommerce builds the address from a value that is not set on that page, so it starts with the word “undefined”. It appears with every shipping plugin switched off as well, and it does not affect prices, delivery options or orders — only the header icon’s item count may lag until the next page load.

What happens to my data if I deactivate or delete the plugin?

Deactivating stops the daily sync and nothing else — your settings and the synced cities and pickup locations stay, so switching the plugin back on costs nothing. Deleting the plugin removes its two tables, its settings and its cached data. Orders keep their waybill number and pickup location either way.

Can I request a courier from WordPress?

No. Sameday’s client API has no courier-request endpoint. Collection follows your pickup point arrangement with Sameday, or you drop parcels into an easybox.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Drusoft Shipping for Sameday” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.4

  • Improved: when Sameday stops answering, the fallback table prices the checkout for two minutes and then Sameday is asked again. A table price is now remembered for one minute instead of fifteen, so live prices return as soon as Sameday does. A price request waits at most 15 seconds instead of 45.
  • Improved: a Sameday method saved without a pickup point used to price everything from the fallback table in silence. The pickup point is now selected automatically when the account has only one; otherwise the settings refuse to save without one, a notice appears on the WooCommerce screens and the log says why.
  • Fixed: a Sameday reply without a price is logged instead of silently falling back.

1.0.3

  • Security: the delivery choice posted with the cart or checkout is only read when WooCommerce’s own nonce for that request verifies; any other request leaves the customer’s saved choice untouched. The checkout validation and order-meta hooks check the checkout nonce themselves as well.

1.0.2

  • Fixed: activating the plugin no longer contacts Sameday. Activation used to fetch cities, lockers and services straight away, which could hold the admin for over two minutes if Sameday was unreachable; the first sync is now scheduled a minute after activation and runs in the background instead.

1.0.1

  • First public release.
  • Three delivery options priced live by Sameday: to an address (24H), to an easybox and to a SAMEDAY point.
  • Region and city pickers that fill the postcode, offering only the options the chosen city actually has.
  • Searchable pickup list plus a map of every location in the country, opened on the customer’s city.
  • Daily location sync through Action Scheduler; fallback prices when Sameday cannot be reached.
  • Waybills created by hand or automatically, PDF labels, cancellation and tracking links.
  • Optional “open before paying” extra on address deliveries; declared value off, above a threshold or always.
  • Demo and production environments; Bulgarian translation included.
  • Deactivating the plugin keeps your settings and synced locations; they are removed only when the plugin is deleted.