Generated: March 4, 2026 Project: Assured Express Integration: ONRO Platform
- ONRO Integration Webhooks (Receive Data)
- ONRO POST Endpoints (Send Data)
- ONRO Support & Management Endpoints
- Dashboard Endpoints
- Dashboard Analytics Endpoints
- Key Configuration Files
- Wallet Endpoints
- Auth & Signup Endpoints
- Subscription Endpoints
- SmartParcel Locker Integration
- Dispatcher Orders
GET /wallet/virtual-account/
Description: Retrieves or creates a dedicated virtual account for the merchant to fund their wallet via bank transfer.
Authentication: Required (Merchant)
Response:
{
"success": true,
"data": {
"account_number": "7924567890",
"account_name": "AXPRESS/JOHN DOE",
"bank_name": "Wema Bank"
}
}
POST /api/auth/signup/
Description: Register a new merchant account.
Request Body:
{
"email": "user@example.com",
"password": "password123",
"business_name": "My Business",
"referral_code": "OPTIONAL_CODE"
}
GET /subscriptions/plans/
Description: Retrieves all available subscription plans (Starter, Growth, Enterprise).
Authentication: Required (Merchant)
Response:
{
"status": "success",
"data": [
{
"id": "uuid",
"name": "Enterprise",
"price": "75000.00",
"free_orders_limit": 400,
"overage_fee": "300.00",
"has_dedicated_rider": true
},
...
]
}
POST /subscriptions/plans/{plan_id}/subscribe/
Description: Subscribes the merchant to a specific plan.
Authentication: Required (Merchant)
Response:
{
"status": "success",
"data": {
"id": "uuid",
"plan": { ... },
"start_date": "...",
"end_date": "...",
"status": "active"
}
}
GET /subscriptions/postpaid/plans/
Description: Retrieves all available postpaid subscription plans.
Authentication: Required (Merchant)
Response:
{
"status": "success",
"data": [
{
"id": "uuid",
"name": "Monthly Postpaid",
"plan_type": "monthly",
"is_active": true
},
...
]
}
POST /subscriptions/postpaid/plans/{plan_id}/activate/
Description: Activates a postpaid plan for the merchant.
Authentication: Required (Merchant)
Response:
{
"status": "success",
"message": "Plan activated successfully"
}
GET /subscriptions/postpaid/active/
Description: Retrieves the current active postpaid subscription details.
Authentication: Required (Merchant)
Response:
{
"status": "success",
"data": {
"id": "uuid",
"name": "Monthly Postpaid",
"status": "active"
}
}
GET /subscriptions/active/
Description: Retrieves the merchant's current active subscription.
Authentication: Required (Merchant)
Response:
{
"status": "success",
"data": {
"subscriptions": [ ... ],
"current_active": {
"id": "uuid",
"plan": { ... },
"status": "active",
"end_date": "..."
}
}
}
These endpoints receive real-time data from the ONRO platform:
POST /onro/webhooks/pd-orders/
Handler: OnroUniversalWebhookView
File: onro_integration/webhook_handlers.py
Authentication: CSRF-exempt
Description: Receives pickup and delivery order events from ONRO
Data Storage: OnroOrder, OnroOrderDetail tables
POST /onro/webhooks/ondemand-orders/
Handler: OnroUniversalWebhookView
File: onro_integration/webhook_handlers.py
Authentication: CSRF-exempt
Description: Receives on-demand order events from ONRO
Data Storage: OnroOrder, OnroOnDemandOrder tables
POST /onro/webhooks/drivers/
Handler: OnroUniversalWebhookView
File: onro_integration/webhook_handlers.py
Authentication: CSRF-exempt
Description: Receives driver-related events from ONRO
POST /onro/webhooks/merchants/
Handler: OnroMerchantWebhookView
File: onro_integration/merchant_webhooks.py
Authentication: CSRF-exempt
Description: Receives merchant events from ONRO
Event Types:
- Registered (New merchant registration)
- Send password reset url
- Send verification code
- New withdraw request
- Complete withdraw request
- Reject withdraw request
POST /onro/driver-location-webhook/
Handler: OnroDriverLocationWebhookView
File: onro_integration/driver_tracking.py
Authentication: None (allows real-time location updates)
Description: Receives real-time driver location updates for active orders
These endpoints send operations to ONRO platform:
POST /onro/pd-orders/create/
Handler: File - onro_integration/order_views.py
Description: Create a new pickup and delivery order
Request Body: Order details (pickup location, delivery location, etc.)
POST /onro/pd-orders/draft/
Description: Save order as draft without confirming
POST /onro/pd-orders/confirm/
Description: Confirm a drafted order
POST /onro/pd-orders/calculate-price/
Description: Calculate order price before confirmation
Response: Estimated cost breakdown
POST /onro/pd-orders/cancel/
Description: Cancel an existing P&D order
Request Body: Order ID, cancellation reason
POST /onro/pd-orders/sync/
Description: Sync order data with ONRO
Response: Updated order status and details
POST /onro/ondemand-orders/create/
Handler: File - onro_integration/ondemand_views.py
Description: Create a new on-demand order
Request Body: Order details
POST /onro/ondemand-orders/calculate-price/
Description: Calculate on-demand order price
POST /onro/ondemand-orders/cancel/
Description: Cancel on-demand order
POST /onro/ondemand-orders/sync/
Description: Sync on-demand orders with ONRO
Response: All on-demand orders and their current status
GET /onro/webhook-logs/
Description: View all webhook logs received from ONRO
Response: Paginated list of webhook events with timestamps and payloads
GET /onro/sync/logs/
Description: View sync operation logs
Response: History of sync operations, timestamps, statuses
POST /onro/sync/full/
Description: Trigger a complete data sync with ONRO
Response: Sync job ID, status, and statistics
POST /onro/cancellation-reasons/sync/
Description: Sync cancellation reasons from ONRO
Response: Updated list of available cancellation reasons
POST /onro/track-driver/
Description: Get real-time driver location
Request Body: Driver ID or Order ID
Response: Current GPS coordinates, last update time
All dashboard endpoints return JSON responses with comprehensive analytics and metrics.
GET /onro_integration/dashboard/
Handler: OnroDashboardView
Description: Basic dashboard overview
Response: Summary widgets and key metrics
GET /onro_integration/order-dashboard/
Handler: OrderDashboardView
Description: Complete order pipeline and metrics
Response:
- Total orders by status (pending, confirmed, in-transit, delivered, cancelled)
- Order pipeline visualization
- Average delivery time
- Zone-wise order distribution
- Order trends (hourly, daily, weekly)
Query Parameters:
- date_filter: today, last_7_days, monthly, biannual, annual, custom_range
- start_date / end_date: For custom date ranges
GET /onro_integration/management-dashboard/
Handler: ManagementDashboardView
Description: Executive-level dashboard with comprehensive metrics
Response:
- Revenue trends
- Cost analysis
- Profitability metrics
- Key performance indicators
- Team performance
GET /onro_integration/rider-dashboard/
Handler: RiderDashboardView
Description: Rider/driver management and performance
Response:
- Rider tier distribution
- GPS sync status
- Performance metrics
- Active vs inactive riders
- Earnings summary
Query Parameters:
- tier: Filter by rider tier
- activity: Filter by activity status
- page, page_size: For pagination
GET /onro_integration/merchant-dashboard/
Handler: MerchantDashboardView
Description: Merchant analytics and intelligence
Response:
- Merchant activity metrics
- Credit score analysis
- Transaction history
- Merchant growth trends
GET /onro_integration/cod-dashboard/
Handler: CODDashboardView
Description: Cash on Delivery tracking and reconciliation
Response:
- COD collection status
- Settlement details
- Pending reconciliations
- Dispute logs
GET /onro_integration/financial-pl-dashboard/
Handler: FinancialPLDashboardView
Description: Financial Profit & Loss analysis
Response:
- Revenue breakdown by source
- Cost categories
- Profit/Loss trends
- Monthly P&L statements
Query Parameters:
- tab: revenue, expenses, profit, summary
- date_filter: Time period filter
GET /onro_integration/fleet-management-dashboard/
Handler: FleetManagementDashboardView
Description: Fleet and vehicle management with GPS tracking
Response:
- Fleet status overview
- Vehicle maintenance schedule
- GPS real-time tracking
- Bike utilization rates
- Fuel consumption analysis
GET /onro_integration/fraud-alert-dashboard/
Handler: FraudAlertDashboardView
Description: Fraud detection and alert management
Response:
- Active fraud alerts
- Risk assessment scores
- Triggering metrics
- Alert history
- Recommended actions
GET /onro_integration/ondemand-orders/dashboard/
Handler: OnDemandOrderDashboardView
Description: On-demand specific order metrics
Response: On-demand order analytics and pipeline
Advanced analytics endpoints for super admin:
POST /onro_integration/admin-dashboard/analytics/
Handler: AnalyticsAPIView
Description: Flexible custom analytics based on parameters
Request Body:
{
"metric": "revenue|orders|drivers|merchants",
"date_range": "today|week|month|custom",
"start_date": "2026-03-01",
"end_date": "2026-03-04",
"group_by": "daily|weekly|monthly|zone",
"status_filter": "all|completed|pending|cancelled"
}
Response: Custom analytics data formatted as requested
Example Response:
{
"total": 15000,
"average": 500,
"trend": "increasing",
"data_points": [...],
"summary": {...}
}
POST /onro_integration/admin-dashboard/charts/
Handler: ChartDataAPIView
Description: Pre-formatted chart data for frontend visualization
Request Body:
{
"chart_type": "pie|bar|line",
"metric": "orders|revenue|riders",
"period": "month|week|day"
}
Response: Chart-ready data with labels, values, colors
Supported Formats:
- Pie Charts: Category distribution
- Bar Charts: Comparative metrics
- Line Charts: Trends over time
GET /onro_integration/admin-dashboard/realtime/
Handler: RealTimeDataAPIView
Description: Real-time dashboard updates
Query Parameters:
- last_update: Timestamp to get updates since
Response:
{
"last_update": "2026-03-04T10:30:00Z",
"active_orders": 250,
"active_drivers": 45,
"online_merchants": 127,
"current_revenue": 5500,
"updates": [...]
}
POST /onro_integration/admin-dashboard/export/
Handler: ExportDataAPIView
Description: Export dashboard data as CSV or JSON
Request Body:
{
"format": "csv|json",
"report_type": "orders|riders|merchants|financial",
"date_range": "custom",
"start_date": "2026-03-01",
"end_date": "2026-03-04"
}
Response: File download with report data
File Format: CSV with headers or JSON structure
GET /onro_integration/admin-dashboard/health/
Handler: DashboardHealthAPIView
Description: System health status and diagnostics
No Parameters Required
Response:
{
"status": "healthy|warning|error",
"database": {
"connected": true,
"response_time_ms": 45
},
"cache": {
"status": "active",
"hit_rate": 0.87
},
"uptime_seconds": 1234567,
"last_sync": "2026-03-04T10:25:00Z",
"webhook_queue": 0
}
These parameters are supported across most dashboard endpoints:
| Parameter | Values | Description |
|---|---|---|
date_filter |
today, last_7_days, monthly, biannual, annual, custom_range | Time period to filter data |
start_date |
YYYY-MM-DD | Start date for custom range |
end_date |
YYYY-MM-DD | End date for custom range |
page |
Integer | Pagination page number (starts from 1) |
page_size |
Integer | Number of items per page |
status |
Specific values | Filter by status (pending, completed, cancelled, etc.) |
tier |
Specific values | Filter by tier/category |
activity |
active, inactive | Filter by activity status |
tab |
Specific values | For multi-tab dashboards (revenue, expenses, etc.) |
onro_integration/
├── webhook_handlers.py
│ └── OnroUniversalWebhookView, OnroWebhookEventListener
├── merchant_webhooks.py
│ └── OnroMerchantWebhookView
├── driver_tracking.py
│ └── OnroDriverLocationWebhookView
├── order_views.py
│ └── P&D order CRUD endpoints
├── ondemand_views.py
│ └── On-demand order endpoints
├── dashboard_views.py (3,133 lines)
│ ├── SuperAdminDashboardView
│ ├── OrderDashboardView
│ ├── RiderDashboardView
│ ├── MerchantDashboardView
│ ├── ManagementDashboardView
│ ├── CODDashboardView
│ ├── FinancialPLDashboardView
│ ├── FleetManagementDashboardView
│ ├── FraudAlertDashboardView
│ ├── AnalyticsAPIView
│ ├── ChartDataAPIView
│ ├── RealTimeDataAPIView
│ ├── ExportDataAPIView
│ └── DashboardHealthAPIView
├── dashboard_serializers.py
│ └── Data validation and serialization
├── dashboard_utils.py
│ └── Analytics calculation utilities
├── dashboard_tasks.py
│ └── Celery async tasks
└── urls.py
└── All route definitions (lines 126-143 for dashboards)
frontend/pages/
├── scheduler/dashboard.tsx
│ └── Scheduler dashboard UI
└── dispatcher/dashboard.tsx
└── Dispatcher dashboard UI
CSRF Settings:
- All webhook endpoints:
csrf_exempt = True(allows ONRO to POST without CSRF token) - Dashboard endpoints: Protected by Django session authentication
- API endpoints: May require authentication tokens or session cookies
Rate Limiting:
- Webhook endpoints: No rate limiting (to ensure no data loss)
- Dashboard endpoints: Standard Django rate limiting
- Export endpoints: May have concurrent request limits
All endpoints return JSON responses. Standard response format:
{
"status": "success",
"data": { /* endpoint-specific data */ },
"timestamp": "2026-03-04T10:30:00Z",
"message": "Optional success message"
}{
"status": "error",
"error": "Error code or message",
"details": "Detailed error description",
"timestamp": "2026-03-04T10:30:00Z"
}To test webhook integration:
-
Merchant Webhook Test:
POST /onro/webhooks/merchants/ Content-Type: application/json { "event_type": "Registered", "merchant_id": "MERCHANT_123", "timestamp": "2026-03-04T10:30:00Z" } -
Order Webhook Test:
POST /onro/webhooks/pd-orders/ Content-Type: application/json { "event_type": "order_created", "order_id": "ORD_123", "timestamp": "2026-03-04T10:30:00Z" }
- Dashboard Caching: Most dashboard data is cached for 5 minutes for better performance
- Pagination: Use
pageandpage_sizeparameters to limit data volume - Date Filtering: Always specify
date_filterto reduce query load - Async Tasks: Use Celery tasks for heavy data export operations
- Real-time Updates: Use the
/realtime/endpoint for incremental updates instead of full dashboard refreshes
Webhook Issues:
- Check
/onro/webhook-logs/for recent webhook events - Verify ONRO server can reach your endpoint
- Check firewall/NAT rules
Dashboard Performance:
- Check
/admin-dashboard/health/for system status - Review database response times
- Clear cache if data seems stale
Data Sync Issues:
- Use
POST /onro/sync/full/to trigger full sync - Check
/onro/sync/logs/for sync history - Verify API credentials in ONRO settings
Last Updated: March 28, 2026 Version: 1.1 Recent Changes: Added "Rider Earning" to Order Admin and fixed tiered pricing calculation logic in the merchant frontend to support 4+ tiers. Document Type: API Reference Documentation
For more information, refer to individual view implementations in the source files listed above.
This suite of endpoints manages integration with the SmartParcel locker network.
GET /api/orders/smart-parcel/states/
Description: Retrieves all states where SmartParcel operates.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/states/{state_id}/cities/
Description: Retrieves all cities for a specific SmartParcel state.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/boxes/city/{city_id}/
Description: Retrieves all available SmartParcel boxes in a city.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/boxes/assigned/city/{city_id}/
Description: Retrieves SmartParcel boxes assigned to the merchant in a city.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/boxes/{box_id}/
Description: Retrieves details for a specific SmartParcel box.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/locker-sizes/
Description: Retrieves all available locker sizes on the network.
Authentication: Required (Merchant)
POST /api/orders/smart-parcel/parcels/
Description: Create a new SmartParcel parcel for locker pickup/delivery.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/parcels/pending-pickups/ Description: Retrieves SmartParcel parcels awaiting pickup. Authentication: Required (Merchant)
PATCH /dispatch/orders/{order_number}/update-partner-stats/
Description: Updates processing metrics for a partner bulk order.
Authentication: Required (Dispatcher)
Request Body:
{
"rider_completed_count": 50,
"day_returned_count": 2
}
Response: Updated Order object.
GET /api/orders/smart-parcel/parcels/pending-pickups/
Description: Retrieves all pending parcels ready for pickup from the SmartParcel network.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/parcels/resolve-collect-code/{collect_code}/
Description: Resolves a collect code to a pending parcel for pickup.
Authentication: Required (Merchant)
GET /api/orders/smart-parcel/parcels/{tracking_number}/
Description: Retrieves full details for a SmartParcel parcel.
Authentication: Required (Merchant)
POST /api/orders/smart-parcel/parcels/{tracking_number}/cancel/
Description: Cancels an existing SmartParcel parcel.
Authentication: Required (Merchant)
POST /api/orders/smart-parcel/locker/simulate/drop/
Description: Triggers a simulated "dropped" state for a parcel in sandbox mode.
Authentication: Required (Merchant)
Request Body:
{
"box_id": "14",
"unlock_code": "CJ95"
}
POST /api/orders/smart-parcel/locker/simulate/collect/
Description: Triggers a simulated "collected" state for a parcel in sandbox mode.
Authentication: Required (Merchant)
Request Body:
{
"box_id": "14",
"unlock_code": "J6E7"
}
GET /merchants/
Description: Retrieves a list of all merchants.
Authentication: Required (Dispatcher)
Response: Paginated list of Merchant objects.
DELETE /merchants/{id}/
Description: Soft-deactivates a merchant account.
Authentication: Required (Dispatcher Admin)
Response:
{
"status": "success",
"message": "Merchant deactivated successfully."
}