Customer Management API
This document covers the customer management functionality within the AttuneLogic API, supporting both trucking and service industry customer relationship management.
🎯 Overview
The Customer Management API provides endpoints to manage customer data, service history, and relationships across different industry contexts.
🏭 Industry Contexts
Trucking Industry
- Shippers: Companies that need freight moved
- Consignees: Companies receiving freight
- Brokers: Intermediaries facilitating loads
Service Industries
- Residential Customers: Home service clients
- Commercial Customers: Business service clients
- Property Managers: Multi-location service coordination
📋 Core Endpoints
Customer Creation
POST /api/v1/customers
Content-Type: application/json
Authorization: Bearer <token>
{
"name": "ABC Manufacturing",
"type": "commercial", // 'residential', 'commercial', 'shipper', 'consignee'
"industry": "manufacturing",
"contactInfo": {
"email": "contact@abcmfg.com",
"phone": "(555) 123-4567",
"primaryContact": "John Smith"
},
"addresses": [{
"type": "primary", // 'primary', 'billing', 'shipping', 'service'
"street": "123 Industrial Blvd",
"city": "Manufacturing City",
"state": "TX",
"zipCode": "75001",
"coordinates": [-96.8352, 32.6839]
}],
"preferences": {
"preferredServiceWindow": "8am-5pm",
"communicationMethod": "email", // 'email', 'phone', 'text'
"emergencyContact": "(555) 987-6543"
}
}
Customer Retrieval
GET /api/v1/customers
GET /api/v1/customers/:id
GET /api/v1/customers/search?q=<query>&type=<type>
Customer Updates
PUT /api/v1/customers/:id
PATCH /api/v1/customers/:id
🔄 Service History Management
Service Records
GET /api/v1/customers/:id/services
POST /api/v1/customers/:id/services
{
"serviceDate": "2024-01-15T10:00:00Z",
"serviceType": "HVAC Maintenance",
"technician": "64a7b8c9d1e2f3g4h5i6j7k8",
"equipment": ["64a7b8c9d1e2f3g4h5i6j7k9"],
"partsUsed": [{
"partNumber": "FILTER-001",
"quantity": 1,
"description": "Air Filter"
}],
"notes": "Annual maintenance completed",
"followUpRequired": false
}
Equipment Associations
GET /api/v1/customers/:id/equipment
POST /api/v1/customers/:id/equipment
🚛 Trucking-Specific Features
Load Management
GET /api/v1/customers/:id/loads
POST /api/v1/customers/:id/loads
{
"pickupLocation": "64a7b8c9d1e2f3g4h5i6j7k8",
"deliveryLocation": "64a7b8c9d1e2f3g4h5i6j7k9",
"loadDetails": {
"weight": 25000,
"commodity": "Electronics",
"value": 50000
},
"scheduledPickup": "2024-01-20T08:00:00Z",
"scheduledDelivery": "2024-01-22T17:00:00Z"
}
Rate Management
GET /api/v1/customers/:id/rates
POST /api/v1/customers/:id/rates
🔧 Service Industry Features
Equipment Tracking
Track customer equipment for maintenance scheduling:
GET /api/v1/customers/:id/equipment-schedule
POST /api/v1/customers/:id/equipment-schedule
Recurring Services
Set up automatic service scheduling:
GET /api/v1/customers/:id/recurring-services
POST /api/v1/customers/:id/recurring-services
{
"serviceType": "HVAC Quarterly Maintenance",
"frequency": "quarterly",
"startDate": "2024-01-01",
"preferredTime": "10:00",
"technician": "64a7b8c9d1e2f3g4h5i6j7k8"
}
📊 Customer Analytics
Service Metrics
GET /api/v1/customers/:id/analytics
Returns:
- Service frequency
- Average response time
- Customer satisfaction scores
- Revenue metrics
🔐 Security & Permissions
- All customer data is isolated by company/tenant
- Role-based access controls apply
- Customer PII is encrypted at rest
- Audit trails maintained for all changes