Search by

waaz / sylius-fedex-plugin

ehibes

This FedEx plugin enables you to easily print shipping labels and show available pickup locations for customers to choose from.

Package info

github.com/StudioWaaz/SyliusFedexPlugin

Type:sylius-plugin

pkg:composer/waaz/sylius-fedex-plugin

Statistics

Installs: 27

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

This package is not auto-updated.

Last update: 2026-12-02 09:35:48 UTC


README

Logo

GitHub Workflow Status Scrutinizer Code Quality

WaazSyliusFedexPlugin

This plugin allows you to integrate FedEx REST API into your Sylius store for shipping labels generation and pickup points / drop-off locations.

Features

  • FedEx Shipping Labels Export (via bitbag/shipping-export-plugin)
    • Integration with FedEx REST API v1 (/ship/v1/shipments)
    • Generates labels in PDF or PNG format
    • Automatically retrieves and assigns master tracking numbers
  • FedEx Pickup Points / Drop-off Locations (via setono/sylius-pickup-point-plugin)
    • Searches nearest FedEx locations and drop-off points (/location/v1/locations)
  • Recipient Notifications (optional, sent by FedEx)
    • emailNotificationDetail in the Ship API payload (ON_DELIVERY, ON_EXCEPTION, ON_ESTIMATED_DELIVERY, ...)
    • Email (EMAIL) and/or SMS (SMS_TEXT_MESSAGE) recipients
    • Configurable format (HTML/TEXT), locale and personal message
  • Phone Number Normalization (giggsey/libphonenumber-for-php-lite)
    • Local formats (06 12 34 56 78) become FedEx-ready digits with dialing code (33612345678)
    • Unparseable numbers are omitted instead of being replaced by a placeholder
  • OAuth2 Token Handling with automatic caching
  • Sylius 1.11, 1.12 & 1.13 compatible with native Symfony HTTP client (symfony/http-client)

Requirements

  • PHP 8.1+ (the lite libphonenumber build requires it)
  • Sylius 1.11 to 1.14

Installation

1. Install via Composer

composer require waaz/sylius-fedex-plugin

2. Enable the Plugin

Add the plugin to your config/bundles.php:

return [
    // ...
    BitBag\SyliusShippingExportPlugin\BitBagSyliusShippingExportPlugin::class => ['all' => true],
    Setono\SyliusPickupPointPlugin\SetonoSyliusPickupPointPlugin::class => ['all' => true],
    Waaz\SyliusFedexPlugin\WaazSyliusFedexPlugin::class => ['all' => true],
];

3. Plugin Configuration

Create config/packages/waaz_sylius_fedex_plugin.yaml:

waaz_sylius_fedex:
    sandbox: true      # true for sandbox/testing, false for production
    weight_unit: 'KG'  # 'KG' or 'LB'

4. Enable FedEx Pickup Point Provider (Optional)

In config/packages/setono_sylius_pickup_point.yaml:

setono_sylius_pickup_point:
    providers:
        fedex: true

Shipping Gateway Configuration (Admin)

In Sylius Admin panel:

  1. Go to Shipping > Shipping gateways (/admin/shipping-gateways/new/fedex).
  2. Fill in your FedEx credentials:
    • FedEx API Key (Client ID)
    • FedEx Secret Key
    • FedEx Account Number
    • Environment (sandbox or production)
    • Default Shipping Service (FEDEX_GROUND, FEDEX_EXPRESS_SAVER, INTERNATIONAL_PRIORITY, etc.)
    • Drop-off Type (REGULAR_PICKUP, BUSINESS_SERVICE_CENTER, DROP_BOX, etc.)
    • Packaging Type (YOUR_PACKAGING, FEDEX_BOX, FEDEX_ENVELOPE, etc.)
    • Label format: PDF/PNG for laser, ZPLII for Zebra thermal, EPL2 for Eltron thermal
    • Stock type: laser (PAPER_*) or thermal (STOCK_*), including Doc-Tab variants
    • Shipper Contact and Address details
    • Recipient notifications (optional): enable email and/or SMS, choose the events (ON_DELIVERY, ON_ESTIMATED_DELIVERY, ON_SHIPMENT, ON_TENDER, ON_EXCEPTION, ON_PICKUP), the email format (HTML/TEXT), the locale (e.g. fr_FR) and an optional personal message

Recipient notifications: what FedEx can and cannot do

The notification emails and SMS are sent by FedEx, not by Sylius, and use FedEx's own content. The personal message is the only customizable part (500 characters in HTML, 120 in TEXT).

SMS uses the phone number of the shipping address. It is normalized with giggsey/libphonenumber-for-php-lite:

Input (Sylius, country FR) Sent to FedEx
06 12 34 56 78 33612345678
+33 6 12 34 56 78 33612345678
0000000000 field omitted
not a phone field omitted
  • FedEx requires 10 to 15 digits. US/CA numbers are sent as exactly 10 digits, without prefix.
  • No made-up fallback is sent anymore: an unusable number is omitted rather than replaced by 0000000000.
  • SMS still requires a valid customer email in the payload, because FedEx expects an email address on every notification recipient.
  • Check SMS availability for your destination country/account with FedEx, and make sure the customer consented to SMS notifications (GDPR).

There is no FedEx notification event for “parcel arrived at the pickup point”. The closest options are:

  • ON_ESTIMATED_DELIVERY — estimated delivery date updates
  • ON_DELIVERY — the shipment reached its final destination
  • ON_EXCEPTION — delivery exception

⚠️ For a shop-branded “your parcel is ready at the pickup point” email, the FedEx Advanced Integrated Visibility webhooks (tracking events pushed to your own HTTPS endpoint) are required instead. Those webhooks are currently limited to US-based shipping/billing accounts.

⚠️ This plugin also does not forward the pickup point selected with setono/sylius-pickup-point-plugin (shipment.pickupPointId) to FedEx: the recipient address in the payload is always the order shipping address. Make sure the delivery address matches the pickup point before relying on ON_DELIVERY as an “arrived at pickup point” signal.

Running Tests

  • PHPUnit (Unit Tests):
vendor/bin/phpunit
  • Behat (non-JS scenarios):
vendor/bin/behat --strict --tags="~@javascript"
  • Behat (JS scenarios):
# 1. Start Chrome headless
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 &

# 2. Start test application web server
APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon

# 3. Run Behat
vendor/bin/behat --strict --tags="@javascript"
  • PHPStan:
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
  • Coding Standard (ECS):
vendor/bin/ecs check src

Author

License

This plugin's source code is completely free and released under the terms of the MIT license.