ParcelTrack API

(0 reviews)

Track Parcel(s)

###Resource URL
UAT:

https://api.uat.nzpost.co.nz/parceltrack/v4/parcels?tracking_reference=

Production:

https://api.nzpost.co.nz/parceltrack/v4/parcels?tracking_reference=


###Resource Description

Request to return tracking information for up to ten specific tracking references.


###Resource Information

AttributeDetail
Response FormatJSON
Requires AuthenticationYes
Rate Limited15 calls per second. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out.


###Request Message Fields

FieldDescriptionMandExample
tracking_referenceUnique tracking reference for a parcel (job number for Pace)YesJP100000271NZ or 123521


###Sample Request

https://api.nzpost.co.nz/parceltrack/v4/parcels?tracking_reference=EY593742046NZ&tracking_reference=FF138431175NZ&tracking_reference=FL010795711NZ&tracking_reference=FZ101183740NZ&tracking_reference=GC000875843NZ&tracking_reference=HA099246112NZ&tracking_reference=EY593742046NZ&tracking_reference=FF138431175NZ&tracking_reference=FL010795711NZ&tracking_reference=FZ101183740NZ


###Response Parameters

Field NameDescriptionMandExample
successReturns true if request is successful else false.YesTrue
message_idA unique ID for the API CallYesda5ac7f0-7c18-11e5-b508-0297700fe675
resultsAn JSON object containing the scan event details of all queried parcels. See Results Object Parameters.NoJSON Object


###Results Object Parameters

Field NameDescriptionMandExample
tracking_referenceThe queried tracking referenceYesJP100000271NZ
tracking_eventsAn JSON object containing all scan events of queried parcels. See Results - Tracking Events Object Parameter section.
This may be presented when the success flag is true. This may be absent if the parcel has no associated scan events at the time of the request or the success flag is false.
NJSON Object
errorsAn JSON object containing error details. See Results - Errors Object Parameter section.
This may be presented if the parcel has no associated scan events at the time of the request or the success flag is false.
NJSON Object


###Results - Tracking Events Object Parameters

Field NameDescriptionMandExample
date_timeDate and time the courier recorded the scan or event. This is the time you should display to your customersY2016-01-29 11:00:00Z
descriptionDetailed description of the eventYReady to send
edifact_codeEDIFACT code for the parcel delivery stepYes997
depot_nameName of the depot that relates to scanNAKL City Fleet
run_nameName of the run that relates to the scanNAuckland CBD
courier_first_nameFirst name of the courier performing the eventNJohn
courier_full_nameFull name of the courier performing the event. This field is only returned for the internal users.NJohn Smith
locationJSON object containing the location details of an event. See Tracking Events - Location Object Parameters section.NJSON Object
signed_byJSON object containing name of the signer and the string representation of binary signature data. See Tracking Events - Signed By Object Parameters section.Yes if the item was signature requiredJSON Object
seqrefCME sequence ref of the eventY if event derived from CME2631897613
sourceSource system where the event occurred. Valid systems are: CME, Navigator, IPS, ParcelStore, PSGNCME
statusBrief description of the eventYReady to send


###Tracking Events - Location Object Parameters
| Field Name| Description | Mand| Example |
|---------|-----------------------------------------------------------|--------|--------------------------|
|latitude|Latitude of the location of the scan|Y if longitude exists|-36.8485|
|longitude|Longitude of the location of the scan|Y if latitude exists|174.7633|


###Tracking Events - Signed By Object Parameters

Field NameDescriptionMandExample
nameFull name of the person providing the signature.Yes if signature requiredLee Child
signatureString representation of the binary data for the signature.Noec608f40-2a8b-11e5...


###Results - Errors Object Parameters
|Field Name|Description|Example|
|------------|--------------------------------------------------------------------------------------------------------------------------------------------|---------------------|
|code|Error code|400002|
|message|Error message|Invalid parameter(s)|
|details|Error details|No event for this ticket|


###HTTP Status Codes

Note that some error messages are customised for the request, i.e. error code 400 usually will describe what is wrong with the request

CodeMessage
200Success
400Bad request
401Unauthorized
403Forbidden
409Invalid request
500System unavailable


###Error Codes

CodeMessage
200001Partial results returned, not all system(s) have responded
200002All sources responded, data may be incomplete
400001Parameter(s) missing
400002Invalid parameter(s)
400003Non mutually exclusive parameters detected
401001Unauthorised access, please contact administrator
500001General Exception
500002System(s) offline


###Sample Response

Sample of all queried tracking references in a request are valid:


{
    "success" : true,
    "message_id" : "123456789",
    "results" : [{
            "tracking_reference" : "8441112178053201AKL020AS",
            "tracking_events" : [{
                    "date_time" : "2016-01-29 11:00:00Z",
                    "description" : "Ready to send",
                    "edifact_code" : "997",
                    "seqref" : "2834931351",
                    "source" : "CME",
                    "status" : "Ready to send"
                }, {
                    "date_time" : "2016-02-01 20:43:15Z",
                    "description" : "Picked up",
                    "edifact_code" : "13",
                    "depot_name" : "AKL City Fleet",
                    "run_name" : "Auckland CBD",
                    "courier_first_name" : "Jatinder",
                    "seqref" : "2835679952",
                    "source" : "CME",
                    "status" : "Picked up"
                }, {
                    "date_time" : "2016-02-01 23:04:27Z",
                    "description" : "Processing at depot",
                    "edifact_code" : "8",
                    "depot_name" : "AKL Central East Fleet",
                    "run_name" : "East Tamaki",
                    "courier_first_name" : "Sorter",
                    "seqref" : "2835835282",
                    "source" : "CME",
                    "status" : "Processing at depot"
                }, {
                    "date_time" : "2016-02-02 02:31:03Z",
                    "description" : "Waiting for courier",
                    "edifact_code" : "58",
                    "depot_name" : "AKL North Shore Fleet",
                    "run_name" : "Albany",
                    "courier_first_name" : "North Shore",
                    "seqref" : "2836045179",
                    "source" : "CME",
                    "status" : "Waiting for courier"
                }, {
                    "date_time" : "2016-02-02 23:44:37Z",
                    "description" : "Redirected",
                    "edifact_code" : "95",
                    "seqref" : "2837278756",
                    "source" : "CME",
                    "status" : "Redirected"
                }, {
                    "date_time" : "2016-02-03 17:37:39Z",
                    "description" : "With courier for delivery",
                    "edifact_code" : "32",
                    "depot_name" : "AKL North Shore Fleet",
                    "run_name" : "Glenfield",
                    "courier_first_name" : "Alexander",
                    "seqref" : "2838110846",
                    "source" : "CME",
                    "status" : "With courier for delivery"
                }, {
                    "date_time" : "2016-02-03 19:46:00Z",
                    "description" : "Ready to collect",
                    "edifact_code" : "144",
                    "depot_name" : "AKL North Shore Fleet",
                    "run_name" : "Glenfield",
                    "courier_first_name" : "Alexander",
                    "seqref" : "2838282165",
                    "source" : "CME",
                    "status" : "Ready to collect"
                }, {
                    "date_time" : "2016-02-03 20:16:27Z",
                    "description" : "Ready to collect",
                    "edifact_code" : "141",
                    "depot_name" : "PCD Ext - Countdown Scanners",
                    "run_name" : "Glenfield",
                    "courier_first_name" : "Glenfield Mall",
                    "seqref" : "2838320096",
                    "source" : "CME",
                    "status" : "Ready to collect"
                }, {
                    "date_time" : "2016-02-03 23:33:51Z",
                    "description" : "Delivered",
                    "edifact_code" : "22",
                    "depot_name" : "PCD Ext - Countdown Scanners",
                    "run_name" : "Glenfield",
                    "courier_first_name" : "Glenfield Mall",
                    "location" : {
                        "latitude" : -36.8485,
                        "longitude" : 174.7633
                    },
                    "signed_by" : {
                        "name" : "raezel villamena",
                        "signature" : "/yQwJCcnDyQUIRohHCAeICAiIiQhJyAqHywfLyMvJzAkMh8zGzUWNRQ1ETQPMQwvCyoLKAwkECETIBggGiEdIx8lICgiKiQtJjMoNy06MDozOjU5Nzc5NDoyOS03KzYpNCgyKC8oLSorKyctJDAgMx02GTgYOBo3ITckNyY2KDgqOig8Jj4hPx4/HD8aPRo7HDkfOSQ5JjkoOyk9KD8lQSJCH0MdQx9DIUQjRCVGJUgjSSFKH0wdTRtPHFAfUSJRJVIrUjBSNFE3UDpOOU42TTRML00qTyZQJFIiVCBWIFgjWCVZJ1kpWStbK1woXCZdI10hXiNeJV4nYSViI2MhYx5kHGQfZSJlJWUnaClrKW0mbyFvHnAbcBhwFm8TbRNsFWsYaxtrHmsgbCRsJ24ocClyKHQmdiR4H3kbexl8G3wdfSB/IoIjhCKFIIYehB2CHYAefiB9I30lfSd/J4IlgyKEH4QhhSSHJIgiix6MHIwejCCLI4sliyKLII4gjiOQI5Egkh2UHJYemCCaIZwgnh6fHJ8anxyeH54hoCKjIaUgpx2pG6oZqRyoHqcgpiKoIKoeqhysGq8YsRqyHLQeth64HLoavBe9Fb0TuxK5FLcWthi1G7Udtxy5GrsYwRTDEsURxw/LDc0M"
                    },
                    "seqref" : "2838545768",
                    "source" : "CME",
                    "status" : "Delivered"
                }
            ]
        }, {
            "tracking_reference" : "8441112178053201AKL666AS",
            "tracking_events" : [{
                    "date_time" : "2016-02-24 23:57:00Z",
                    "description" : "International arrival",
                    "edifact_code" : "6002",
                    "source" : "ParcelStore",
                    "status" : "International arrival"
                }, {
                    "date_time" : "2016-02-25 00:01:18Z",
                    "description" : "In Transit",
                    "edifact_code" : "6022",
                    "source" : "ParcelStore",
                    "status" : "In Transit"
                }
            ]
        }
    ]
}

Sample of some queried tracking references in a request are invalid:


{
  "success": true,
  "message_id": "123456789",
  "results": [
    {
      "tracking_reference": "8441112178053201AKL666AS",
      "errors": [
        {
          "code": "400002",
          "message": "Invalid parameter(s)",
          "details": "No events for this ticket"
        }
      ]
    },
    {
      "tracking_reference": "8441112178053201AKL020AS",
      "tracking_events": [
        {
          "date_time": "2016-03-01 19:00:00Z",
          "description": "Departure from New Zealand",
          "edifact_code": "5201",
          "depot_name": "Location not available",
          "source": "IPS",
          "status": "Departure from New Zealand"
        }
      ]
    }
  ]
}

Reviews