ShippingOptions API
Domestic
Resource URL
UAT:
https://api.uat.nzpost.co.nz/shippingoptions/2.0/domestic
Production:
https://api.nzpost.co.nz/shippingoptions/2.0/domestic
Resource Description
The domestic method is used to retrieve a list of valid shipping options available from a pickup address to a delivery address within New Zealand.
Resource Information
Attribute | Detail |
---|---|
Response Format | JSON |
Requires Authentication | Yes |
Rate Limited | 15 calls per second. 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 | Field Name | Description | Mand | Example |
---|---|---|---|---|
weight | Weight | The physical weight in kilograms of the item being sent. Note: If the carrier is CourierPost, the volumetric weight is calculated from the dimensions of the parcel. The rated weight is the greater of the physical weight provided as a request parameter and the calculated volumetric weight. A large parcel of low weight will have a higher rated weight to account for the amount of space it takes in the delivery vehicle. The rated weight will determine the charges for shipping the parcel. | Yes | 1.2 |
envelope_size | Envelope size | If fitting into a Trackpak Envelope indicate TrackPak size or ALL to return shipping options for all envelope sizes. See section "Envelope Sizes" for valid values. | No | A4 |
length | Length | The length (cm) of the parcel being sent | Yes | 15 |
diameter | Diameter | The diameter (cm) of the parcel being sent | Y if parcel is tube | 3 |
width | Width | The width (cm) of the parcel being sent. | Y if parcel is not a tube | 7 |
height | Height | The height (cm) of the parcel being sent | Y if parcel is not a tube | 2 |
pickup_address_id | Pickup Address Id | A validated address ID used to identify an individual address | No | 839750 |
pickup_site_code | Pickup Address Site Code | A validated site code used to identify an address where a courier is scheduled for regular pickups | No | 79012 |
pickup_suburb | Pickup Address Suburb | Suburb of the pickup address | No | Parnell |
pickup_city | Pickup Address Town | Town of the pickup address | No | Auckland |
pickup_postcode | Pickup Address Post Code | Post Code specific to pick up address | No | 1052 |
pickup_dpid | Pickup Address DPID | A validated DPID used to identify an individual address | N if Pickup AID, Site code or Suburb+Town+Postcode are used | 914092 |
delivery_address_id | Delivery Address ID | A validated address ID used to identify an individual address | No | 839750 |
delivery_site_code | Delivery Address Site Code | A validated site code used to identify an address where a courier is scheduled for regular pickups | No | 68521 |
delivery_suburb | Delivery Address Suburb | Suburb of the delivery address | No | Glenfield |
delivery_city | Delivery Address Town | Town of the delivery address | No | Auckland |
delivery_postcode | Delivery Address Post Code | Post code specific to delivery address | No | 0629 |
delivery_dpid | Delivery Address DPID | A validated DPID used to identify an individual address | No if Delivery AID, Site code or Suburb+Town+Postcode are used | 839750 |
account_number | account number | Your NZ Post Billing Account number (9 or 5 series).This is highly recommended to pass in the API call to obtain your account rates | No | 12345678 |
Envelope Sizes
Envelope Size Code | Envelope Size Name | Description |
---|---|---|
A4 | A4 | A4 Trackpak |
A4B | A4B | A4 Bubble Trackpak |
A5 | A5 | A5 Trackpak |
A5B | A5B | A5 Bubble Trackpak |
DL | DL | DLE Trackpak |
FS | FS | FoolScap Trackpak |
LF | LF | LineFlow Trackpak |
CDL | CDL | Eco DLE Trackpak |
CA5 | CA5 | Eco A5 Trackpak |
CFS | CFS | Eco Foolscap Trackpak |
XL | XL | Xtra Large Trackpak |
Sample Request
https://api.nzpost.co.nz/shippingoptions/2.0/domestic?weight=10&length=10&width=10&height=10&pickup_address_id=990003&delivery_dpid=2727895
Business Rules
The following business rules are applied on each /domestic request:
BR001 Valid combinations of envelope size and dimensions are as follows:
Envelope size with length, width and height or
Envelope size with length and diameter or
Length, width and height or
Length and diameter
BR002 Address information must include one and only one of the following options:
- Address_id or
- DPID or
- Site_code or
- Suburb, city and postcode
BR003 Paces services are available for Auckland, Palmerston North, Napier/Hastings, Wellington, Christchurch, and Dunedin. If Pace services are not available for the addresses offered in the API request no Pace options will be returned.
For further information about Pace service please click on this link: http://www.pace.co.nz/services.
Response Parameters
Field Name | Description | Mand | Example |
---|---|---|---|
success | Returns if request is successful | Yes | True |
services | Details regarding the services applicable to the input parameters | Y | See Services Details section for response details |
rated_weight | If the carrier is CourierPost, the volumetric weight is calculated from the dimensions of the parcel. The rated weight is the greater of the physical weight provided as a request parameter and the calculated volumetric weight. A large parcel of low weight will have a higher rated weight to account for the amount of space it takes in the delivery vehicle. The rated weight will determine the charges for shipping the parcel. | Yes | 1.2 |
error_list | Details regarding any errors encountered. | No | See Error Response section for details |
message_ID | Unique ID associated with the request | Yes | c8853bb7-4b05-4f45-894a-6cff03765c02 |
Services Details
Field Name | Description | Mand | Example |
---|---|---|---|
service_code | A service code. | Yes | CPOLP |
description | Description of service. | Yes | CP Online Parcel |
price_excluding_gst | Price of service excluding GST (2 decimal points). | Yes | 10.00 |
price_including_gst | GST inclusive price of service (2 decimal points). | Yes | 11.50 |
estimated_delivery_time | An estimated delivery time for PACE. CourierPost and Fliway returns null. | No | 30 minutes, 60 minutes, 180 minutes |
service_standard | Indicates the time that the product will take to be delivered from the time that it is picked up. | No | “60 Minutes” for Pace,“Overnight” for CourierPost |
tracking_included | Indicates whether tracking functionality is included as part of the quoted price. | Yes | True |
signature_included | Indicates whether a signature is included as part of the quoted price. | Yes | False |
carrier | Indicates the carrier offering the option. The options are CourierPost, PACE, or Fliway. | Yes | CourierPost |
add_ons | Contains a list of add ons applicable to the service. | No | See Add ons Details section for details. |
Add ons Details
Field Name | Description | Mand | Example |
---|---|---|---|
addon_code | An add on product code | Yes | CPOLRD |
description | Description of add on | Yes | Rural Delivery Code |
price_excluding_gst | Price of service excluding GST (2 decimal points) | Yes | 1.86 |
price_including_gst | GST inclusive price of service (2 decimal points) | Yes | 2.14 |
mandatory | Indicates if the add on must be selected as part of the service. | Yes | True |
Rated Weight Details
Field Name | Description | Mand | Example |
---|---|---|---|
rated_weight | Indicates value the Merchant will be billed. | No | 6 |
Error Response Elements
Field Name | Description | Mand | Example |
---|---|---|---|
success | Returns if request is successful | Yes | false |
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 | Could not calculate volume for a box. Missing or invalid Height, Length or Width. |
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
Sample of success message:
{
"success": true,
"services": [
{
"carrier": "Pace",
"description": "3 HOUR SERVICE AUCKLAND",
"service_code": "3HRA",
"price_excluding_gst": 30.09,
"price_including_gst": 34.6,
"estimated_delivery_time": "180",
"service_standard": "180 Minutes",
"tracking_included": true,
"signature_included": true,
"addons": []
},
{
"carrier": "CourierPost",
"description": "CP Online Parcel",
"service_code": "CPOLP",
"price_excluding_gst": 2.44,
"price_including_gst": 2.81,
"estimated_delivery_time": null,
"service_standard": "Overnight",
"tracking_included": true,
"signature_included": false,
"addons": [
{
"description": "CP Online Sig Rq",
"addon_code": "CPSR",
"mandatory": false,
"price_excluding_gst": 0.29,
"price_including_gst": 0.33
},
{
"description": "CP Online Rural Delivery",
"addon_code": "CPOLRD",
"mandatory": true,
"price_excluding_gst": 0,
"price_including_gst": 0
}
]
},
{
"carrier": "Fliway",
"description": "Oversize by Fliway",
"service_code": "FLWY",
"price_excluding_gst": 34.20,
"price_including_gst": 39.34,
"estimated_delivery_time": null,
"tracking_included": true,
"signature_included": false,
"addons": [
{
"description": "Oversize by Fliway Home Delivery add-on",
"addon_code": "FLHD",
"mandatory": false,
"price_excluding_gst": 0.00,
"price_including_gst": 0.00,
"surcharge": 0.00,
"price_including_surcharge_and_gst": 0.00
}
]
}
],
"rated_weight": 1,
"message_id": "7b067255-b43c-4ea8-8fdb-0308565b58ad"
}
Sample of partial failure message:
{
"success": true,
"errors": [
{
"code": "200001",
"message": "Partial results returned, not all system(s) have responded",
"details": "There is an issue with retrieving ALL applicable options. Try again later for all options."
}
],
"services": [
{
"carrier": "CourierPost",
"description": "CP Online W/Island Contract",
"service_code": "CPOLCT1",
"price_excluding_gst": 0,
"price_including_gst": 0,
"estimated_delivery_time": null,
"service_standard": "Next working day - delivery to remote or rural area's may take longer",
"tracking_included": true,
"signature_included": false,
"addons": [
{
"description": "CP Online Sig Rq",
"addon_code": "CPSR",
"mandatory": false,
"price_excluding_gst": 2.08,
"price_including_gst": 2.39
},
{
"description": "CP Online Rural Delivery",
"addon_code": "CPOLRD",
"mandatory": true,
"price_excluding_gst": 2.88,
"price_including_gst": 3.31
}
]
},
{
"carrier": "CourierPost",
"description": "CP Online Parcel",
"service_code": "CPOLP",
"price_excluding_gst": 5.56,
"price_including_gst": 6.39,
"estimated_delivery_time": null,
"service_standard": "Next working day - delivery to remote or rural area's may take longer",
"tracking_included": true,
"signature_included": false,
"addons": [
{
"description": "CP Online Sig Rq",
"addon_code": "CPSR",
"mandatory": false,
"price_excluding_gst": 2.08,
"price_including_gst": 2.39
},
{
"description": "CP Online Rural Delivery",
"addon_code": "CPOLRD",
"mandatory": true,
"price_excluding_gst": 2.88,
"price_including_gst": 3.31
}
]
}
],
"rated_weight": 10,
"message_id": "9d10c19c-3d85-4661-afcb-a292abffc615"
}
Sample of failure message:
{
"success": false,
"errors": [
{
"code": "400001",
"message": "Parameter(s) missing",
"details": "Could not calculate volume for a box. Missing or invalid Height, Length or Width."
}
]
}