ParcelTrack API
Remove
Resource URL
UAT:
https://api.uat.nzpost.co.nz/tracking/2.0/subscriptions/remove/
Production:
https://api.nzpost.co.nz/tracking/2.0/subscriptions/remove/
Resource Description
Two methods are available to use to unsubscribe. If the subscription was created by calling the "Subscriptions" resource, then a subscription id was returned and can be used with this "Remove" resource to unsubscribe. If the subscription to tracking events was created via the CourierPost web site, then a subscription id will not be available and the r "Unsubscribe" resource should be called that uses the tracking reference and endpoint to identify the subscription to be removed.
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. |
Header
Contains the access token. The access token is provided upon registering to use the API. See 'Getting Started'.
Example: Authorization: Bearer {access_token}
Request Message Fields
Field | Description | Mand | Example |
---|---|---|---|
subscriptionid | The unique subscription identifier supplied upon creation of a new subscription | Yes | 4F37E5C6-2DCE-4433-8EA4-0A513454D2EE |
Sample Request
https://api.nzpost.co.nz/tracking/2.0/subscriptions/remove?subscriptionid=4F37E5C6-2DCE-4433-8EA4-0A513454D2EE
Response Parameters
Field Name | Description | Mand | Example | |
---|---|---|---|---|
results | null | - | - | |
success | Returns bolean indicating success or failure of subscription creation | Yes | True | |
code | Code that indicates state of POST | Yes | 200 | |
message | Details regarding any errors encountered. | No | See Error List section for details |
Error Types
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 | Value | Example |
---|---|---|---|
200 | Success | Number | |
400 | Invalid request | Number | 1002 |
403 | Forbidden | String | User unauthorised |
409 | Invalid request | String | Duplicate subscription found for Ticket Number 7963061234567801CDY001AS and Email xyza447@gmail.comz |
500 | System unavailable | String | System unavailable |
Error Messages
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 Responses
Sample success response:
{
"results": {"subscription_id": "4f37e5c6-2dce-4433-8ea4-0a513454d2ee"},
"success": true,
"code": 200,
"message": "Completed successfully"
}
Sample failure response:
{
"results": {},
"success": false,
"code": 400,
"message": "No subscription could be found for subscription id 4f37e5c6-2dce-4433-8ea4-0a513454d2e1"
}