ZonalHub API v1

REST + JSON. Amounts in rupees, weights in kg, sizes in cm. Times are ISO 8601 (UTC).

Authentication

Create a key in the dashboard under API keys and send it on every request:

curl -X POST https://www.zonalhublogistics.in/api/v1/rates \
  -H "Authorization: Bearer zh_live_…" \
  -H "Content-Type: application/json" \
  -d '{"pickup_pincode":"110043","delivery_pincode":"302001","weight_kg":0.5,"length_cm":10,"breadth_cm":10,"height_cm":10,"payment_mode":"prepaid"}'

Endpoints

GET /api/v1/me

Check the key: account, wallet (available = what new bookings can use) and pickup addresses.

{ "account": { "name": "VK Traders", "status": "active", "kyc_status": "verified", "billing_mode": "prepaid" },
  "wallet": { "balance": 5200, "on_hold": 0, "available": 5200 },
  "pickup_addresses": [ { "nickname": "Najafgarh WH", "pincode": "110043", "city": "New Delhi", "state": "Delhi", "is_default": true } ] }

POST /api/v1/rates

Serviceable couriers with price, cheapest first. recommended = best delivery record (last 90 days) within 10% of the cheapest; delivery_pct / rto_pct are null until a courier has 20 finished shipments on that zone.

{
  "pickup_pincode": "110043",
  "delivery_pincode": "302001",
  "weight_kg": 0.8, "length_cm": 20, "breadth_cm": 15, "height_cm": 10,
  "payment_mode": "cod", "cod_amount": 1299
}
{ "rates": [ { "courier": "delhivery_surface", "courier_name": "Delhivery Surface",
  "zone": "D", "charged_weight_kg": 0.8, "freight": 65, "cod_charge": 35, "gst": 18, "total": 118, "tat_days": 4,
  "recommended": true, "delivery_pct": 93.5, "rto_pct": 4.1 } ] }

POST /api/v1/orders

Create an order. Idempotent on order_no — resending returns the existing order with "duplicate": true. Optional cod_amount collects less than the item value (advance already paid); omit it for full COD.

{
  "order_no": "VK-1042",
  "payment_mode": "cod",
  "buyer": { "name": "Rahul Sharma", "phone": "9876543210", "email": "rahul@example.com" },
  "address": { "line1": "H.No 221, Gali 4, Shastri Nagar", "line2": "Near Hanuman Mandir", "pincode": "302001" },
  "items": [ { "name": "Herbal Oil 200ml", "sku": "HO200", "qty": 2, "unit_price": 649.5 } ],
  "package": { "weight_kg": 0.8, "length_cm": 20, "breadth_cm": 15, "height_cm": 10 },
  "pickup": "Najafgarh WH",
  "cod_amount": 999
}
{ "order_id": "…", "order_no": "VK-1042", "status": "new" }

POST /api/v1/shipments

Book an order. Wallet is debited. courier = "recommended" (default), "cheapest", or a courier code from /rates.

{ "order_no": "VK-1042", "courier": "recommended" }
{ "shipment_id": "…", "awb": "1490811234567", "courier_name": "Delhivery Surface", "charged": 118,
  "status": "awb_assigned", "label_url": "/api/v1/shipments/1490811234567/label", "tracking_url": "https://www.zonalhublogistics.in/t/1490811234567" }

GET /api/v1/shipments/{awb}

Status and full tracking history.

{ "awb": "…", "status": "in_transit", "events": [ … ] }

POST /api/v1/shipments/track

Batch status for up to 100 AWBs / order numbers in one call, with the newest 20 events and any open NDR.

{ "awbs": ["1490811234567"], "order_nos": ["VK-1043"] }
{ "shipments": [ { "awb": "1490811234567", "order_no": "VK-1042", "found": true, "status": "ndr", "courier_name": "Delhivery Surface",
  "delivered_at": null, "ndr_open": { "attempt_no": 1, "reason": "Customer not available" }, "events": [ … ] } ] }

POST /api/v1/shipments/{awb}/ndr

Act on an open NDR: reattempt, change_address (line1, line2), change_phone (phone) or rto.

{ "action": "reattempt", "note": "Customer available after 4 pm" }
{ "awb": "…", "action": "reattempt", "pushed_to_courier": true, "push_error": null }

GET /api/v1/shipments/{awb}/label

4×6 PDF label.

application/pdf

POST /api/v1/shipments/{awb}/cancel

Cancel before pickup. Full refund to wallet.

{ "awb": "…", "status": "cancelled", "refunded": true }

Status webhooks

Add your HTTPS URL in Integrations → Status webhooks. Every shipment update is POSTed as JSON with X-ZonalHub-Event: shipment.status and X-ZonalHub-Signature: sha256=<hex HMAC-SHA256 of the raw body with your signing secret>. Reply with any 2xx; otherwise we retry after 1, 5, 30, 120 and 720 minutes.

{
  "event": "shipment.status",
  "shipment_id": "4f0c…", "awb": "1234567890", "status": "out_for_delivery",
  "direction": "forward", "courier": "Delhivery", "order_no": "WEB-1042", "channel": "api",
  "payment_mode": "cod", "cod_amount": 1299, "charged_weight_kg": 0.5, "zone": "D",
  "location": "Jaipur_Hub", "remark": null, "event_at": "2026-10-25T09:30:00Z",
  "tracking_url": "https://www.zonalhublogistics.in/t/1234567890"
}

Status values: awb_assigned, pickup_scheduled, picked_up, in_transit, out_for_delivery, delivered, ndr, rto_initiated, rto_in_transit, rto_delivered, lost, damaged, cancelled.

// Node.js — verify the signature
const expected = "sha256=" + crypto.createHmac("sha256", SECRET).update(rawBody).digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers["x-zonalhub-signature"]))) return res.status(401).end();

Order inbox (no API key)

For no-code tools (Zapier, Make, Pabbly, Google Sheets) create an inbox in Integrations → Any website or app and POST orders to its private URL. Same fields as POST /api/v1/orders, plus common alternatives (order_id, shipping_address, address1, zip, line_items, payment_method “COD”). Response: { "ok": true, "created": 1, "already_imported": 0, "errors": [] }.

Errors

Every error: { "error": { "code": "…", "message": "…" } }

400invalid_request / invalid_jsonField missing or wrong — message names the field
401unauthorizedMissing, wrong or revoked key
402insufficient_balance / invoice_overdueRecharge the wallet or pay the overdue invoice
403kyc_required / account_inactiveCOD needs verified KYC
404not_found / order_not_found
409duplicate / order_not_bookableAlready exists / already booked
422pincode_not_found / not_serviceableNo courier serves this route
429rate_limited120 requests per minute per key