$wsShipTrack module, you can access shipment tracking and delivery checks. You can use this for example for tracking displays or zip code validation for delivery.
Module overview
Example / excerpt of$wsShipTrack
ƒ() denotes a function.
Methods overview
| Method | Return type | Description |
|---|---|---|
getTracking() | map | Returns tracking information from a shipping service provider for specific shipments. |
zipCodeConfirmed() | bool | Returns whether the zip code for a specific order has already been confirmed. |
Templates
Shipment tracking and zip code checks are typically used in the following places:- Order confirmation: tracking link after dispatch of the order.
- Customer account: overview of shipment tracking for past orders.
- Checkout: zip code validation for delivery options.
Variables
No variables are available for$wsShipTrack.
Methods
$wsShipTrack.getTracking()
Loads tracking information from a shipping service provider for a specific tracking number. The returned data depends directly on the respective provider, so when integrating, refer to the corresponding interface of the provider (e.g. DHL API). Signature$wsShipTrack.getTracking(id, trackingId)
Return valuemap - A map with the result of the tracking request.
Example of the structure returned on success:
data is delivered directly by the provider (e.g. DHL) and therefore depends on the respective interface.
If no tracking information could be loaded, data is not present and lastErrorText and lastErrorCode contain the error details from the provider.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the shipping service provider (e.g. dhl). Configured under checkout.shipTrack. |
trackingId | string | yes | Tracking number of the shipping service provider (e.g. the DHL tracking number). |
$wsShipTrack.zipCodeConfirmed()
Returns whether the zip code for a specific order has already been confirmed. This check is used before displaying shipment tracking to ensure that the user is indeed the original customer. Signature$wsShipTrack.zipCodeConfirmed(orderId)
Return valuebool - true if the zip code for the specified order has already been confirmed, otherwise false.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
orderId | string | yes | ID of the order for which the zip code confirmation is to be checked. |
