The Pre-Sale Monitoring & Customer Operations API (/v1/pre-sale/monitoring and /v1/pre-sale/customers) provides real-time field visibility for supervisors and dispatch coordinators. It enables tracking sales representatives along their daily routes, visualizing customer drop-off points inside territory boundary polygons, updating geolocation from the field, and querying customer credit balances in real time.
/v1/pre-sale/monitoring
/v1/pre-sale/customers
App\Http\Controllers\V1\Backend\PreSale\PresaleMonitoringControllerApp\Http\Controllers\V1\Backend\PreSale\Customers\CustomerControllerroutes/v1/backend/pre-sale/pre-monitoring.phproutes/v1/backend/pre-sale/customers/customers.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
All requests require companyId context (via query parameter ?companyId={id} or request body).
/v1/pre-sale/monitoring)| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/pre-sale/monitoring/teams |
List sales teams that the authenticated supervisor is authorized to monitor |
GET |
/v1/pre-sale/monitoring/sellers |
List active field sellers for a given team (?companyId={id}&teamId={id}) |
GET |
/v1/pre-sale/monitoring/customer-locations |
Query GPS coordinates of all customers in a team's route |
GET |
/v1/pre-sale/monitoring/polygons |
Retrieve geographic territory boundary polygons for map overlays |
GET /v1/pre-sale/monitoring/teams?companyId=1
200 OK{
"success": true,
"message": "Operación exitosa.",
"data": [
{
"id": 3,
"code": "EQ-LIMA-NORTE",
"name": "EQUIPO PREVENTA NORTE",
"company_id": 1,
"status": "A"
},
{
"id": 5,
"code": "EQ-LIMA-CENTRO",
"name": "EQUIPO PREVENTA CENTRO",
"company_id": 1,
"status": "A"
}
]
}
GET /v1/pre-sale/monitoring/sellers?companyId=1&teamId=3
200 OK{
"success": true,
"data": [
{
"id": 42,
"code": "V012",
"name": "CARLOS MENDOZA",
"phone": "987654321",
"portfolio_count": 2,
"customers_assigned": 184,
"orders_today": 18,
"nosales_today": 2,
"last_activity": "2026-10-13 14:22:15"
}
]
}
GET /v1/pre-sale/monitoring/customer-locations?companyId=1&teamId=3
200 OK{
"success": true,
"data": [
{
"customer_id": 1045,
"card_code": "C20485918231",
"commercial_name": "BODEGA DOÑA ROSA",
"latitude": -12.0854,
"longitude": -77.0345,
"visited_today": true,
"has_order": true,
"order_amount": 345.50
}
]
}
GET /v1/pre-sale/monitoring/polygons?companyId=1&teamId=3
200 OK{
"success": true,
"data": [
{
"team_id": 3,
"territory_id": 14,
"territory_name": "ZONA COMERCIAL SAN JUAN",
"color": "#1976D2",
"coordinates": [
[-12.0800, -77.0400],
[-12.0800, -77.0300],
[-12.0900, -77.0300],
[-12.0900, -77.0400],
[-12.0800, -77.0400]
]
}
]
}
/v1/pre-sale/customers)Allows field agents and mobile applications to audit, update coordinates, reclassify business categories, and inspect customer financial positions.
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/pre-sale/customers/{id}/locations |
Query registered delivery locations and drop-off points for customer |
POST |
/v1/pre-sale/customers/{id}/locations |
Save or update GPS coordinates captured on-site by field seller |
POST |
/v1/pre-sale/customers/{id}/business-type |
Update customer commercial trade classification (Bodega, Restaurant, etc.) |
GET |
/v1/pre-sale/customers/{id}/balance |
Query live SAP B1 credit balance, consumed credit, and overdue debts |
GET |
/v1/pre-sale/customers/{id}/sales-documents |
Query historical invoices and billing receipts for the client |
GET |
/v1/pre-sale/customers/{id}/orders |
Retrieve past order history |
POST /v1/pre-sale/customers/1045/locations
Content-Type: application/json
{
"company_id": 1,
"latitude": -12.085412,
"longitude": -77.034518,
"accuracy": 4.5,
"address": "Av. Las Palmeras 1245, Los Olivos",
"notes": "Frente al parque central"
}
200 OK{
"success": true,
"message": "Ubicación del cliente actualizada correctamente."
}
Queries live accounting balances directly from SAP Business One or local mirrors.
GET /v1/pre-sale/customers/1045/balance?companyId=1&sellerId=42&customerCode=C20485918231
200 OK{
"success": true,
"data": {
"customer_id": 1045,
"card_code": "C20485918231",
"card_name": "DISTRIBUIDORA SAN JUAN S.A.C.",
"currency": "PEN",
"credit_limit": 50000.00,
"balance": 14200.50,
"available_credit": 35799.50,
"overdue_debt": 0.00,
"has_overdue_invoices": false,
"overdue_days_max": 0,
"payment_term": "15 Días Crédito"
}
}
POST /v1/pre-sale/customers/1045/business-type
Content-Type: application/json
{
"company_id": 1,
"business_type_id": 2
}
200 OK{
"success": true,
"message": "Tipo de negocio actualizado correctamente."
}