smart-dato / afs-logistic-sdk
AFS Logistic shipment tracking SDK for Laravel
Fund package maintenance!
Requires
- php: ^8.2|^8.3|^8.4|^8.5
- illuminate/contracts: ^10.0||^11.0||^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.1.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-23 14:35:34 UTC
README
A Laravel package for looking up shipment tracking through the AFS Logistic public data service API.
Requirements
- PHP 8.2+
- Laravel 10 – 13
Installation
composer require smart-dato/afs-logistic-sdk
Publish the config file:
php artisan vendor:publish --tag="afs-logistic-sdk-config"
Configuration
AFS_LOGISTIC_CLIENT_ID=your-client-id AFS_LOGISTIC_ORGUNIT_ID=your-orgunit-id AFS_LOGISTIC_AUTH_TOKEN=your-auth-token
Requests go to {AFS_LOGISTIC_URI}/afs/dataservice/publicapi/v1/shipment/retrieve, with AFS_LOGISTIC_URI defaulting to https://shippingnet01.ondot.at. Set AFS_LOGISTIC_TRACKING to override the full endpoint URL.
Usage
use SmartDato\AfsLogistic\Facades\AfsLogistic; $shipment = AfsLogistic::tracking('your-shipment-number');
Or pass the credentials explicitly; any you leave out fall back to the config:
use SmartDato\AfsLogistic\AfsLogistic; $afs = new AfsLogistic( clientId: 'your-client-id', orgunitId: 'your-orgunit-id', authToken: 'your-auth-token', ); $shipment = $afs->tracking('your-shipment-number');
tracking() looks the shipment up by its matching number and returns the decoded JSON response. It requests the shipment's codes, status, number and pickup/delivery carrier IDs, plus each collo's codes, status, number, tracking number and tracking link.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.