ParcelTrack API

(0 reviews)

Partial Match

###Resource URL
UAT:

https://api.uat.nzpost.co.nz/parceltrack/v4/partialmatch/{partial_reference}

Production:

https://api.nzpost.co.nz/parceltrack/v4/partialmatch/{partial_reference}


###Resource Description

Request to return related tracking references for a given partial reference.


###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
status_codecode to identify is there any errors as part of response results(1-all success 2-all fails 3-mixed)yes1
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 NameDescriptionMandExample
latitudeLatitude of the location of the scanY if longitude exists-36.8485
longitudeLongitude of the location of the scanY if latitude exists174.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 NameDescriptionExample
codeError code400002
messageError messageInvalid parameter(s)
detailsError detailsNo 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 queried partial tracking reference in a request are valid:



{
  "message_id": "f0d59c57-ef4f-49db-aa59-129c2f1e2a12",
  "success": true,
  "status_code":1,
  "results": [
    {
      "tracking_reference": "3616060010051511AKL005AS",
      "tracking_events": [
        {
          "date_time": "2015-03-23T17:04:08Z",
          "status": "Ready for pickup",
          "description": "CourierPost were advised that your item is ready to be picked up.",
          "source": "CME",
          "seqref": "2631897613",
          "edifact_code": "13",
          "depot_name": "Auckland Central Fleet",
          "run_name": "Auckland CBD",
          "courier_first_name": "Joe",
          "courier_full_name": "Joe Bloggs",
          "location": {
            "latitude": -36.9406304,
            "longitude": 174.8775616
          },
          "signed_by": {
            "name": "Lee Child",
            "signature": "/3Ie/zFJMkYyRDNBMz8zPTQ7NDg0NjkXORk6HDoeOyI7JDsmPCg8Kj0tPS89Mj40PjY/OT87QD1AP0FDQkZDSERKOkM4QjVBMD8wPTE7Mzk1Nzc0OTM6MTwwPS5AK0EpRCVGIkcgSB5JHEoZShdLFUsTSxFJE0gVSBhIG0geSCJJJUkoSSpKLEouSzFLM0w1TDdRRVJHU0pVSFVGVkRXQlhAWT5bPF05XzdgNWEzYzBkLWYrZilmJmUkYyNhJWAnXypfLF8uYDFhM2I2YzhmOmg7ajxtPG87cTtzOnY4dzZ5NHkxei96LXoreil6J3olfCd/KYEqgyyFLYcuiS+LMI0xjzKSM5QzlTCVLpUslSqVKJUmlSOVIZUflR2UH5MhkiORJZAnjyqOLI0uizGLM4k2iTiIO4c9hj8="
          }
        }
      ]
    },
    {
      "tracking_reference": "3616060010051512AKL005AS",
      "tracking_events": [
        {
          "date_time": "2015-03-23T17:04:08Z",
          "status": "Ready for pickup",
          "description": "CourierPost were advised that your item is ready to be picked up.",
          "source": "CME",
          "seqref": "2631897613",
          "edifact_code": "13",
          "depot_name": "Auckland Central Fleet",
          "run_name": "Auckland CBD",
          "courier_first_name": "Joe",
          "courier_full_name": "Joe Bloggs",
          "location": {
            "latitude": -36.9406304,
            "longitude": 174.8775616
          },
          "signed_by": {
            "name": "Lee Child",
            "signature": "/3Ie/zFJMkYyRDNBMz8zPTQ7NDg0NjkXORk6HDoeOyI7JDsmPCg8Kj0tPS89Mj40PjY/OT87QD1AP0FDQkZDSERKOkM4QjVBMD8wPTE7Mzk1Nzc0OTM6MTwwPS5AK0EpRCVGIkcgSB5JHEoZShdLFUsTSxFJE0gVSBhIG0geSCJJJUkoSSpKLEouSzFLM0w1TDdRRVJHU0pVSFVGVkRXQlhAWT5bPF05XzdgNWEzYzBkLWYrZilmJmUkYyNhJWAnXypfLF8uYDFhM2I2YzhmOmg7ajxtPG87cTtzOnY4dzZ5NHkxei96LXoreil6J3olfCd/KYEqgyyFLYcuiS+LMI0xjzKSM5QzlTCVLpUslSqVKJUmlSOVIZUflR2UH5MhkiORJZAnjyqOLI0uizGLM4k2iTiIO4c9hj8="
          }
        }
      ]
    },
        {
      "tracking_reference": "3616060010051513AKL005AS",
      "tracking_events": [
        {
          "date_time": "2015-03-23T17:04:08Z",
          "status": "Ready for pickup",
          "description": "CourierPost were advised that your item is ready to be picked up.",
          "source": "CME",
          "seqref": "2631897613",
          "edifact_code": "13",
          "depot_name": "Auckland Central Fleet",
          "run_name": "Auckland CBD",
          "courier_first_name": "Joe",
          "courier_full_name": "Joe Bloggs",
          "location": {
            "latitude": -36.9406304,
            "longitude": 174.8775616
          },
          "signed_by": {
            "name": "Lee Child",
            "signature": "/3Ie/zFJMkYyRDNBMz8zPTQ7NDg0NjkXORk6HDoeOyI7JDsmPCg8Kj0tPS89Mj40PjY/OT87QD1AP0FDQkZDSERKOkM4QjVBMD8wPTE7Mzk1Nzc0OTM6MTwwPS5AK0EpRCVGIkcgSB5JHEoZShdLFUsTSxFJE0gVSBhIG0geSCJJJUkoSSpKLEouSzFLM0w1TDdRRVJHU0pVSFVGVkRXQlhAWT5bPF05XzdgNWEzYzBkLWYrZilmJmUkYyNhJWAnXypfLF8uYDFhM2I2YzhmOmg7ajxtPG87cTtzOnY4dzZ5NHkxei96LXoreil6J3olfCd/KYEqgyyFLYcuiS+LMI0xjzKSM5QzlTCVLpUslSqVKJUmlSOVIZUflR2UH5MhkiORJZAnjyqOLI0uizGLM4k2iTiIO4c9hj8="
          }
        }
      ]
    }
  ]
}

Sample of queried tracking reference in a request are valid:



{
   "message_id":"f0d59c57-ef4f-49db-aa59-129c2f1e2a12",
   "success":true,
   "status_code": 1,
   "results":[
      {
         "tracking_reference":"CL092594238NZ",
         "tracking_events":[
            {
               "date_time":"2015-03-23T17:04:08Z",
               "status":"Ready for pickup",
               "description":"CourierPost were advised that your item is ready to be picked up.",
               "source":"CME",
               "seqref":"2631897613",
               "edifact_code":"13",
               "depot_name":"Auckland Central Fleet",
               "run_name":"Auckland CBD",
               "courier_first_name":"Joe",
               "courier_full_name":"Joe Bloggs",
               "location":{
                  "latitude":-36.9406304,
                  "longitude":174.8775616
               },
               "signed_by":{
                  "name":"Lee Child",
                  "signature":"/3Ie/zFJMkYyRDNBMz8zPTQ7NDg0NjkXORk6HDoeOyI7JDsmPCg8Kj0tPS89Mj40PjY/OT87QD1AP0FDQkZDSERKOkM4QjVBMD8wPTE7Mzk1Nzc0OTM6MTwwPS5AK0EpRCVGIkcgSB5JHEoZShdLFUsTSxFJE0gVSBhIG0geSCJJJUkoSSpKLEouSzFLM0w1TDdRRVJHU0pVSFVGVkRXQlhAWT5bPF05XzdgNWEzYzBkLWYrZilmJmUkYyNhJWAnXypfLF8uYDFhM2I2YzhmOmg7ajxtPG87cTtzOnY4dzZ5NHkxei96LXoreil6J3olfCd/KYEqgyyFLYcuiS+LMI0xjzKSM5QzlTCVLpUslSqVKJUmlSOVIZUflR2UH5MhkiORJZAnjyqOLI0uizGLM4k2iTiIO4c9hj8="
               }
            }
         ]
      }
   ]
}

Sample of queried partial tracking reference in a request are invalid:



{
  "success": true,
  "message_id": "123456789",
  "status_code":2
  "results": [
    {
      "tracking_reference": "84411121780532",
      "errors": [
        {
          "code": "400002",
          "message": "Invalid parameter(s)",
          "details": "No events for this ticket"
        }
      ]
    }]}


Reviews