Skip to main content
With the $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
JSON output
Note: ƒ() denotes a function. Methods overview

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.

Actions

Actions for this module that trigger changes are documented separately in the “Actions” chapter (ShipTrack).

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 value
map - A map with the result of the tracking request.
Example of the structure returned on success:
The value under 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 Example that attempts to load tracking information.

$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 value
bool - true if the zip code for the specified order has already been confirmed, otherwise false.
Parameters Example that checks whether the zip code has been confirmed.

Examples

Shipment tracking with zip code check

This example first checks whether the zip code has been confirmed and then displays a corresponding message if tracking data is available.