The Pre-Sale Statistics & Reports Module (/v1/pre-sale/orders-statistics, /v1/pre-sale/reports, and /v1/pre-sale/promotions) provides data aggregation services for operations managers, commercial directors, and billing controllers. It feeds live KPI cards, executive widgets, daily seller visit reports, monthly quota achievement matrices, and available promotions.
/v1/pre-sale/orders-statistics
/v1/pre-sale/reports
/v1/pre-sale/promotions
App\Http\Controllers\V1\Backend\PreSale\Orders\OrderStatisticsControllerApp\Http\Controllers\V1\Backend\PreSale\Reports\PreSaleReportControllerApp\Http\Controllers\V1\Backend\PreSale\Promotions\PromotionControllerroutes/v1/backend/pre-sale/orders/orders-statistics.phproutes/v1/backend/pre-sale/reports/report.phproutes/v1/backend/pre-sale/promotions/promotions.phproutes/v1/backend/pre-sale/pre-sale.php.Authorization: Bearer <access_token>
x-app-stage: <stage>
x-app-uid: <application_uuid>
Content-Type: application/json
Accept: application/json
/v1/pre-sale/orders-statistics)Enforces company-validator middleware. All requests accept optional ?date=YYYY-MM-DD (defaults to current date) and ?companyId={id}.
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/pre-sale/orders-statistics/widget-status-date |
Aggregates order count and monetary totals grouped by commercial status |
GET |
/v1/pre-sale/orders-statistics/widget-zone-date |
Order distribution breakdown grouped by delivery and sales zones |
GET |
/v1/pre-sale/orders-statistics/widget-zone-date-pendings |
Pending orders awaiting commercial validation grouped by zone |
GET |
/v1/pre-sale/orders-statistics/widget-zone-date-pendings-for-invoice |
Orders approved and scheduled for dispatch, pending billing invoice generation |
GET |
/v1/pre-sale/orders-statistics/widget-zone-date-retaineds |
Orders blocked or retained due to credit limit violations or customer debt arrears |
GET /v1/pre-sale/orders-statistics/widget-status-date?companyId=1&date=2026-10-13
200 OK{
"success": true,
"message": "Operación exitosa.",
"data": {
"date": "2026-10-13",
"summary": {
"total_orders": 342,
"total_amount": 185420.50
},
"by_status": [
{
"status": "APPROVED",
"label": "Aprobados",
"count": 280,
"amount": 152300.00
},
{
"status": "PENDING",
"label": "Pendientes de Autorización",
"count": 42,
"amount": 24120.50
},
{
"status": "RETAINED",
"label": "Retenidos por Crédito",
"count": 14,
"amount": 7800.00
},
{
"status": "CANCELLED",
"label": "Anulados",
"count": 6,
"amount": 1200.00
}
]
}
}
Identifies bottled orders ready for warehouse picking that need electronic invoices emitted before trucks depart.
GET /v1/pre-sale/orders-statistics/widget-zone-date-pendings-for-invoice?companyId=1&date=2026-10-13
200 OK{
"success": true,
"data": [
{
"zone_id": 4,
"zone_code": "Z-NORTE-01",
"zone_name": "CONO NORTE LIMA",
"pending_orders": 65,
"total_amount": 34800.00
},
{
"zone_id": 7,
"zone_code": "Z-SUR-02",
"zone_name": "CHORRILLOS / SURCO",
"pending_orders": 48,
"total_amount": 26150.00
}
]
}
/v1/pre-sale/reports)| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/pre-sale/reports/seller-daily-report/{companyId}/{sellerId}/{date} |
Comprehensive day-level operational report for a specific seller |
GET |
/v1/pre-sale/reports/seller-monthly-report/{companyId}/{sellerId}/{period} |
Monthly cumulative performance, quota progress, and commission totals |
GET /v1/pre-sale/reports/seller-daily-report/1/42/2026-10-13
companyId (int): Company identifier.sellerId (int): Seller primary ID.date (string): Date in YYYY-MM-DD format.200 OK{
"success": true,
"data": {
"seller_id": 42,
"seller_name": "CARLOS MENDOZA",
"date": "2026-10-13",
"route": "RUTA LIMA NORTE 04",
"metrics": {
"scheduled_customers": 45,
"visited_customers": 42,
"orders_taken": 35,
"effective_drop_percent": 83.3,
"no_sales_count": 7,
"unvisited_count": 3
},
"sales": {
"total_amount": 14250.00,
"physical_cases": 285.0,
"hectoliters": 57.0,
"daily_quota": 13000.00,
"quota_achievement_percent": 109.6
},
"no_sale_reasons": [
{
"reason_code": "CLOSED_STORE",
"description": "Local Cerrado",
"count": 4
},
{
"reason_code": "HIGH_STOCK",
"description": "Stock Suficiente",
"count": 3
}
]
}
}
GET /v1/pre-sale/reports/seller-monthly-report/1/42/2026-10
companyId (int): Company identifier.sellerId (int): Seller primary ID.period (string): Monthly period in YYYY-MM format.200 OK{
"success": true,
"data": {
"seller_id": 42,
"period": "2026-10",
"working_days": 26,
"days_elapsed": 12,
"monthly_target_amount": 320000.00,
"accumulated_sales_amount": 168400.00,
"accumulated_achievement_percent": 52.6,
"projected_finish_percent": 114.0,
"estimated_commission": 2450.00
}
}
/v1/pre-sale/promotions)Provides the active commercial promotion catalog, volume discount matrices, and promotional bundle definitions to handheld devices.
GET /v1/pre-sale/promotions/1/avalible?sellerId=42
id (int): Target companyId.sellerId (int, required): Sales representative ID.200 OK{
"success": true,
"data": [
{
"id": 108,
"name": "CAMPAÑA VERANO CRISTAL 10+1",
"strategy": "BONIFICATION_FIXED",
"valid_from": "2026-10-01",
"valid_to": "2026-10-31",
"buy_product_id": 1050,
"buy_quantity": 10,
"bonus_product_id": 1050,
"bonus_quantity": 1,
"max_applications_per_order": 5
}
]
}