Getting Started

Download PDF Guide

Welcome to our 3rd-Party Delivery Integration API. Using this RESTful API platform, external systems can programmatically request, manage, and track deliveries inside our high-performance courier infrastructure. All API endpoints accept and return responses in standard JSON formatting.

Authentication

To authenticate with our API, you must pass your API credentials as a Bearer Token in your HTTP request headers.

Example Authorization Header
Authorization: Bearer tp_live_8f0a...c9d4

* Make sure to keep your API keys secure. Live keys start with tp_live_. Sandbox/test keys start with tp_test_.

Webhook Authentication

When our server sends webhooks to your endpoint, we include an Authorization header using the webhook secret you configured in your dashboard. Use this to verify the payload is genuinely from us.

Incoming Webhook Authorization Header
Authorization: Bearer <your_webhook_secret>

List Active Parcel Categories

Retrieves the list of active parcel categories and their IDs. Use these IDs when estimating or creating a delivery.

GET /api/v1/deliveries/categories
Example Response (200 OK)
{
  "status": "success",
  "data": [
    {
      "id": 1,
      "name": "Documents",
      "description": "Standard documents and letters",
      "parcel_per_km_shipping_charge": 5.50,
      "parcel_minimum_shipping_charge": 50.00
    },
    {
      "id": 2,
      "name": "Electronics",
      "description": "Fragile electronic devices",
      "parcel_per_km_shipping_charge": 10.00,
      "parcel_minimum_shipping_charge": 100.00
    }
  ]
}

Estimate Delivery Cost

Simulates an order creation to return a 100% accurate price quote based on current zones, distances, and applicable taxes without actually creating a delivery request.

POST /api/v1/deliveries/estimate

Request Fields

Field Type Required
pickup.latitude float Yes
pickup.longitude float Yes
dropoff.latitude float Yes
dropoff.longitude float Yes
parcel_category_id integer Yes
distance float No
Example Request Payload (JSON)
{
  "pickup": {
    "latitude": 9.0305,
    "longitude": 38.7456
  },
  "dropoff": {
    "latitude": 9.0112,
    "longitude": 38.7612
  },
  "parcel_category_id": 1
}
Example Response (200 OK)
{
  "distance_km": 5.4,
  "delivery_charge": 120.00,
  "total_amount": 138.00
}

Create a New Delivery

Creates a new delivery order inside the platform ecosystem.

POST /api/v1/deliveries

Request Fields

Field Type Required
pickup object Yes
pickup.contact_person_name string Yes
pickup.contact_person_number string Yes
pickup.address string Yes
pickup.latitude float Yes
pickup.longitude float Yes
dropoff object Yes
parcel_category_id integer Yes
charge_payer string (sender/receiver) Yes
third_party_reference_id string No
Example Request Payload (JSON)
{
  "pickup": {
    "contact_person_name": "John Doe",
    "contact_person_number": "+1234567890",
    "address": "123 Pickup St, City",
    "latitude": 40.5,
    "longitude": -74.5
  },
  "dropoff": {
    "contact_person_name": "Jane Smith",
    "contact_person_number": "+9876543210",
    "address": "456 Dropoff St, City",
    "latitude": 40.6,
    "longitude": -74.4
  },
  "parcel_category_id": 1,
  "charge_payer": "sender",
  "third_party_reference_id": "ORDER-9921"
}
Example Response (201 Created)
{
  "delivery_id": 10029,
  "tracking_number": "10029",
  "status": "pending",
  "third_party_reference_id": "ORDER-9921",
  "is_sandbox": false,
  "delivery_charge": 120.00,
  "total_amount": 138.00
}

Track a Delivery

Retrieves the current status, assignment details, and tracking timestamps of a specific delivery request.

GET /api/v1/deliveries/{id}
Example Response (200 OK)
{
  "delivery_id": 10029,
  "tracking_number": "10029",
  "status": "accepted",
  "third_party_reference_id": "ORDER-9921",
  "pickup": {
    "address": "123 Pickup St, City",
    "contact_person_name": "John Doe",
    "contact_person_number": "+1234567890"
  },
  "dropoff": {
    "address": "456 Dropoff St, City",
    "contact_person_name": "Jane Smith",
    "contact_person_number": "+9876543210"
  },
  "delivery_charge": 15.00,
  "delivery_man": {
    "name": "Tom Courier",
    "phone": "+1092837465"
  },
  "created_at": "2026-06-29T10:00:00Z",
  "updated_at": "2026-06-29T10:05:00Z"
}

List All Deliveries

Fetch a paginated list of deliveries created by your client account. Supports filtering by status or date.

GET /api/v1/deliveries?status=pending&date=2026-06-29
Example Response (200 OK)
{
  "current_page": 1,
  "data": [
    {
      "id": 10029,
      "order_status": "pending",
      "third_party_reference_id": "ORDER-9921",
      "created_at": "2026-06-29T10:00:00Z"
    }
  ],
  "total": 1
}

Cancel a Delivery

Cancels a pending or accepted delivery. Cannot be cancelled after the package is picked up by a rider.

PATCH /api/v1/deliveries/{id}/cancel
Example Response (200 OK)
{
  "message": "Delivery request cancelled successfully"
}

Sandbox Testing & Webhook Simulation

When using a test API key (prefixed with tp_test_), your requests run in an isolated Sandbox. To test your integration flow, you can simulate delivery status changes on-demand.

POST /api/v1/deliveries/{id}/simulate

Request Parameters

Field Type Allowed Values
status string assigned, picked_up, delivered, canceled
Example Simulation Request (JSON)
{
  "status": "picked_up"
}
Example Response (200 OK)
{
  "message": "Sandbox delivery status updated successfully",
  "delivery_id": 10029,
  "status": "picked_up"
}

Webhook Heartbeat Test

Dispatches a test webhook payload (`system.heartbeat`) to your configured Webhook URL to verify connectivity and validate your `webhook_secret`.

POST /api/v1/deliveries/webhook-test
Example Response (202 Accepted)
{
  "message": "Webhook heartbeat dispatched successfully"
}

Webhooks Integration

Provide a Webhook Endpoint URL in your developer dashboard settings, and our server will dispatch real-time POST notifications upon state updates.

Supported Events

  • delivery.created: Fired immediately on creation.
  • delivery.assigned: Fired when a delivery rider is assigned.
  • delivery.picked_up: Fired when the rider picks up the parcel.
  • delivery.location_update: Fired every time the driver's GPS location is updated while on an active delivery.
  • delivery.delivered: Fired when the package is delivered successfully.
  • delivery.cancelled: Fired when the order is cancelled.
  • system.heartbeat: Fired when triggering the webhook test endpoint.
Example Webhook Event Payload (JSON POST)
{
  "event": "delivery.location_update",
  "tracking_number": "10029",
  "third_party_reference_id": "ORDER-9921",
  "driver": {
    "latitude": 9.0305,
    "longitude": 38.7456,
    "heading": 180.5
  },
  "timestamp": "2026-06-29T10:15:00.000000Z"
}