ParcelPickUp API
Booking
Resource URL
UAT:
https://api.uat.nzpost.co.nz/parcelpickup/v3/bookings
Production:
https://api.nzpost.co.nz/parcelpickup/v3/bookings
Resource Description
Creates pick up event for requested Pace or CourierPost service.
Resource Information
Attribute | Detail |
---|---|
Response Format | JSON |
Requires Authentication | Yes |
Rate Limited | 15 calls per second across all merchants using the API. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out. |
Please note that all request parameters should be in lower case.
Request Parameters
Field Name | Description | Mand | Example |
---|---|---|---|
carrier | Indicates company providing the service, Valid values are COURIERPOST or PACE | Yes | COURIERPOST |
caller | Name of the caller | Yes | Jane Jones |
name | The sender contact name | No but highly recommended | Bill Smith |
Customer contact email address | No | bill@abc.xx.nz | |
phone | Customer contact phone | Yes | +64-27-111-1111 |
customer_reference | Free text field normally used for return authority or order number | No | OR12354 |
tracking_references | This is relevant for CourierPost only. Contains a JSON array of tracking reference numbers. Note that prepaid ticket numbers can be used. | No | 2289791234567801GDD001AS |
service_code | Please do not provide this for CourierPost. This is mandatory for PACE. Please refer to the section Sample Service Codes for PACE | Yes if Pace | 3HRA |
pickup_address | Details regarding the Pick up address | Yes | JSON object. See section Address Object Parameters |
delivery_address | Details regarding the Delivery Address | Yes if PACE | JSON object. See section Address Object Parameters |
is_booking_confirm_required | Indicates if a confirmation of the pick up booking is required | No | true |
is_delivery_confirm_required | Indicates if a confirmation of the delivery is required | No | true |
confirmation_email | Email address for confirmations | No | test@example.com |
Instructions | A customer note | No | Package is sitting on the counter at reception |
pickup_date_time | Indicates the requested time for pick up in ISO8601 format. Pickup Hours: 0700 - 1800 weekdays; 0800 - 1300 Saturdays. No pickup on Sundays and New Zealand public holidays. | Yes | 2018-03-02T10:00:00 |
parcel_quantity | Quantity of packages to be picked up | Yes if Pace. | 3 |
estimated_weight_kg | Estimated total weight of the package in kilograms | No | 3 |
is_label_required | Indicates whether the sender requires a label to be printed at the depot. Required True for CFF bookings. Defaults to false | No | false |
Address Object Parameters
The following lists the information that may be provided in pickup and delivery address for the ParcelPickUp request:
Field Name | Description | Mand | Example |
---|---|---|---|
name | Used to identify the name of the contact person at the pick up or delivery location | No | Jane Jones |
phone | Used to identify the phone number of the contact person at the pick up or delivery location | No | +64-27-111-1111 |
Used to identify the email address of the contact person at the pick up or delivery location | No | jane@abcd.xx.nz | |
company_name | Used to identify the Company Name for the pick up or delivery location | No | Acme Trading |
site_code | Indicates the Site Code for the pickup or the delivery address | Refer to Address Rules below | 79012 |
unit_type | Indicates the type of unit (if applicable) | No | Flat |
unit_value | Indicates the value of the unit type (ie the 2 in Flat 2) | Yes if Unit Type is not blank | 2 |
floor | Indicates the floor the address is on | No | Floor 5 |
building_name | Name of the building | No | Westing House |
street | Indicates the street address | No | 165 White Avenue |
suburb | Indicates the suburb | Refer to Address Rules below | Auckland City |
city | Indicates the name of the city | Refer to Address Rules below | Auckland |
postcode | Indicates the postcode the address resides in | Refer to Address Rules below | 0600 |
dpid | A numeric place identifier for the pickup address sourced from the ParcelAddress API | Refer to Address Rules below | 12345 |
address_id | Used to identify the address ID specifically within the ECL addressing database | Refer to Address Rules below | 839750 |
instructions | Used to identify any specific pick up or delivery instructions | No | Ring Sam on arriving |
Address Rules
One and only one of the following is required for a delivery address:
1. DPID or
2. Address_id or
3. Site_code or
4. Suburb and city and postcode
Please note that if more than one of the above options is provided, the request will be rejected.
Sample Service Codes for Pace
Service Code | Product Description |
---|---|
3HRA | 3 HOUR SERVICE AUCKLAND |
HDA | HOME DELIVERY AUCKLAND |
P30A | PACE 30 |
P60A | PACE 60 |
PBA | PACE BULLET |
PL1A | 1 HOUR PALLET SERVICE AUCKLAND |
PL2A | 2 HOUR PALLET SERVICE AUCKLAND |
PL3A | 3 HOUR PALLET SERVICE AUCKLAND |
Note: The above is not a comprehensive list of products and their service codes available for PACE. This is a sample only. Please talk to your NZ Post account manager to get a full list of PACE products and their service codes
Sample Requests
Please try these samples against UAT link only. Please contact your NZ Post account manager to get an account number (TPID) and a site code to test this. If this is tried in production there is a risk that this may trigger billing.
Sample Request - Pace Booking
{
"carrier": "PACE",
"caller": "Jane Jones",
"service_code": "3HRA",
"pickup_date_time": "2018-06-23T10:00:00",
"parcel_quantity": 2,
"pickup_address": {
"phone": "021 123 456",
"site_code": "28979",
"instructions": "Please dial 159 on the intercom when you arrive."
},
"delivery_address": {
"name": "Jane Jones",
"phone": "021 456 789",
"email": "janejones@example.com",
"company_name": "Cupcake company inc",
"unit_type": "Suite",
"unit_value": "4",
"floor": "G",
"building_name": "Test Delivery Building Name",
"street": "42C Tawa Drive",
"suburb": "Albany",
"city": "Auckland",
"postcode": "0632",
"instructions": "Entrance can be found down the side of the building to the door at the back"
}
}
Sample Request - CourierPost Booking
{
"carrier": "COURIERPOST",
"caller":"Jane Jones",
"pickup_date_time":"2018-06-23T10:00:00",
"parcel_quantity":2,
"pickup_address": {
"name": "John Smith",
"phone": "6490000000",
"email": "johnsmith@example.com",
"company_name": "John's mobile store",
"unit_type": "Unit",
"unit_value": "2",
"floor": "5",
"building_name": "Victoria Street Plaza",
"street": "151 Victoria Street West",
"suburb": "Auckland Central",
"city": "Auckland",
"postcode": "1010",
"instructions": "Please dial 159 on the intercom when you arrive."
}
}
Note:Tracking references can be empty
Response Message Fields
Field Name | Description | Mand | Example |
---|---|---|---|
success | Confirms whether the API call is successful or not, Returns true or false | Yes | true |
message_id | System generated as submitted in the request | Yes | ded71a90-0e36-11e5-aa3a-02b923c21ef3 |
results | Refer to Result Elements section below | Yes if success is true | JSON Object |
errors | Refer to Error Response Elements section below | Yes if success is false | JSON Object |
Result Elements
Field Name | Description | Mand | Example |
---|---|---|---|
response_type | Indicates the response type. A valid response may be given even if no data is returned. Valid Entries are: AP (Acceptance), RE (Rejection) | Yes | AP |
job_id | ECL system reference number | Yes | 5214568 |
job_number | Job booking number eg PACEnnnnnnnn | Yes if from Pace | 100036 |
customer_reference | Customer Reference ID as submitted in the request | Yes | OR12354 |
reject_code | Indicates the reject reason code | Yes, if Resp Type = RE | 1 |
tracking_references | CourierPost tracking reference. JSON Array | Yes for CourierPost | tracking_reference:abc_x113 |
Reject Reasons
Reject Code | Error Message |
---|---|
0 | Success - no message |
1 | Data Source must be INTEGRATED, IVR, ONLINE_PU, ONLINE_FF or ONLINE_SIM |
2 | Invalid Job ID |
3 | Invalid Job category |
4 | No pickup suburb supplied |
Error Response Elements
Field Name | Description | Mand | Example |
---|---|---|---|
success | Returns if request is successful | Yes | True |
errors | Error object with error details | Y if success =false | See Error Object Parameters below |
message_id | The unique message identifier | Yes | ec608f40-2a8b-11e5-a9c0-025c481d35ef |
Error Object Parameters
Field Name | Description | Example |
---|---|---|
code | Error code where first 3 digits are http status code, last three digits identify error type | 400002 |
message | Description of error code | Invalid Parameter(s) |
details | Description of specific error | Email address must be present for delivery confirmations |
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
Code | Message |
---|---|
200 | Success |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
409 | Invalid request |
500 | System unavailable |
Error Codes
Code | Message |
---|---|
200001 | Partial results returned, not all system(s) have responded |
200002 | All sources responded, data may be incomplete |
400001 | Parameter(s) missing |
400002 | Invalid parameter(s) |
400003 | Non mutually exclusive parameters detected |
401001 | Unauthorised access, please contact administrator |
500001 | General Exception |
500002 | System(s) offline |
Sample Response
{
"success": true,
"results": {
"response_type": "AP",
"message_id": "0c4a650c-9f4d-4628-98f1-db9bb3e33d03",
"job_id": "20155401",
"job_number": "100036",
"customer_reference": "TEST JOB DO NOT DESPATCH",
"reject_code": "0",
"tracking_references": [
{"tracking_reference": "8441112178053201AKL020AS"},
{"tracking_reference": "8441112178053202AKL020AS"}
]
}
}
Sample Error Response
{
"success": false,
"message_id": "ded71a90-0e36-11e5-aa3a-02b923c21ef3",
"errors": [ {
"code": "400002",
"message": "Invalid parameter(s)",
"details": "Email address must be present for delivery confirmations"
}]
}