B2B Shipping Guide

Shipping API Integration for Portuguese Businesses

Connect your WMS, ERP or e-commerce platform to carrier APIs for automated label printing, real-time tracking and multi-carrier booking.

Manual shipping — logging into carrier portals, entering parcel details one by one, downloading and printing labels — does not scale. Businesses processing 50+ shipments per day need their shipping to be automated: order comes in, label is generated, carrier is booked and tracking number is returned to the customer — all without manual intervention. Carrier API integration makes this possible. This guide explains how shipping API integration works, the options available to Portuguese businesses, and how Cargosender's API simplifies multi-carrier connectivity.

Key Benefits

Automated label generation

Generate carrier labels automatically when an order is confirmed — no manual portal entry. Saves 2–5 minutes per shipment.

Real-time tracking in your system

Pull tracking events back into your OMS, CRM or customer portal — customers see live status without leaving your site.

Multi-carrier from one API

Cargosender API connects to DHL, FedEx, UPS, DPD and GLS — one integration, all carriers. No need to maintain separate API connections per carrier.

Rate shopping at booking

Query rates across carriers at the moment of booking — always select the cheapest or fastest option for each order's weight and destination.

What Shipping API Integration Does

A shipping API integration connects your order management or fulfilment system directly to carrier systems. When an order is ready to ship, your system calls the carrier (or aggregator) API with the parcel details — weight, dimensions, destination address, service type — and receives back a shipping label (PDF or ZPL for thermal printers), a tracking number and estimated delivery date. This happens in milliseconds and eliminates the manual step of entering parcel details into a carrier portal.

  • Rate query: get live prices for a parcel across one or multiple carriers before committing.
  • Shipment creation: submit parcel details, receive label and tracking number.
  • Label format: PDF (A4 or A6) or ZPL (for Zebra/thermal label printers).
  • Tracking webhook/polling: receive tracking event updates as the parcel moves through the carrier network.
  • Manifest/collection request: schedule a pickup or generate a daily manifest for driver collection.
  • Void/cancel shipment: cancel a booked shipment before collection if an order is cancelled.

Direct Carrier APIs vs Cargosender API

You can integrate directly with each carrier's own API, or use Cargosender's unified API that connects to all carriers from a single endpoint. Both approaches have trade-offs:

  • Direct carrier API (e.g. DHL Express XML/REST, UPS API, GLS API): carrier-specific authentication, data formats and documentation. Full feature access for that carrier. Requires separate integration per carrier — managing 3–5 separate API connections is complex.
  • Cargosender API: one integration gives access to all carriers. Normalised data format — same request structure regardless of carrier. Rate comparison built in. Easier to maintain. Slight feature subset vs carrier's own API for very specific advanced services.
  • Recommendation: for most businesses (under 500 shipments/day), Cargosender API is more practical. For very high-volume operations with a single dominant carrier (e.g. 1,000+ DHL Express shipments/day), a direct carrier API alongside an aggregator API makes sense.

E-commerce Platform Integrations

If you sell via Shopify, WooCommerce, PrestaShop, Magento or other e-commerce platforms, shipping integrations are available without writing custom API code:

  • Shopify: Cargosender Shopify app (or carrier-specific Shopify apps for DHL, DPD) — connects orders to shipping booking with one click per order or automatically on fulfilment.
  • WooCommerce: WooCommerce shipping plugins for DHL, DPD, GLS and aggregators — install and configure with your account credentials.
  • PrestaShop: carrier module marketplace has integrations for all major carriers. Portuguese e-commerce businesses commonly use PrestaShop.
  • Magento/Adobe Commerce: enterprise-grade carrier integrations available. Often requires developer setup.
  • Custom OMS/ERP: use Cargosender REST API directly — documentation available, RESTful JSON format, test environment available.

What You Need to Get Started

Setting up a shipping API integration requires a few things in place before development begins:

  • Cargosender business account (or direct carrier account): you need account credentials and an API key — contact Cargosender to request API access.
  • Developer resource: a developer needs to implement the API calls in your system. Most REST API integrations take 1–5 days for a developer familiar with the language/platform.
  • Test environment: always integrate with the sandbox/test environment first — generate test labels and validate tracking before going live with real shipments.
  • Label printer: ZPL thermal label printers (Zebra, Dymo) print labels faster and at lower cost than laser/inkjet A4 printing — essential for high-volume operations.
  • Address validation: implement address validation in your checkout to reduce failed deliveries and carrier surcharges for incorrect addresses.

Frequently Asked Questions

Do I need a developer to integrate shipping APIs?

For custom WMS/ERP or direct REST API integration: yes, a developer is needed. Most shipping API integrations take 1–5 days of development time for an experienced developer. For standard e-commerce platforms (Shopify, WooCommerce, PrestaShop): no developer needed — install the carrier or Cargosender plugin, enter your account credentials and configure service mapping. If you use a bespoke or enterprise system (SAP, Microsoft Dynamics, custom-built OMS), API integration requires your internal development team or a systems integrator.

Can I connect multiple carriers with a single API?

Yes — Cargosender's API provides access to DHL, FedEx, UPS, DPD and GLS through a single endpoint and authentication. You make one API call to get rates across all carriers and another to book with your chosen carrier. This is significantly simpler than maintaining separate API integrations with each carrier's own authentication system, rate format and error codes. For most Portuguese businesses, a multi-carrier aggregator API is the right approach.

How does real-time tracking work via API?

Once a shipment is booked via API, you receive a tracking number. Tracking events (picked up, in transit, out for delivery, delivered) are available via two methods: polling (your system queries the tracking API every hour/day to pull latest status) or webhooks (the carrier or Cargosender pushes event updates to a URL you provide in real time when status changes). Webhooks are more efficient for high-volume operations. Most platforms use tracking data to automatically update customers and trigger post-delivery flows (review requests, loyalty points).

What label format should I use — PDF or ZPL?

PDF labels (A4 or A6): print on any laser, inkjet or thermal label printer. Suitable for low-to-medium volume (under 100 labels/day). A6 PDF on a thermal label printer is common for small e-commerce operations. ZPL (Zebra Programming Language): direct thermal printing, very fast (1–2 seconds per label), low consumable cost (no ink). Standard for high-volume fulfilment (100+ shipments/day). Requires a Zebra-compatible thermal label printer (Zebra GK420d, ZD420 or similar). ZPL is the professional standard for warehouse fulfilment — if you are scaling up, invest in a thermal printer.

Can I automate address validation through the API?

Cargosender API includes address validation as part of the shipment creation request — invalid postal codes or addresses return an error before the shipment is committed, preventing wasted labels and failed deliveries. For proactive validation (at checkout, before the order is placed): consider integrating a dedicated address validation API (Google Places, Loqate, Melissa Data) in your checkout flow. Catching address errors at checkout is far cheaper than a failed delivery surcharge from the carrier (typically €3–€8 per failed attempt).

Related Guides

Ready to ship smarter as a business?

Compare live rates from DHL, FedEx, UPS, DPD and GLS. No account required to get a quote.

Get a Business Quote →