A professional web application for tracking parcels and getting shipping quotes using the Fastway Couriers South Africa API.
- Features
- Technology Stack
- Installation
- Configuration
- Usage
- Project Structure
- API Integration
- Testing
- Troubleshooting
- Real-time parcel tracking with tracking number
- Display current status and location
- Complete tracking history timeline
- Estimated delivery information
- Mobile-responsive interface
- Calculate shipping costs instantly
- Support for multiple delivery types (Standard, Express, Overnight)
- Optional parcel dimensions for accurate pricing
- Multiple service options display
- Detailed pricing breakdown
- Clean, professional Bootstrap UI
- Mobile-responsive design
- Input validation and error handling
- Loading indicators
- Print-friendly results pages
- Frontend: HTML5, CSS3, Bootstrap 5.3
- JavaScript: Vanilla JavaScript (ES6+)
- Backend: PHP 7.4+
- API: Fastway Couriers REST API
- Icons: Bootstrap Icons
- PHP 7.4 or higher
- Web server (Apache/Nginx) or PHP built-in server
- cURL extension enabled in PHP
- Modern web browser
# If using Git
git clone <repository-url> fastway-app
cd fastway-app
# Or download and extract the ZIP file
unzip fastway-app.zip
cd fastway-app# Check PHP version
php -v
# Check if cURL is enabled
php -m | grep curl# Create logs directory
mkdir -p logs
chmod 755 logs
# Ensure API files are readable
chmod 755 api
chmod 644 api/*.php# Start server on port 8000
php -S localhost:8000
# Access the application at:
# http://localhost:8000-
Copy the application to your web server's document root:
# For Apache (Ubuntu/Debian) sudo cp -r fastway-app /var/www/html/ # For Apache (CentOS/RHEL) sudo cp -r fastway-app /var/www/html/
-
Configure virtual host (optional)
-
Access via:
http://localhost/fastway-app
The API settings are configured in api/config.php:
// API Key (provided in requirements)
define('FASTWAY_API_KEY', '9f57d11554c24fb8f03a4875f513ce9f');
// API Base URL
define('FASTWAY_API_BASE_URL', 'https://sa.api.fastway.org');
// Required RF Code for Johannesburg
define('FASTWAY_RF_CODE', 'JNB');You can customize the application by editing:
- Styling:
assets/css/style.css - Colors: CSS variables in
:rootselector - API Settings:
api/config.php - Error Messages: Constants in
api/config.php
- Navigate to the home page or click "Track Parcel" in the navigation
- Enter a tracking number (e.g.,
Z60000983328) - Click "Track Parcel" button
- View real-time tracking information including:
- Current status
- Current location
- Tracking history timeline
- Estimated delivery date
- Destination information
Test Tracking Numbers:
Z60000983328Z30002408261
- Click "Get Quote" in the navigation
- Fill in the required information:
- Destination Suburb: e.g., Sandton
- Postal Code: 4-digit code (e.g., 2196)
- Weight: In kilograms (0.1 - 30 kg)
- Delivery Type: Standard, Express, or Overnight
- Optionally add parcel dimensions:
- Check "Add parcel dimensions"
- Enter Length, Width, Height in centimeters
- Click "Calculate Quote"
- View available shipping options with:
- Service names and descriptions
- Pricing breakdown
- Estimated delivery times
- Service features
fastway-app/
βββ index.php # Home/Dashboard page
βββ track.php # Parcel tracking page
βββ quote.php # Shipping quote page
βββ README.md # This file
βββ SOP.md # Standard Operating Procedure
β
βββ api/ # Backend API handlers
β βββ config.php # API configuration and helper functions
β βββ track.php # Track & trace API handler
β βββ quote.php # Quote lookup API handler
β
βββ includes/ # Reusable components
β βββ header.php # Navigation header
β βββ footer.php # Footer
β
βββ assets/ # Frontend assets
β βββ css/
β β βββ style.css # Custom styles
β βββ js/
β β βββ track.js # Tracking page JavaScript
β β βββ quote.js # Quote page JavaScript
β βββ images/ # Images (if any)
β
βββ logs/ # Error logs (auto-created)
βββ error.log # Application error log
Endpoint: https://sa.api.fastway.org/v3/tracktrace/detail
Parameters:
LabelNo: Tracking numberapi_key: API authentication key
Response: JSON containing tracking information
Endpoint: https://sa.api.fastway.org/v3/psc/lookup
Parameters:
DestinationPostCode: Postal codeDestinationSuburb: Suburb nameWeightInKg: Parcel weightRFCode: Region code (JNB)Length,Width,Height: Optional dimensionsapi_key: API authentication key
Response: JSON containing quote information
The application handles the following error scenarios:
-
Invalid Input
- Missing required fields
- Invalid format (postal code, weight, etc.)
- Out of range values
-
API Errors
- Connection timeouts
- HTTP errors
- Invalid responses
- Rate limiting
-
Network Errors
- No internet connection
- DNS resolution failures
- SSL/TLS errors
-
Test Tracking Feature:
# Valid tracking numbers Z60000983328 Z30002408261 # Invalid tracking number INVALID123 -
Test Quote Feature:
# Valid inputs Suburb: Sandton Postal Code: 2196 Weight: 2.5 kg Delivery Type: Express # Invalid inputs Postal Code: 123 (too short) Weight: 50 (over limit)
Test on the following browsers:
- Google Chrome (latest)
- Mozilla Firefox (latest)
- Safari (latest)
- Microsoft Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Test on different screen sizes:
- Desktop (1920x1080)
- Laptop (1366x768)
- Tablet (768x1024)
- Mobile (375x667)
Solution:
# Check if cURL is enabled
php -m | grep curl
# If not enabled, install it
# Ubuntu/Debian
sudo apt-get install php-curl
# CentOS/RHEL
sudo yum install php-curl
# Restart web server
sudo service apache2 restartSolution:
- Check PHP error log:
tail -f /var/log/apache2/error.log - Check application log:
tail -f logs/error.log - Verify PHP version:
php -v(must be 7.4+)
Solution:
- Verify API key in
api/config.php - Check if API key is valid and active
Solution:
- Check network connectivity
- Verify API endpoints are accessible
- Check browser console for JavaScript errors
- Enable error logging in
api/config.php
Solution:
- Clear browser cache
- Check if Bootstrap CSS is loading
- Verify file permissions for CSS files
- Check browser console for 404 errors
To enable debug mode, edit api/track.php and api/quote.php:
// Change this line
ini_set('display_errors', 0);
// To this
ini_set('display_errors', 1);Reember to disable debug mode in production!
If you encounter issues:
- Check the error log:
logs/error.log - Review browser console for JavaScript errors
- Verify API configuration in
api/config.php - Test API endpoints directly using tools like Postman
- Consult Fastway API documentation
- This application uses the Fastway Couriers South Africa API
- API key and endpoints are configured for demonstration purposes
- RFCode is set to "JNB" for Johannesburg region
- The application includes fallback mock data for demonstration when API is unavailable
- All prices are shown in South African Rand (ZAR)
- Input validation on both client and server side
- XSS prevention through HTML escaping
- SQL injection prevention (not applicable - no database)
- HTTPS recommended for production deployment
- API key should be kept secure and not committed to version control
This application was developed as a demonstration project for Fastway Couriers integration.
Last Updated: January 2026