PathaoParcel
DocsUse CasesContact

Documentation

  • Getting Started
  • Authentication
  • API Reference
  • Webhooks
  • Error Codes
  • SDKs & Tools
  • Sandbox
  • Rate Limiting
  • Idempotency
  • Changelog
PathaoParcel
DocumentationPricingContactUse Cases

© 2026 Pathao Ltd. All rights reserved.

Webhooks

When you configure a callback_url during order creation or in your partner dashboard, Pathao will push real-time status updates to your server via HTTP POST requests. This eliminates the need for polling and ensures your system stays synchronized with the delivery lifecycle.

Webhook Events

The following events are sent to your callback URL as the order progresses through its lifecycle.

Event TypeTriggerPayload Includes
ORDER_CREATEDOrder successfully createdorder_id, status, quotation, tracking_url
ASSIGNEDOrder assigned to driverorder_id, status, driver_info
ACCEPTEDDriver accepts orderorder_id, status, driver_info, eta
STARTEDDriver starts journey to pickuporder_id, status, eta
PICKEDDriver confirms parcel pickuporder_id, status, timestamp
COMPLETEDDelivery confirmedorder_id, status, timestamp
CANCELLEDOrder cancelledorder_id, status, cancellation_reason

Webhook Payload Example

Each webhook request sends a JSON payload in the POST body. Your endpoint should respond with a 200 OK status within 5 seconds to acknowledge receipt.

POST callback_url

Order Status State Machine

Orders move through the following states. Cancellation is possible from any pre-PICKED status.

PENDING
ASSIGNED
ACCEPTED
STARTED
PICKED
COMPLETED
Any pre-PICKED status can transition to CANCELLED
CANCELLED

Retry Policy

Failed webhooks are retried up to 5 times with exponential backoff. After all retries are exhausted, the webhook is queued for manual review. Partners can use the status polling endpoint as a fallback.

AttemptDelay After Failure
Retry 1 of 51s
Retry 2 of 52s
Retry 3 of 54s
Retry 4 of 58s
Retry 5 of 516s

Best Practices

  • 1Respond quickly. Return a 200 status within 5 seconds. Process the payload asynchronously if your logic takes longer.
  • 2Handle duplicates. Webhooks may be delivered more than once. Use the order_id and parcel_status combination as a deduplication key.
  • 3Verify the source. Validate that the request comes from Pathao by checking the originating IP or implementing a shared secret header.
  • 4Use status polling as fallback. If your webhook endpoint goes down, use the GET /v1/business/order/:id/status endpoint to reconcile any missed updates.
  • 5Log everything. Store the raw webhook payload alongside your processed data for debugging and auditing purposes.
POST callback_url
{
  "event_type": "ORDER_STATUS_CHANGE",
  "order_id": "PTH-PRC-2025-0001234",
  "partner_reference_id": "ORD-2025-00123",
  "parcel_status": "ACCEPTED",
  "previous_status": "ASSIGNED",
  "updated_at": "2025-01-19T14:35:00+06:00",
  "rider_id": 12345,
  "rider_latitude": 23.7890,
  "rider_longitude": 90.4012,
  "driver_type": 1,
  "is_freelancer": false,
  "time_to_pickup": 8,
  "duration": 30
}