FleetConnector Documentation
Complete guide to installing, configuring, and using the WooCommerce to Onfleet integration plugin
Installation
1.1 System Requirements
Before installing the WooCommerce to Onfleet plugin, ensure your system meets these requirements:
- WordPress 5.8 or higher - The FleetConnector plugin requires modern WordPress features
- WooCommerce 5.0 or higher - Must be installed and activated before FleetConnector
- PHP 7.4 or higher - Required for modern PHP features and Onfleet SDK
- An active Onfleet account with API access - Get your API key from Onfleet dashboard
- HTTPS enabled (recommended) - Required for Onfleet webhooks to work properly
1.2 Installation Steps
Purchase and Download
Purchase the WooCommerce to Onfleet plugin from our website for €199/year. You'll receive a download link and license key via email.
Upload to WordPress
Navigate to Plugins → Add New → Upload Plugin in your WordPress admin.
Activate Plugin
After upload completes, click "Activate Plugin". The WooCommerce to Onfleet integration will automatically create necessary database tables for logging.
Activate License
Go to WooCommerce → FleetConnector → License section and enter your license key to activate the integration.
Configuration
Configure the WooCommerce to Onfleet connection and customize how orders are synchronized to delivery tasks.
2.1 Connect WooCommerce to Onfleet
Step 1: Get Your Onfleet API Key
- Log in to your Onfleet dashboard at onfleet.com/dashboard
- Navigate to Settings → API & Webhooks
- Click "Create New API Key"
- Give it a descriptive name (e.g., "WooCommerce Integration")
- Copy the generated API key immediately (you won't be able to see it again)
Step 2: Configure in WooCommerce
- In WordPress admin, go to WooCommerce → FleetConnector
- Find the "Onfleet API Settings" section
- Paste your Onfleet API key in the "Onfleet API Key" field
- Click "Test Connection" to verify (should show your organization name)
- Click "Load Teams" to fetch your available Onfleet teams
- Select a default team from the dropdown (optional but recommended)
- Click "Save Changes" at the bottom of the page
2.2 Automatic Task Creation
Enable Auto-Create
Check the "Automatically create Onfleet tasks" checkbox to enable automatic task creation when WooCommerce orders reach specific statuses.
Default: Enabled
When enabled, tasks are created automatically. When disabled, you must create tasks manually for each order.
Select Trigger Statuses
Choose which WooCommerce order statuses should trigger Onfleet task creation:
✓ Processing (Recommended)
Task created as soon as payment is confirmed. Best for immediate dispatch.
✓ Completed (Recommended)
Task created after order is fulfilled. Best for scheduled dispatch.
You can also select other statuses like On-Hold, Pending Payment, or any custom statuses you've created.
2.3 Synchronization Settings
Auto-Sync Updates
When enabled, any changes to a WooCommerce order automatically update the corresponding Onfleet task.
What gets synchronized:
- • Customer name and contact details
- • Delivery address
- • Order items and quantities
- • Customer notes
- • Delivery date and time window
Delete on Cancel
When enabled, cancelling a WooCommerce order automatically deletes the task in Onfleet.
2.4 Default Delivery Windows
Set your default delivery time window. These times are used when no specific delivery date is provided by a delivery date plugin.
Complete After (Start Time)
Earliest time a delivery can take place
Format: HH:MM (24-hour)
Complete Before (End Time)
Latest time a delivery can take place
Format: HH:MM (24-hour)
2.5 Delivery Date Plugin Integration
FleetConnector can automatically detect delivery dates from popular WooCommerce plugins and use them to set accurate delivery windows in Onfleet.
Supported Delivery Date Plugins
Auto-detect (Recommended)
Automatically detects delivery dates from all supported plugins
Order Delivery Date for WooCommerce
Popular delivery date picker plugin
Iconic WooCommerce Delivery Slots
Advanced delivery slot management
WooCommerce Delivery Slots
Simple delivery slot selection
Custom Field
Use your own custom delivery date field
Custom Field Configuration
If you use a custom delivery date field:
- Select "Custom field" from the Delivery Date Plugin dropdown
- Enter the meta key in the "Custom Date Field" input (e.g., _my_delivery_date)
- Save changes
Example meta keys: _delivery_date, delivery_date_field, custom_delivery_date
2.6 Webhook Settings
Webhook URL
Copy this URL to configure webhooks in your Onfleet dashboard:
You'll configure this in Chapter 4 (Webhooks).
Order Status Mappings
Configure what happens to WooCommerce orders when Onfleet tasks change status:
Task Completed Status
Select which order status to set when a delivery task is completed in Onfleet.
Common choice: Completed
Task Failed Status
Select which order status to set when a delivery task fails in Onfleet.
Common choice: Failed or leave empty to keep current status
Save Driver Information
When enabled, FleetConnector saves driver name and ID to the order when a task is assigned in Onfleet.
Features
FleetConnector provides multiple ways to create and manage Onfleet tasks from your WooCommerce orders.
3.1 Manual Task Creation
Even with automatic task creation enabled, you can manually create Onfleet tasks for individual orders.
From Order Actions Dropdown
- Go to WooCommerce → Orders
- Hover over an order in the list
- Click on "Create Onfleet Task" from the row actions
- The task will be created immediately and you'll see a success message
From Order Edit Screen
- Open any WooCommerce order
- Look for the "Onfleet Task Information" meta box on the right side
- Click the "Create Onfleet Task" button
- The task will be created and the meta box will update with task details
3.2 Bulk Task Creation
Create Onfleet tasks for multiple orders at once using WooCommerce bulk actions.
How to Use Bulk Actions
- Go to WooCommerce → Orders
- Check the boxes next to the orders you want to process
- Select "Create Onfleet Tasks" from the Bulk Actions dropdown at the top
- Click "Apply"
- Wait for the processing to complete - you'll see a success message with the count
What happens during bulk creation:
- • FleetConnector processes each order individually
- • Orders that already have tasks are skipped
- • Invalid orders (missing address, etc.) are skipped with a warning
- • All actions are logged in the FleetConnector Dashboard
3.3 Onfleet Task Information Meta Box
When editing any WooCommerce order, you'll see an "Onfleet Task Information" meta box that shows the current status of the task.
Information Displayed
- Task ID: Unique Onfleet task identifier
- Status: Current task status (Unassigned, Assigned, Active, Completed, Failed)
- Assigned Driver: Name of the driver assigned to this delivery (if assigned)
- Created: Date and time the task was created
- Onfleet Link: Direct link to view the task in Onfleet dashboard
Available Actions
Create Onfleet Task
Available if no task exists yet
Sync to Onfleet
Manually push order updates to Onfleet
View in Onfleet
Opens the task directly in your Onfleet dashboard
3.4 Onfleet Status Column
FleetConnector adds an "Onfleet Status" column to your WooCommerce orders list for quick visibility.
Status Indicators
Webhooks
Webhooks enable real-time synchronization from Onfleet to WooCommerce. When drivers update task status in Onfleet, your WooCommerce orders automatically update.
4.1 Webhook Setup
Step 1: Get Your Webhook URL
- In WordPress admin, go to WooCommerce → FleetConnector
- Scroll to the "Webhook Settings" section
- Copy the webhook URL displayed (it will look like https://yoursite.com/wp-json/fleetconnector/v1/webhook)
Step 2: Configure in Onfleet
- Log in to your Onfleet dashboard
- Go to Settings → API & Webhooks
- Click "Add Webhook"
- Paste your webhook URL in the URL field
- Select which events you want to receive (see section 4.2)
- Click "Create Webhook"
- Onfleet will test the connection automatically
Step 3: Verify Configuration
Test your webhook by:
- Creating a test order in WooCommerce
- Creating an Onfleet task for that order
- Completing the task in Onfleet (or changing its status)
- Checking that the WooCommerce order status updates automatically
- Verifying the event appears in the FleetConnector Dashboard logs
4.2 Supported Webhook Events
FleetConnector supports 7 Onfleet webhook events. Each event triggers specific actions in WooCommerce:
1 Task Completed
When triggered: Driver marks a delivery task as completed in Onfleet.
What happens:
- WooCommerce order status updates to your configured "Completed" status
- Completion time and driver information are saved to order meta
- Event is logged in FleetConnector Dashboard
2 Task Failed
When triggered: Driver marks a delivery as failed or task is cancelled in Onfleet.
What happens:
- WooCommerce order status updates to your configured "Failed" status (if set)
- Failure reason is saved to order notes
- Event is logged in FleetConnector Dashboard
3 Task Started
When triggered: Driver starts working on a delivery (en route or at location).
What happens:
- Order note is added with start time
- Task status is updated to "Active"
- Event is logged in FleetConnector Dashboard
4 Task Assigned
When triggered: A task is assigned to a driver in Onfleet.
What happens:
- Driver name and ID are saved to order meta (if "Save driver info" is enabled)
- Order note is added with driver name
- Event is logged in FleetConnector Dashboard
5 Task Unassigned
When triggered: A task is removed from a driver's route in Onfleet.
What happens:
- Driver information is removed from order meta
- Order note is added indicating unassignment
- Event is logged in FleetConnector Dashboard
6 Task Deleted
When triggered: A task is permanently deleted from Onfleet.
What happens:
- Task ID is removed from order meta
- Order note is added indicating deletion
- Event is logged in FleetConnector Dashboard
7 Task Updated
When triggered: Any task details are modified in Onfleet.
What happens:
- Task metadata is refreshed in WooCommerce
- Event is logged in FleetConnector Dashboard
4.3 Example Order Status Flow
Here's a typical order lifecycle showing how webhooks update WooCommerce:
Order Created
WooCommerce: Processing → Onfleet task created automatically
Task Assigned (Webhook)
Driver info saved → Order note added: "Assigned to John Smith"
Task Started (Webhook)
Order note added: "Delivery started at 2:30 PM"
Task Completed (Webhook)
WooCommerce: Processing → Completed → Customer receives completion email
Dashboard
The FleetConnector Dashboard provides complete visibility into all WooCommerce to Onfleet synchronization activity.
5.1 Accessing the Dashboard
Access the dashboard by navigating to:
The dashboard is also accessible from the WordPress admin sidebar under "FleetConnector".
5.2 Statistics Overview
At the top of the dashboard, you'll see four key statistics cards:
Total Synced Tasks
1,234
Total number of tasks successfully created in Onfleet
Failed Tasks
23
Tasks that failed to sync due to errors
Webhooks Received
5,678
Total webhook events received from Onfleet
Last 24 Hours
89
Tasks synced in the last 24 hours
5.3 Activity Log
The activity log shows a detailed record of all synchronization events between WooCommerce and Onfleet.
Log Columns
- Date/Time: When the event occurred
- Order ID: WooCommerce order number (clickable link to order)
- Action: What happened (Task Created, Task Updated, Webhook Received, etc.)
- Status: Success or Error indicator
- Message: Detailed information about the event
- Details: View full technical details and API responses
Filtering and Search
Use the filters at the top of the log to find specific events:
Search by Order ID
Enter an order number to see all events for that order
Filter by Status
Show only successful events or only errors
Filter by Date Range
View events from a specific time period
Filter by Action Type
Show only specific actions (e.g., webhooks, task creation)
5.4 Export to CSV
Export your activity log to CSV format for analysis, reporting, or record-keeping.
How to Export
- Apply any filters you want (date range, status, etc.)
- Click the "Export to CSV" button at the top of the dashboard
- The filtered results will download as a CSV file
- Open in Excel, Google Sheets, or any spreadsheet application
CSV includes:
- • Timestamp of each event
- • Order ID and customer information
- • Action type and status
- • Detailed message and error information
- • Onfleet task ID (if applicable)
5.5 Retry Failed Tasks
If tasks fail to sync due to temporary issues (API downtime, network errors, etc.), you can retry them directly from the dashboard.
How to Retry
- Filter the log to show only "Error" status events
- Find the failed task you want to retry
- Click "View Details" to see the error message
- If the issue is resolved (e.g., API is back online), click "Retry"
- The system will attempt to create the task again
5.6 Viewing Log Details
Click "View Details" on any log entry to see complete technical information.
Details Include
- Full Error Message: Complete error text from Onfleet API
- Request Payload: Exact data sent to Onfleet
- Response Data: Complete API response from Onfleet
- Order Information: Customer name, address, phone number
- Task Configuration: Team, delivery window, notes sent
- Webhook Data: Raw webhook payload (for webhook events)
Technical Details
Understanding how FleetConnector works behind the scenes helps you troubleshoot issues and customize the integration.
6.1 How the Integration Works
FleetConnector bridges WooCommerce and Onfleet using a combination of WordPress hooks and Onfleet API calls.
WooCommerce → Onfleet Flow
Order reaches a trigger status (e.g., Processing)
FleetConnector hooks into woocommerce_order_status_changed
Order data is validated (address, phone number, etc.)
Delivery date is detected from configured plugin or custom field
Task data is formatted according to Onfleet API requirements
API request is sent to POST /api/v2/tasks
Task ID is saved to order meta _onfleet_task_id
Event is logged in FleetConnector database table
Onfleet → WooCommerce Flow (Webhooks)
Event occurs in Onfleet (task completed, assigned, etc.)
Onfleet sends POST request to webhook URL
FleetConnector REST endpoint receives and validates webhook
Task ID is extracted from webhook payload
Matching WooCommerce order is found via task ID meta
Order status is updated based on your configuration
Driver info and task metadata are saved to order
Webhook event is logged in dashboard
6.2 Data Sent to Onfleet
When creating a task, FleetConnector sends the following data to Onfleet:
Recipient Information
- Name: Billing or shipping name from order
- Phone: Billing phone (automatically formatted, see 6.3)
- Notes: Customer order notes, if provided
Destination
- Address: Full shipping address (street, city, state, zip, country)
- Unparsed: Sent as unparsed address for Onfleet's geocoding
- Notes: Apartment number or delivery instructions
Task Details
- Complete After: Start of delivery window (from settings or delivery date plugin)
- Complete Before: End of delivery window (from settings or delivery date plugin)
- Notes: Order items, quantities, and totals formatted as list
- Metadata: Order ID, order number, order total
- Auto Assign: Team ID from settings (if configured)
Example Order Items Format
Order #1234 - €49.99 Items: • Product Name x 2 - €29.99 • Another Product x 1 - €19.99 Customer Note: Please ring doorbell twice
fleetconnector_task_data filter hook.
6.3 Phone Number Formatting
Onfleet requires phone numbers in international E.164 format. FleetConnector automatically formats phone numbers for you.
Automatic Formatting
Default Country Code
FleetConnector assumes Netherlands (+31) as the default country code. If phone numbers don't start with + or 00, it adds +31.
6.4 Delivery Date Detection
FleetConnector intelligently detects delivery dates from various plugins and falls back to sensible defaults.
Detection Priority
- Selected Delivery Date Plugin: Checks the plugin you configured in settings
- Auto-detect Mode: If "Auto" is selected, checks all supported plugins in order
- Custom Field: If "Custom field" is selected, checks your specified meta key
- Fallback: If no date found, uses tomorrow at your configured time window
How Time Windows Work
FleetConnector combines the detected date with your configured time window:
Example:
- Delivery date plugin says: December 25, 2024
- Your time window: 09:00 - 18:00
- Result sent to Onfleet: Dec 25, 2024 09:00 - Dec 25, 2024 18:00
6.5 Developer Hooks and Filters
Developers can customize FleetConnector behavior using WordPress hooks and filters.
Available Filters
fleetconnector_task_data
Modify task data before sending to Onfleet
add_filter('fleetconnector_task_data', function($task_data, $order_id) {
// Add custom metadata
$task_data['metadata'][] = [
'name' => 'custom_field',
'value' => get_post_meta($order_id, '_my_custom_field', true)
];
return $task_data;
}, 10, 2);
fleetconnector_delivery_date
Override delivery date detection
add_filter('fleetconnector_delivery_date', function($date, $order_id) {
// Use custom logic for delivery date
return '2024-12-25';
}, 10, 2);
fleetconnector_phone_number
Customize phone number formatting
add_filter('fleetconnector_phone_number', function($phone, $order_id) {
// Custom phone formatting logic
return '+1' . preg_replace('/[^0-9]/', '', $phone);
}, 10, 2);
fleetconnector_should_create_task
Conditionally prevent task creation
add_filter('fleetconnector_should_create_task', function($should_create, $order_id) {
// Don't create tasks for wholesale customers
$order = wc_get_order($order_id);
if ($order->get_meta('_customer_type') === 'wholesale') {
return false;
}
return $should_create;
}, 10, 2);
Available Actions
fleetconnector_task_created
Runs after task is successfully created
add_action('fleetconnector_task_created', function($task_id, $order_id, $task_data) {
// Send custom notification, log to external system, etc.
}, 10, 3);
fleetconnector_webhook_received
Runs when webhook is received from Onfleet
add_action('fleetconnector_webhook_received', function($event_type, $task_data, $order_id) {
// Custom webhook processing
}, 10, 3);
fleetconnector_task_failed
Runs when task creation fails
add_action('fleetconnector_task_failed', function($order_id, $error_message) {
// Send alert, create support ticket, etc.
}, 10, 2);
6.6 Database Structure
FleetConnector creates a custom database table to store synchronization logs.
Table: wp_fleetconnector_logs
| Column | Type | Description |
|---|---|---|
| id | BIGINT | Primary key |
| order_id | BIGINT | WooCommerce order ID |
| action | VARCHAR(50) | Action type (task_created, webhook_received, etc.) |
| status | VARCHAR(20) | success or error |
| message | TEXT | Human-readable message |
| details | LONGTEXT | JSON-encoded detailed data |
| created_at | DATETIME | Timestamp |
Troubleshooting
Common issues and their solutions when using the WooCommerce to Onfleet integration.
7.1 Common Issues
Tasks Not Creating Automatically
Symptoms: Orders reach trigger status but no Onfleet task is created
Solutions:
- Verify "Automatically create Onfleet tasks" is checked in settings
- Check that the order status matches your configured trigger statuses
- Ensure your Onfleet API key is valid (test connection in settings)
- Check FleetConnector Dashboard for error messages
- Verify order has valid shipping address and phone number
Invalid Phone Number Error
Symptoms: Task creation fails with "Invalid phone number" error
Solutions:
- Check the order's billing phone field is not empty
- Ensure phone number contains at least 9 digits
- For international orders, phone must include country code
- Remove any letters or invalid characters from phone number
- Use the
fleetconnector_phone_numberfilter to customize formatting
Webhooks Not Updating Orders
Symptoms: Task status changes in Onfleet but WooCommerce order doesn't update
Solutions:
- Verify your site uses HTTPS (required for webhooks)
- Check webhook is configured correctly in Onfleet dashboard
- Test webhook URL is reachable from external services
- Check FleetConnector Dashboard for incoming webhook logs
- Verify permalink settings in WordPress (Settings → Permalinks → Save)
- Check for server firewall blocking incoming POST requests
Wrong Delivery Date
Symptoms: Tasks created with incorrect or tomorrow's date instead of selected date
Solutions:
- Verify correct delivery date plugin is selected in settings
- Try "Auto-detect" mode to automatically find delivery dates
- If using custom field, verify the meta key is correct
- Check delivery date plugin is saving data correctly to order meta
- View log details in dashboard to see what date was detected
Address Geocoding Failures
Symptoms: Task creation fails with "Could not geocode address" error
Solutions:
- Check shipping address is complete (street, city, postal code, country)
- Verify address format is valid and recognized by Google Maps
- Avoid using P.O. boxes (Onfleet requires physical delivery addresses)
- Test the address manually in Google Maps
- Check for typos or special characters in address fields
Duplicate Tasks Created
Symptoms: Same order creates multiple tasks in Onfleet
Solutions:
- FleetConnector prevents duplicates automatically - check if multiple trigger statuses overlap
- Verify you're not manually creating tasks AND using auto-create for same orders
- Check for third-party plugins that might be changing order status multiple times
- Review FleetConnector Dashboard logs to see when tasks were created
7.2 Enable Debug Mode
Debug mode provides detailed logging for troubleshooting integration issues.
How to Enable
- Go to WooCommerce → FleetConnector → Settings
- Scroll to the "Advanced Settings" section
- Check "Enable Debug Mode"
- Click "Save Changes"
What Debug Mode Does
- • Logs all API requests and responses to Onfleet
- • Records detailed webhook payloads
- • Saves full order data being sent to Onfleet
- • Tracks phone number formatting process
- • Logs delivery date detection steps
- • All debug logs appear in FleetConnector Dashboard with full details
7.3 Getting Support
If you can't resolve an issue using this documentation, we're here to help.
Before Contacting Support
Please gather the following information:
- WordPress version and WooCommerce version
- PHP version (visible in WooCommerce → Status)
- FleetConnector plugin version
- Screenshot of error message or unexpected behavior
- Relevant log entries from FleetConnector Dashboard
- Order ID of affected order (if applicable)
How to Contact Us
Email Support
Send an email to support@fleetconnector.app
Response time: Within 24 hours on business days
Premium Support Included
Your FleetConnector license includes priority email support and updates for one year. We're committed to helping you succeed with the WooCommerce to Onfleet integration.
7.4 Additional Resources
Onfleet API Documentation
docs.onfleet.com - Official Onfleet API reference
WooCommerce Documentation
woocommerce.com/documentation - WooCommerce guides and tutorials