- Home
- Developers
API documentation
Quote, book, track and cancel parcels from your own system, and get status updates by webhook. The API is open to approved business accounts.
Overview
- Base URL
https://point2point.nz/api/v1- Format
- JSON in and out, snake_case keys, UTF-8.
- Money
- Integer cents in NZD, GST inclusive.
"total_cents": 2132is $21.32. - Times
- ISO-8601 in UTC, like
2026-09-24T12:35:36.563Z. - Sizes
- Weights in kilograms (
weight_kg), dimensions in whole centimetres.
Authentication
Create API keys in the business dashboard under Account › Business › API keys. A key is shown once, when you create it, so store it like a password. A business can hold up to 10 active keys.
Authorization: Bearer p2p_live_2mB9x…Live keys start with p2p_live_ and test keys with p2p_test_, followed by 32 characters. A test key works in a separate test area: see Test mode. A revoked key, or a key whose business is suspended, gets 401 invalid_api_key. The API sets no cookies and needs no CSRF token.
Rate limits
Each API key can make 120 requests a minute. Failed authentication attempts are limited per IP address. Every response carries these headers:
| Header | Meaning |
|---|---|
RateLimit-Limit, X-RateLimit-Limit | Requests allowed in the window (120). |
RateLimit-Remaining, X-RateLimit-Remaining | Requests left in the current window. |
RateLimit-Reset | Seconds until the window resets. |
X-RateLimit-Reset | Unix time, in seconds, when the window resets. |
Over the limit you get 429 rate_limited with a Retry-After header in seconds.
Errors
Every error has the same shape. fields appears only on validation errors, keyed by the dotted path into your request body.
{
"error": {
"code": "validation_failed",
"message": "Please check the highlighted fields.",
"fields": {
"receiver.postcode": "Enter a 4-digit postcode.",
"parcel.weight_kg": "Parcels must weigh between 0.1 kg and 25 kg."
}
}
}| HTTP | Code | When |
|---|---|---|
| HTTP 400 | invalid_json | The body is not valid JSON, or not a JSON object. |
| HTTP 401 | unauthorized | No Authorization: Bearer header. |
| HTTP 401 | invalid_api_key | Unknown or revoked key, or the business is not approved. |
| HTTP 400 | invalid_idempotency_key | The Idempotency-Key header is not 1 to 255 printable characters. |
| HTTP 404 | not_found | Unknown endpoint, or a tracking number that is not on your account. |
| HTTP 409 | not_cancellable | The parcel is already in our network (picked up or later). |
| HTTP 409 | idempotency_key_reused | This Idempotency-Key was already used with a different request. |
| HTTP 409 | label_not_available | The parcel is not booked and paid for, so it has no label. |
| HTTP 413 | payload_too_large | The body is larger than 2 MB. |
| HTTP 415 | unsupported_media_type | A POST without Content-Type: application/json. |
| HTTP 422 | validation_failed | Field errors, listed in fields. |
| HTTP 429 | rate_limited | Too many requests. |
| HTTP 500 | internal_error | Something went wrong on our side. Retry later. |
Safe retries
Send an Idempotency-Key header on POST /shipments and POST /manifests, so a retry after a timeout cannot book twice. Use anything unique for the booking, such as your order number or a UUID, up to 255 characters.
curl -s -X POST https://point2point.nz/api/v1/shipments \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d @shipment.json- The same key and the same body answer with the first response, and the header
Idempotent-Replayed: true. Nothing new is booked. - The same key with a different body answers
409 idempotency_key_reused. - Only a booking that went through is kept. A request that failed, such as a
422, can be fixed and sent again with the same key. - Keys last 24 hours and belong to your business. Without the header, every request books.
Reference data
Regions
Send these values in from, to and every region field.
| Value | Region | Island |
|---|---|---|
northland | Northland | North Island |
auckland | Auckland | North Island |
waikato | Waikato | North Island |
bay-of-plenty | Bay of Plenty | North Island |
gisborne | Gisborne | North Island |
hawkes-bay | Hawke's Bay | North Island |
taranaki | Taranaki | North Island |
manawatu-whanganui | Manawatū-Whanganui | North Island |
wellington | Wellington | North Island |
nelson-tasman | Nelson & Tasman | South Island |
marlborough | Marlborough | South Island |
west-coast | West Coast | South Island |
canterbury | Canterbury | South Island |
otago | Otago | South Island |
southland | Southland | South Island |
Services
| Value | Service | Delivery |
|---|---|---|
economy | Economy | 2–4 business days anywhere in New Zealand. |
overnight | Overnight | Next business day between main centres, 1–2 business days to other towns. |
same_day | Same-day | Auckland, Wellington and Christchurch metro only. Pickup and delivery in the same region, not to rural addresses. |
Parcel types
| Value | Size | Priced on |
|---|---|---|
satchel_small | Up to 1 kg, 28 × 38 cm | Weight only |
satchel_large | Up to 3 kg, 40 × 50 cm | Weight only |
box_small | 30 × 20 × 15 cm | The greater of actual and cubic weight |
box_medium | 40 × 30 × 25 cm | The greater of actual and cubic weight |
box_large | 60 × 40 × 40 cm | The greater of actual and cubic weight |
custom (default) | Send length_cm, width_cm and height_cm, each 1–150 cm. | The greater of actual and cubic weight |
Cubic weight is length × width × height in centimetres, divided by 5000. The chargeable weight is the greater of actual and cubic weight, rounded up to a whole kilogram, with a minimum of 1 kg. A parcel can weigh 0.1–25 kg.
Pricing
Prices come from the Point2Point rate card, less your account discount. The discount applies to the core price only. Add-ons are not discounted: signature on delivery adds $1.50, a rural address adds $4.50 on Economy and Overnight, and extra cover is free for the first $100 of declared value, then $2.50 for each $100 or part of it, up to $50,000 (your account's limit; over it, declared_value is a field error). We always calculate the price: any price fields you send are ignored.
Shipment statuses
| Value | Shown to customers as |
|---|---|
awaiting_payment | Awaiting payment |
booked | Booked |
picked_up | Picked up |
in_transit | In transit |
at_depot | At depot |
out_for_delivery | Out for delivery |
delivered | Delivered |
delivery_failed | Delivery attempted |
held_at_depot | Held at depot |
cancelled | Cancelled |
returned_to_sender | Returned to sender |
lost | Lost |
written_off | Written off |
Tracking numbers are 16 digits, like 6424351544509385: 64, 13 digits, then a check digit (Luhn), so a mistyped number is caught before it is looked up. We send them without spaces in tracking_number and grouped for people in tracking_number_display (6424 3515 4450 9385); spaces, dots and dashes are ignored when you send one. Numbers from before September 2026 (P2P1048327765NZ) still work. Each parcel also has an 8-character query_code (letters and digits, no 0, O, 1, I or L) that tracks it in place of the number. code_required is true for parcels that need their 6-digit parcel code at delivery (code_reason: international, valuable or business); the code itself comes only in your own create and detail responses, as parcel_code.
Endpoints
| Method and path | Purpose |
|---|---|
POST /quotes | Price a parcel for every service |
POST /shipments | Book one shipment |
POST /manifests | Book up to 500 shipments at once, all or nothing |
GET /manifests/{ref} | One inbound consignment and its parcels |
GET /shipments | List your shipments, newest first |
GET /shipments/{tracking_number} | One shipment, with its events and where it is now |
GET /shipments/{tracking_number}/label | The label, as a PDF or as ZPL |
POST /shipments/{tracking_number}/cancel | Cancel before pickup |
POST /shipments/{tracking_number}/events | Partner milestones: landed in New Zealand, border checks, cleared |
GET /shipments/{tracking_number}/proof-photo | The proof-of-delivery photo |
GET /tracking/{tracking_number} | Public-safe tracking for one of your parcels, by any of its numbers |
POST /tracking | Public-safe tracking for any parcel: the number and one detail |
Price a parcel
POST /quotes returns a price for every service, with your discount applied.
curl -s -X POST https://point2point.nz/api/v1/quotes \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{"from":"auckland","to":"wellington","parcel_type":"box_small","weight_kg":1.2,"signature_required":true}'| Field | Type | Notes |
|---|---|---|
from, to | string | Region values. Required unless you send postcodes. |
from_postcode, to_postcode | string | Instead of from and to: 4-digit New Zealand postcodes. We work out the region, and whether the delivery is rural. |
parcel_type | string | Defaults to custom. |
weight_kg | number | Required. |
length_cm, width_cm, height_cm | number | Required for custom. |
declared_value | number | In dollars, or send declared_value_cents. |
signature_required | boolean | Adds signature on delivery. |
rural | boolean | The receiver is at a rural address. |
curl -s -X POST https://point2point.nz/api/v1/quotes \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{"from_postcode":"3200","to_postcode":"6012","parcel_type":"box_small","weight_kg":1.2}'{
"quote": {
"zone": "regional",
"zone_label": "Regional",
"actual_kg": 1.2,
"cubic_kg": 1.8,
"chargeable_kg": 2,
"dims": [30, 20, 15],
"discount_pct": 10,
"options": [
{
"service": "economy",
"label": "Economy",
"available": true,
"reason": null,
"core_cents": 1250,
"discount_cents": 125,
"addons": [{ "code": "signature", "label": "Signature on delivery", "cents": 150 }],
"total_cents": 1275,
"estimate": "2–4 business days"
},
{
"service": "overnight",
"label": "Overnight",
"available": true,
"reason": null,
"core_cents": 1813,
"discount_cents": 181,
"addons": [{ "code": "signature", "label": "Signature on delivery", "cents": 150 }],
"total_cents": 1782,
"estimate": "Next business day"
},
{
"service": "same_day",
"label": "Same-day",
"available": false,
"reason": "Same-day is only available within one metro area. Choose the same region for pickup and delivery.",
"core_cents": null,
"discount_cents": 0,
"addons": [],
"total_cents": null,
"estimate": null
}
],
"parcel_code": null,
"cover": {
"included_cents": 10000,
"step_cents": 10000,
"step_price_cents": 250,
"max_cents": 200000,
"kind": "personal"
},
"currency": "NZD"
}
}Book a shipment
POST /shipments books one parcel. On monthly account terms the shipment is booked straight away and goes on next month’s invoice; a booking that would pass your credit limit fails with 422 and a payment_method field error. On card terms it is created as awaiting_payment, and you pay for it in the business dashboard before we collect it.
curl -s -X POST https://point2point.nz/api/v1/shipments \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d @shipment.json{
"service": "overnight",
"customer_reference": "ORDER-1042",
"sender": {
"name": "Dispatch team",
"company": "Kōwhai Ceramics",
"phone": "021 555 0190",
"line1": "18 Kahikatea Drive",
"suburb": "Te Rapa",
"city": "Hamilton",
"region": "waikato",
"postcode": "3200"
},
"receiver": {
"name": "Aroha Smith",
"email": "aroha@example.co.nz",
"phone": "021 555 0101",
"line1": "14 Upland Road",
"suburb": "Kelburn",
"city": "Wellington",
"region": "wellington",
"postcode": "6012",
"is_rural": false
},
"parcel": { "type": "box_small", "weight_kg": 1.2, "declared_value": 250 },
"signature_required": false,
"delivery_instructions": "Leave at the front door",
"pickup": { "method": "dropoff" },
"international": false
}| Field | Required | Notes |
|---|---|---|
service | Yes | economy, overnight or same_day. |
sender.name, sender.line1, sender.city, sender.region, sender.postcode | Yes | sender.phone is required for pickups. |
sender.company, sender.email, sender.phone, sender.line2, sender.suburb | No | |
receiver.name, receiver.line1, receiver.city, receiver.region, receiver.postcode | Yes | A 4-digit New Zealand postcode. |
receiver.email, receiver.phone | No | Delivery notifications go to email. |
receiver.is_rural | No | Adds the rural fee and rules out same-day. |
parcel.type, parcel.weight_kg, dimensions, parcel.declared_value | See reference data | declared_value in dollars, or declared_value_cents. |
signature_required | No | Adds signature on delivery. |
delivery_instructions | No | Up to 300 characters, printed on the label. |
customer_reference | No | Your order number, up to 60 characters. Searchable with q. |
pickup.method | No | dropoff (default) or pickup. |
pickup.date | For pickups | YYYY-MM-DD, a weekday within 30 days. |
international | No | true for international last-mile parcels, shown on tracking. |
partner_tracking_number | No | International only: your overseas carrier’s number, 8 to 40 letters and digits. Stored upper-case without spaces or dashes, unique on your account. Receivers can track with it. |
sender.country | For an overseas sender | With international: true: a two-letter country code. sender.region and sender.postcode are then not needed. See Inbound freight, below. |
pickup.awb, pickup.location | No | Air waybill or bill of lading, and where we collect it. The parcel joins that consignment. |
{
"shipment": {
"tracking_number": "6419889849330251",
"tracking_number_display": "6419 8898 4933 0251",
"query_code": "H7QK4M2X",
"code_required": false,
"code_reason": null,
"status": "booked",
"status_label": "Booked",
"service": "overnight",
"source": "api",
"batch_id": null,
"customer_reference": "ORDER-1042",
"international": false,
"sender": {
"name": "Dispatch team",
"company": "Kōwhai Ceramics",
"phone": "021 555 0190",
"line1": "18 Kahikatea Drive",
"suburb": "Te Rapa",
"city": "Hamilton",
"region": "waikato",
"postcode": "3200",
"email": null,
"line2": null
},
"receiver": {
"name": "Aroha Smith",
"email": "aroha@example.co.nz",
"phone": "021 555 0101",
"line1": "14 Upland Road",
"suburb": "Kelburn",
"city": "Wellington",
"region": "wellington",
"postcode": "6012",
"is_rural": false,
"company": null,
"line2": null
},
"parcel": {
"type": "box_small",
"weight_kg": 1.2,
"length_cm": 30,
"width_cm": 20,
"height_cm": 15,
"declared_value_cents": 25000,
"chargeable_kg": 2
},
"signature_required": false,
"delivery_instructions": "Leave at the front door",
"zone": "regional",
"price": {
"currency": "NZD",
"core_cents": 1813,
"discount_cents": 181,
"addons": [{ "code": "cover", "label": "Extra cover to $250", "cents": 500 }],
"total_cents": 2132
},
"payment": { "method": "account", "paid_at": null, "invoice_id": null },
"pickup": { "method": "dropoff", "date": null },
"estimated_delivery": "Next business day",
"delivered_at": null,
"proof_of_delivery": null,
"cancelled_at": null,
"label_url": "https://point2point.nz/api/v1/label/6419889849330251?token=b4a4044c72cb1df6fc2b894b70b7cef6",
"label_page_url": "https://point2point.nz/label/6419889849330251?token=b4a4044c72cb1df6fc2b894b70b7cef6",
"tracking_url": "https://point2point.nz/track/6419889849330251",
"created_at": "2026-09-24T12:35:36.563Z",
"updated_at": "2026-09-24T12:35:36.563Z",
"events": [
{
"status": "booked",
"code": "booking_confirmed",
"title": "Booking confirmed",
"description": "Label created. We will scan the parcel when it enters our network.",
"location": "Hamilton",
"occurred_at": "2026-09-24T12:35:36.563Z"
}
]
}
}The response carries a Location: /api/v1/shipments/{tracking_number} header. label_url is the label as a PDF, and needs no key. Once delivered, proof_of_delivery is { "type": "photo" | "signature", "name", "note" }.
Book a manifest
POST /manifests books up to 500 shipments in one request. Every row is checked first. If any row fails, the whole request is rejected and nothing is booked.
curl -s -X POST https://point2point.nz/api/v1/manifests \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{ "shipments": [ { ... }, { ... } ] }'{
"batch_id": "BAT-3F9A1C27",
"count": 2,
"total_cents": 3405,
"currency": "NZD",
"shipments": [
{ "tracking_number": "6444029183751148", "status": "booked", "...": "..." },
{ "tracking_number": "6444029183761170", "status": "booked", "...": "..." }
]
}{
"error": {
"code": "validation_failed",
"message": "1 of 3 shipments need fixing.",
"fields": { "shipments[1].receiver.postcode": "Enter a 4-digit postcode." },
"details": {
"rows": [{ "index": 1, "fields": { "receiver.postcode": "Enter a 4-digit postcode." } }]
}
}
}Inbound freight
An overseas partner sends the air waybill or bill of lading with the manifest. consignment turns the manifest into one consignment, and we open a collection job for the airport or port. We collect after release_at, once your broker has cleared it. Only awb is required: send the rest as you learn it.
{
"consignment": {
"awb": "176-12345675",
"transport_mode": "air",
"terminal": "Auckland Airport, cargo terminal",
"release_at": "2026-09-24T06:30:00+12:00",
"piece_count": 3,
"flight_or_vessel": "NZ288",
"origin_country": "CN",
"entry_depot": "AKL"
},
"shipments": [
{
"service": "economy",
"international": true,
"partner_tracking_number": "XB88213551",
"sender": {
"name": "Export desk",
"company": "Your carrier",
"phone": "+86 21 5555 0100",
"line1": "88 Century Avenue",
"city": "Shanghai",
"postcode": "200120",
"country": "CN"
},
"receiver": {
"name": "Aroha Smith",
"email": "aroha@example.co.nz",
"line1": "14 Upland Road",
"suburb": "Kelburn",
"city": "Wellington",
"postcode": "6012"
},
"parcel": { "type": "box_small", "weight_kg": 1.2 }
}
]
}| Field | Notes |
|---|---|
awb | Air waybill or bill of lading number. Required. |
transport_mode | air (default) or sea. |
terminal | The airport or port terminal we collect from. |
release_at | ISO 8601: when it is released for collection. |
piece_count | Pieces on the waybill. |
flight_or_vessel | Flight number or vessel name. |
origin_country | Two-letter country code. |
entry_depot | The depot it comes in through: AKL (default), or another depot code. |
An overseas sender has a country and no New Zealand region or postcode. The price and route start at entry_depot, which is the Auckland hub unless you say otherwise; send entry_depot on the shipment too if it comes in elsewhere. A single POST /shipments can carry consignment as well, or the short form pickup.awb and pickup.location: bookings with the same waybill join the same open consignment.
Get it back
GET /manifests/{ref} returns the consignment and its parcels, and GET /manifests lists yours. PATCH /manifests/{ref} changes terminal, release_at, flight_or_vessel, piece_count or notes until it is collected.
{
"consignment": {
"ref": "CN-4821907",
"status": "open",
"awb": "176-12345675",
"transport_mode": "air",
"terminal": "Auckland Airport, cargo terminal",
"release_at": "2026-09-23T18:30:00.000Z",
"flight_or_vessel": "NZ288",
"origin_country": "CN",
"entry_depot": "AKL",
"piece_count": 3,
"pieces_collected": null,
"collected_at": null,
"shipments": [
{
"tracking_number": "6419889849330251",
"consignment_seq": 1,
"status": "booked",
"partner_tracking_number": "XB88213551",
"customer_reference": null,
"receiver_city": "Wellington"
}
]
}
}status goes open, collection_booked, collected, then closed once every parcel has been scanned in. Each parcel gets the public event freight_collected when the freight leaves the terminal.
Print a label
GET /shipments/{tracking_number}/label returns one 100 × 150 mm label: format=pdf (the default) or format=zpl for a 203 dpi thermal printer. It carries a Code 128 barcode of the tracking number and a QR code. A parcel that is not booked and paid for answers 409 label_not_available.
curl -s "https://point2point.nz/api/v1/shipments/6419889849330251/label?format=pdf" \
-H "Authorization: Bearer $P2P_KEY" -o label.pdfcurl -s "https://point2point.nz/api/v1/shipments/6419889849330251/label?format=zpl" \
-H "Authorization: Bearer $P2P_KEY"label_url on every shipment is the same PDF without a key, by a private token, so a print station can open it. Add &format=zpl for ZPL. PDF and ZPL print Latin letters, including macrons. Any other script prints as ?: label_page_url is a printable web page that shows every script.
List shipments
GET /shipments lists shipments on your account, newest first.
curl -s "https://point2point.nz/api/v1/shipments?status=booked,in_transit&per_page=25" \
-H "Authorization: Bearer $P2P_KEY"| Parameter | Notes |
|---|---|
page | Default 1. |
per_page | Default 25, maximum 100. |
status | One status, or several separated by commas: status=booked,in_transit. |
q | Searches the tracking number, customer reference, names and city. |
batch_id | Shipments from one manifest. |
created_from, created_to | YYYY-MM-DD, New Zealand dates, inclusive. |
partner_tracking_number | Find a parcel by your overseas partner’s number. |
{
"data": [
{
"tracking_number": "6419889849330251",
"status": "booked",
"...": "shipment object without events"
}
],
"pagination": { "page": 1, "per_page": 25, "total": 1, "pages": 1 }
}Get a shipment
GET /shipments/{tracking_number} returns { "shipment": { … } } with its events, newest first. A number that is not on your account returns 404 not_found.
curl -s https://point2point.nz/api/v1/shipments/6419889849330251 \
-H "Authorization: Bearer $P2P_KEY"Every shipment also says where the parcel is. These fields were added without changing any existing ones:
| Field | Notes |
|---|---|
stage | booked, arrived_nz, cleared, with_us, on_the_move, at_depot, out, delivered, returning or returned. |
custody | Who has it: sender, pickup_driver, depot, linehaul, driver, receiver or returned. |
current_depot | The depot code while it is at a depot, such as AKL or WLG. |
last_scan_at | When we last scanned it. |
attempts, next_attempt_date, held_until | Delivery attempts (we try twice), the next try, and the last day to collect a held parcel. |
eta | { "kind", "date" }. kind is late when it is running behind the first estimate. |
exception | An open problem you should know about (damaged, address_query, customs_hold, missort), else null. |
proof_of_delivery.photo | true when there is a proof photo. |
Events carry a code and a depot_code. Internal notes, scans, driver names, run numbers and cage references are never included.
Cancel a shipment
POST /shipments/{tracking_number}/cancel works only before the parcel enters our network, while it is awaiting_payment or booked. After pickup the response is 409 not_cancellable. The body is optional.
curl -s -X POST https://point2point.nz/api/v1/shipments/6419889849330251/cancel \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{"reason":"Order cancelled"}'{
"shipment": {
"tracking_number": "6419889849330251",
"status": "cancelled",
"cancelled_at": "2026-09-24T12:40:02.118Z",
"...": "..."
},
"refund": null
}refund is { "payment_id", "amount_cents", "status" } when a card payment was refunded, and null for account bookings, which are left off your invoice.
Partner events
POST /shipments/{tracking_number}/events records what happens to an international parcel before it reaches our Auckland hub. It works for your own international shipments while they are booked, and returns 201 Created with the event.
{
"code": "arrived_nz",
"occurred_at": "2026-09-24T06:20:00+12:00",
"location": "Auckland Airport"
}| Field | Required | Notes |
|---|---|---|
code | Yes | arrived_nz (Arrived in New Zealand), customs_hold (Held for border checks) or customs_cleared (Cleared by NZ Customs and MPI). |
occurred_at | No | ISO 8601, not in the future. Defaults to now. |
location | No | Up to 120 characters. |
description | No | Up to 300 characters. Defaults to our standard wording. |
{
"event": {
"code": "arrived_nz",
"status": "booked",
"title": "Arrived in New Zealand",
"description": "It has landed and is going through border checks.",
"location": "Auckland Airport",
"depot_code": null,
"occurred_at": "2026-09-23T18:20:00.000Z"
},
"shipment": { "tracking_number": "6433053874727194", "stage": "arrived_nz", "…": "…" }
}A shipment that is not yours returns 404. A domestic shipment, or one already in our network, returns 409. A bad code or time returns 422 with the field.
Proof photo
GET /shipments/{tracking_number}/proof-photo returns the photo our driver took at delivery, as an image. It is 404 when there is no photo, and it is sent with Cache-Control: private, no-store: keep your own copy if you need it later.
Public tracking
GET /tracking/{tracking_number} works for your own parcels, by the 16-digit tracking number, the query code, an old P2P number or your partner number. It returns the same data as the tracking page, including the journey, and never includes names, street addresses, phone numbers, email addresses, driver names, the query code or the parcel code. stage runs from 0 (booked) to 4 (delivered), and is -1 for awaiting payment or cancelled.
Tracking is private: any other parcel needs the number and one detail, sent with POST /tracking as proof: the receiver’s surname (name), the delivery postcode, the delivery suburb or town (place), or the 6-digit parcel code. A parcel with a parcel code needs the code. A wrong detail and an unknown number both answer 404 no_match; a right name for a parcel with a code answers 422 need_code; ten wrong details in an hour answer 423 locked for an hour. Look-ups with a detail are limited to 20 per 10 minutes per key.
curl -s https://point2point.nz/api/v1/tracking/6419889849330251 \
-H "Authorization: Bearer $P2P_KEY"curl -s -X POST https://point2point.nz/api/v1/tracking \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{"number":"6419889849330251","proof":{"postcode":"6012"}}'{
"tracking": {
"tracking_number": "6419889849330251",
"status": "booked",
"status_label": "Booked",
"status_tone": "info",
"stage": 0,
"service": "overnight",
"service_label": "Overnight",
"international": false,
"origin": {
"city": "Hamilton",
"region": "waikato",
"region_label": "Waikato",
"depot": "Hamilton"
},
"destination": {
"suburb": "Kelburn",
"city": "Wellington",
"region": "wellington",
"region_label": "Wellington",
"depot": "Wellington",
"is_rural": false
},
"weight": "1.2 kg",
"signature_required": false,
"estimated_delivery": "Next business day",
"booked_at": "2026-09-24T12:35:36.563Z",
"delivered_at": null,
"proof_of_delivery": null,
"held_at": null,
"can_request_delivery_options": true,
"events": [
{
"status": "booked",
"status_label": "Booked",
"code": "booking_confirmed",
"title": "Booking confirmed",
"description": "Label created. We will scan the parcel when it enters our network.",
"location": "Hamilton",
"occurred_at": "2026-09-24T12:35:36.563Z"
}
]
}
}Webhooks
Register endpoints in the business dashboard under Account › Business › Webhooks. You can have up to 5. Each endpoint gets its own signing secret, starting whsec_, and subscribes to any of these events:
| Event | Sent when |
|---|---|
shipment.created | A shipment is booked on your account, from the website, a bulk upload or the API. |
shipment.status_changed | Any status change, including booked after payment, picked_up, in_transit, at_depot, out_for_delivery, delivery_failed, held_at_depot, delivered, returned_to_sender and cancelled. |
shipment.delivered | The parcel is delivered. Sent as well as the status change. |
shipment.event | Opt in. Every public tracking event, including the ones that do not change the status: arrived at a hub, left on the linehaul, partner milestones, a redelivery booked. Tick it when you add or edit an endpoint. |
The dashboard’s Send test button sends a webhook.test event.
Tracking events
shipment.status_changed carries the event behind the change, and shipment.event sends { "shipment", "event" } for every public event:
{
"code": "departed_hub",
"title": "Left our Auckland hub for our Christchurch hub",
"description": "On the inter-island linehaul.",
"location": "Auckland hub, Māngere",
"depot_code": "AKL",
"to_depot_code": "CHC",
"occurred_at": "2026-09-24T10:40:00.000Z"
}Codes you will see include pre_advice, arrived_nz, customs_cleared, picked_up, dropped_off, inducted, arrived_origin_depot, departed_hub, arrived_hub, arrived_depot, out_for_delivery, delivered, collected, delivery_attempted, held_at_depot, redelivery_booked and rts_started. Treat codes you do not know as information only.
Delivery
We send an HTTP POST with a JSON body and these headers. Every delivery is signed with HMAC-SHA256 in the X-P2P-Signature header.
Content-Type: application/json
User-Agent: Point2Point-Webhooks/1.0
X-P2P-Event: shipment.status_changed
X-P2P-Delivery: evt_5d0c8f1e2a7b4c3d9e6f1a2b
X-P2P-Signature: t=1790253336,v1=5f2b0d6c…e91a{
"id": "evt_5d0c8f1e2a7b4c3d9e6f1a2b",
"type": "shipment.status_changed",
"created_at": "2026-09-24T02:14:09.000Z",
"data": {
"shipment": {
"tracking_number": "6432227315859961",
"tracking_number_display": "6432 2273 1585 9961",
"status": "delivered",
"status_label": "Delivered",
"service": "economy",
"international": true,
"...": "same shape as the API shipment object"
},
"previous_status": "out_for_delivery"
}
}Reply with any 2xx within 5 seconds. Each attempt is recorded, with its status code, error and duration, in the delivery log in your dashboard. Redirects are not followed. If your endpoint does not answer 2xx we try again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours: seven tries over about 32 hours, with the same id and body, a fresh signature, and X-P2P-Attempt from the second try. A paused endpoint’s retries wait until you resume it. After the last try you can send any delivery again with Replay in the delivery log, or use GET /shipments/{tracking_number} to reconcile. De-duplicate on id. In production, endpoints must use https and cannot point at private or local network addresses.
Verifying signatures
X-P2P-Signature is t=<unix seconds>,, where the hex is HMAC-SHA256(secret, "<t>.<raw request body>"). Compute it over the raw body bytes before any JSON parsing, compare in constant time, and reject timestamps more than 5 minutes old.
const crypto = require('node:crypto');
const express = require('express');
const SECRET = process.env.P2P_WEBHOOK_SECRET; // whsec_...
function verifyP2PSignature(header, rawBody, secret, toleranceSec = 300) {
const parts = Object.fromEntries(String(header || '').split(',').map((kv) => kv.trim().split('=')));
const t = Number(parts.t);
if (!Number.isFinite(t) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const a = Buffer.from(expected, 'hex');
const b = Buffer.from(parts.v1, 'hex');
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
const app = express();
app.post('/hooks/p2p', express.raw({ type: 'application/json' }), (req, res) => {
const raw = req.body.toString('utf8');
if (!verifyP2PSignature(req.get('X-P2P-Signature'), raw, SECRET)) return res.status(400).send('bad signature');
const event = JSON.parse(raw);
// Handle event.type / event.data.shipment here, de-duplicating on event.id.
res.sendStatus(204);
});Test mode
Create a key marked Test in the dashboard. A p2p_test_ key runs the same code as a live key on a separate test database, so you can book, print labels and take webhooks before you go live.
- Nothing is real: no pickups, no invoices, no emails or texts to anyone. Test parcels are never scanned by our depots.
- Everything is marked. Answers carry
X-P2P-Mode: test, shipments and webhook bodies carry"test_mode": true, and labels say TEST LABEL. - Every test booking goes straight to
booked, whatever your account terms are. - Webhooks: add an endpoint marked Test parcels. Live endpoints never hear test parcels, and test endpoints never hear live ones.
- Test parcels are cleared after 30 days, and each business can hold up to 5,000.
tracking_urlandlabel_page_urlarenull: useGET /tracking/{tracking_number}andlabel_url.
Move a test parcel along with POST /shipments/{tracking_number}/simulate. Send status: picked_up, in_transit, at_depot, out_for_delivery, delivered or delivery_failed. It goes through each step in between, and your webhooks fire at each one. With a live key this endpoint does not exist.
curl -s -X POST https://point2point.nz/api/v1/shipments/6419889849330251/simulate \
-H "Authorization: Bearer $P2P_KEY" -H "Content-Type: application/json" \
-d '{"status":"delivered"}'Questions about an integration? Email business@point2point.nz with your business name and the tracking number or request involved.