This tutorial is to help you integrate your WooCommerce E-commerce platform with Detrack using Detrack Connect.
With this integration, all selected orders from your WooCommerce storefront will be sent to Detrack through Detrack Connect for last mile tracking and real-time proof of delivery. You can also choose to set up the integration for delivery completion status to be feedback to your WooCommerce storefront.
Here’s how you can get started with the WooCommerce integration.
First, sign up for a Detrack Connect account.
Steps
Sign up for a Detrack Connect account. If you already have a Detrack Connect account, continue with the next step.
Go to the Connections tab and add a connection.
Select WooCommerce as the Store/System.
Integration
Fill in the fields below, the red circled fields are mandatory. If you are doing this integration to pass orders to your 3PL's Detrack account, ask your 3PL for the Detrack Group Name assigned to you as well as for the API key that belongs to your group.
Next, go to your WooCommerce account to generate
WooCommerce Store URL
Consumer Key
Consumer Secret
In WooCommerce
(Optional).
Requires the Enable Update Shipment checkbox to be enabled.To get the Store URL, go to WooCommerce > Status > WordPress Address (URL). The WordPress Address is the Store URL.
To get the Consumer Key, go to WooCommerce > Settings (at the left side of the page).
Click Advanced > REST API > Add Key.
A Key details page will appear next where you need to enter the Description, then select Read/Write for the permissions field followed by the Generate the API key button. Note: if the Write permission is not granted, there will be a 422 error displayed in Detrack Connect when updating job information in your WooCommerce system.
Copy the Consumer Key and Consumer Secret.
In Detrack Connect
Paste the copied information into the Store section of your Detrack Connect.
Webhook
This webhook is for your storefront to send information to Detrack Connect.
Click Start by adding a webhook.
Provide a name for your webhook and click Save.
Next, you will see the generated Webhook URL which is the address for your storefront to send the information over via webhook.
Copy the URL and head over to your WooCommerce account.
In WooCommerce
In your WooCommerce, navigate to Settings > Advanced > Webhook > Add Webhook.
Perform the following:
Provide a Name for this webhook.
Set the Status to Active to activate the webhook.
Set the Topic to Order updated (recommended) or Order creation. Kindly note that the job will only be created in Detrack if the status is Processing.
Paste the copied webhook URL from into the Delivery URL.
Provide a Secret to this webhook (for use in Detrack Connect later). This Secret serves as a password for secure connection between your WooCommerce and Detrack Connect
In Detrack Connect
Click the Key Icon.
Complete the connection by inputting the Secret from WooCommerce.
Click Save when done and the key icon will turn green.
You can create a dummy order from your WooCommerce storefront to check the setup. If the setup is done correctly, an entry will be captured under Logs > Incoming Log according to your defined webhook trigger.
The connection setup has been created! Now you can configure the settings to filter the orders to be sent to Detrack, the shipping date and more right here.
Status Mapping
This section is regarding the mapping of the statuses between Detrack and WooCommerce.
Detrack | WooCommerce |
Info received | Processing |
Out for delivery | Processing |
Completed | Delivered |
Partially Completed | Processing |
On hold | On hold |
Failed | Failed |
For more information, refer to WooCommerce and Detrack status.
Order Status Update Exclusion
This section is to prevent Detrack from updating the information in your WooCommerce storefront when it has a certain status.
Scroll down to Order Update Exclusion section
Click on the dropdown to open up a list of statuses.
Click the status/es that you wish to exclude.
Click Save when done.
Default Field Mapping
Kindly note the following 3 required fields in Detrack for job creation:
date
address
do_number
Below are the default field mapping between Detrack and WooCommerce.
If you happen to be using other plugins, you make make use of the Mapping for custom mapping of data.
Detrack | WooComerce |
do_number | id |
date | date_modified |
start_date | date_modified |
job_received_date | date_modified |
payment_mode | payment_method_title |
payment_amount | total |
address_1 | address1 |
address_2 | address2 |
city | city |
state | state |
postal_code | postcode |
country | country |
last_name | last_name |
deliver_to_collect_from | first_name |
|
|
For more information, refer to WooCommerce Fields and Description and Detrack Job Fields and Description.
Plugin
This section is regarding the mapping of the fields between the various plugins and Detrack.
Plugin Name | Detrack | Fields |
Order Delivery Date for WooCommerce (Lite version) | date | Delivery Date |
Delivery & Pickup Date Time for WooCommerce | date | delivery_date |
job_time | delivery_time |
Mappings
This section is for use if you wish to retrieve certain field information from plugins to override the default fields mapping.
Most of the plugins will be adding the information in the note_attributes key in the request payload.
Create a dummy order from your storefront to Detrack Connect.
There will be an entry under Logs > Incoming from your storefront.
Edit the required Connection.
Click on the Mappings tab.
Click the Start by adding a mapping button.
For Plugin
For All Fields
Select All Fields for Mapping Fields; and a list of fields will appear according to the information sent over from your storefront.
Click on the required field to open a pop-up, e.g. the customer_note is being used to map over to the Instructions field in Detrack.
A pop-up will appear for the selection of the Detrack field for mapping the information.
Click Save when done.
Click Save when done.
If necessary, repeat the above to perform more mappings.
Detrack Field | Description |
Date | Date of delivery. The date that the delivery job will be performed by the courier. |
Address | The location of the job to perform the delivery. |
Address 1 | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
Address 2 | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
Address 3 | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
Postal Code | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
City | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
State | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
Country | The location of the job to perform the delivery. For use when the address is split up. Part of Line Address. |
Company Name | Recipient or Sender’s company name. |
Deliver To / Collect From | The name of Recipient. |
Last Name | The last name of Recipient. |
Phone No. | Recipient’s phone number. |
Notify Email | Email of recipient. |
Sender Phone No. | Sender’s phone number. |
Fax No. | Recipient’s fax number. |
Address Latitude | The latitude of the address. To be used with Address Longitude. |
Address Longitude | The longitude of the address. To be used with Address Latitude. |
Job Time | The time of delivery that the driver is supposed to be performed. |
Time Window | The time window for performing the job. |
Zone | An area having a particular characteristic, purpose, or use, or subject to particular restrictions. |
Instructions | Special information for your courier. |
Service Type | Service type of the job. |
Payment Mode | Mode of payment for the job. |