- Guide: DHL shipment tracking
- Guide: Post AT shipment tracking
All four tags are permitted on all templates. The feature must be enabled in the shop, and the access credentials for each provider are in the
ShipTrack section of the shop configuration. Each entry there has an identifier that you use to address it in the template.Triggering the request
SHIPTRACK-Get() takes two arguments: the identifier of the configuration entry and the tracking number. Both may come from another tag.
If you pass a tag as an argument, replace its tilde characters with dollar signs, as in the example.
The shop system supports three providers: DHL, the Austrian Post and the Swiss Post connection. Which one is meant is defined in the configuration entry, not in the tag. In the template, nothing changes apart from the identifier in the first argument.
Was the request successful
SHIPTRACK-OK exists only as a bracketing. It applies if the last request ran without errors.
Tracing errors
SHIPTRACK-LastErrorCode outputs the code of the last request.
Codes 1, 4 and 5 indicate an incomplete configuration, not a problem with the shipment. A code of 1000 or above, on the other hand, comes from the provider itself, for example in the case of an unknown tracking number, a rejected login or a timeout.
In practice, you cannot reach codes 2 and 3 from a template. An empty argument already makes
SHIPTRACK-Get() fail as an invalid tag beforehand, so the request never takes place.Evaluating the response
SHIPTRACK-JSONResult returns the provider’s complete response as JSON. You pass it to the JSON interface and access the individual details there.
DHL responds in XML. The shop system converts the response to JSON before output. That explains the leading hyphens on the keys: they mark former XML attributes. The Austrian Post already delivers JSON, so these hyphens are absent there.
The field names within the response are defined by the provider, not by the shop system. They can change without anything changing in the shop. Therefore, catch missing fields with the check tags of the JSON interface instead of relying on their presence.
Tags at a glance
All four tags are permitted on all templates. The last three require a preceding
SHIPTRACK-Get().
Related topics
- Guide: DHL shipment tracking
- Guide: Post AT shipment tracking
- Reference: EJD- (JSON interface)
- Reference:
ShipTracksection in the shop configuration
