• Home
  • Contacts
  • On The Go
  • Track
  • Settings
  • Search

Status API - References

Returns an array of document references related with the requested document reference. It provides the current document status, when it was last updated, customer and system references, tracking url and any related documents.

Access

To access to Mainfreight APIs, you have to Register

Resource URI

Make an HTTP GET request to:

https://api.mainfreight.com/Status/1.0/References?serviceType={add service type}&reference={add reference}&referenceType={optional value, relates to service type}

Resource Information

TypeValue
Authentication API Key
Response Formats JSON / XML
HTTP Methods GET
API Version 1.0

HTTP Headers

You must add the following HTTP Headers to your request:

HeaderTypeDescription
Content-Type string Request content type. Supported types are "application/json" or "application/xml."
Authorization string

The word "Secret" followed by a space, then your unique Status API Key.

e.g: Secret wdnOId93-VXZECxvVRPQEJZNxPB5XZ...

RequestedBy string Please provide your application name.

Parameters

You must provide the following parameters:

ParameterTypeDescription
serviceType string

Service type used for the document. Supported values include:

  1. Transport
  2. TransportNZ
  3. TransportAU
  4. TransportUS
  5. TransportEU
  6. Logistics
  7. LogisticsAU
  8. LogisticsNZ
  9. LogisticsUS
  10. LogisticsEU
  11. Containers
  12. ContainersNZ
  13. ContainersAU
  14. AirAndOcean
reference string Tracking Reference to search for.

Optional Parameters

You may also provide the following parameters:

ParameterTypeDescription
referenceType string

Type of reference supplied in the request. Supported values include:

  1. ConsignmentNumber
  2. OutboundReference
  3. InboundReference
  4. ShipmentNumber
  5. Reference
  6. ContainerNumber
  7. CustomerReference

Response Parameters

ParameterTypeDescription
ourReference string System reference for the shipment.
yourReference string Tracking reference for the shipment.
serviceType string Service used for delivery.
trackingURL string URL to track the shipment.
relatedItems Array List of items related with the shipment (PODs, other documents, etc.)
type string Related item type.
value string Related item value.
events Array List of all the statuses the document has been through.
sequence int Order when this event happened.
eventDateTime dateTime Date when the event happened.
groupingLevel1Code string A high level term to describe the code (publicly available on the website).
groupingLevel2Code string A more detailed term to describe the code (publicly available on the website).
code string

Event status' system name. This is an immutable value.

A full list of response codes can be found here

displayName string Event status' description
location string Description field containing location or journey of the shipment.
isEstimate bool

Represents if the status is an estimated status or real status.

 

Code samples

JSON Example

To list all available anonymous notifications for a particular document you have to post a json similar to this (notice that no session secret is used):

  • URL
< > grab code
https://api.mainfreight.com/status/1.0/References?servicetype=Transport&reference=ABC900000999

You are going to get another JSON object similar to this:

  • JSON
< > grab code
[
    {
        "ourReference": "ABC900000999",
        "yourReference": "ABC900000999",
        "serviceType": "Transport",
        "trackingUrl": "https://www.mainfreight.com/track/NZ/ABC900000999",
        "relatedItems": [
			{
			"type": "ProofOfDelivery",
			"value": "http://docs.mainfreight.com/DownloadHandler.ashx?VnohipduDcbWKcxVrWONiZvHnT302oUO2GLn93Zp8GLYFL3u__eAUJtQIGewaOZfvaSKOO0SKOOKf-IcUectXgDj3xMNccwX6JbDcAm9Aptr_unKhRw2" 
			}
		],
        "signedBy": "",
        "events": [
            {
                "sequence": 0,
                "eventDateTime": "2015-12-07T11:23:00",
"groupingLevel1Code": "Delivered",
"groupingLevel2Code": "Delivered", "code": "Delivered", "displayName": "Delivered", "location": null, "isEstimate": false } ] } ]
XML Example

To list all available anonymous notifications for a particular document you have to post a XML similar to this (notice that no session secret is used):

  • XML
< > grab code
https://api.mainfreight.com/status/1.0/References?servicetype=Transport&reference=ABC900000999

You are going to get another XML document similar to this:

  • XML
< > grab code
	<references xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
		<reference>
			<ourReference>ABC900000999</ourReference>
			<yourReference>ABC900000999</yourReference>
			<serviceType>Transport</serviceType>
			<trackingUrl>https://www.mainfreight.com/track/NZ/ABC900000999</trackingUrl>
			<relatedItems>
				<relatedItem>
					<type>ProofOfDelivery</type>
				   <value>http://docs.mainfreight.com/DownloadHandler.ashx?VnohipduDcbWKcxVrWONiZvHnT302oUO2GLn93Zp8GLYFL3u__eAUJtQIGewaOZfvaSKOO0SKOOKf-IcUectXgDj3xMNccwX6JbDcAm9Aptr_unKhRw2</value>
				</relatedItem>
			</relatedItems>
			<signedBy />
			<events>
				<event>
					<sequence>0</sequence>
					<eventDateTime>2015-12-07T11:23:00</eventDateTime>
					<groupingLevel1Code>Delivered</groupingLevel1Code>
<groupingLevel2Code>Delivered</groupingLevel2Code>
<code>Delivered</code> <displayName>Delivered</displayName> <isEstimate>false</isEstimate> </event> </events> </reference> </references>
NOTE: Content in the panels below this point are not visible on the site unless used by other features e.g. gadgets, OB&E, etc.