Customer Management
Customer Management
Manage your pharmacy’s patients — view their profiles, create new customers, and add them to medication plans. All customer data is securely stored and HIPAA-compliant.
List All Customers
View all customers registered with your pharmacy.
# Fetch customers with paginationfetchCustomers({ page: 1, limit: 20, search: "John" // optional: filter by name/phone})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (default: 1) |
limit | number | No | Results per page (default: 20, max: 100) |
search | string | No | Search by name or phone number |
Response:
{ "customers": [ { "id": "CUST-123", "name": "John Doe", "phone": "+2348012345678", "email": "john@example.com", "address": "12 Admiralty Way, Lekki", "planCount": 2, "totalOrders": 15, "createdAt": "2025-01-15T10:30:00Z", "lastOrder": "2026-04-10T14:20:00Z" }, { "id": "CUST-124", "name": "Jane Smith", "phone": "+2348098765432", "email": "jane@example.com", "address": "45 Ozumba Mbadiwe, VI", "planCount": 1, "totalOrders": 8, "createdAt": "2025-03-20T09:15:00Z", "lastOrder": "2026-04-15T11:00:00Z" } ], "total": 245, "page": 1, "hasMore": true}Create New Customer
Add a new customer to your pharmacy.
# Create new customer recordaddProviderCustomer({ name: "Sarah Johnson", phone: "+2348055555555", email: "sarah@example.com", address: "15 Banana Island, Ikoyi", dateOfBirth: "1985-06-15", allergies: ["Penicillin", "Sulfa drugs"], medicalConditions: ["Hypertension"]})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name |
phone | string | Yes | Phone number (international format) |
email | string | No | Email address |
address | string | No | Delivery address |
dateOfBirth | string | No | Date of birth (YYYY-MM-DD) |
allergies | array | No | List of known allergies |
medicalConditions | array | No | Chronic conditions |
Response:
{ "success": true, "customerId": "CUST-456", "message": "Customer created successfully", "createdAt": "2026-04-18T12:00:00Z"}View Customer Details
Get comprehensive information about a specific customer.
# View full customer profileviewProviderCustomerDetails({ customerId: "CUST-123"})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | Customer ID |
Response:
{ "id": "CUST-123", "name": "John Doe", "phone": "+2348012345678", "email": "john@example.com", "address": "12 Admiralty Way, Lekki, Lagos", "dateOfBirth": "1980-03-25", "allergies": ["Penicillin"], "medicalConditions": ["Diabetes Type 2", "Hypertension"], "stats": { "totalOrders": 15, "totalSpent": 125000, "activePlans": 2, "lastOrder": "2026-04-10T14:20:00Z" }, "plans": [ { "id": "PLAN-789", "name": "Diabetes Monthly", "medications": ["Metformin 500mg", "Insulin Glargine"], "status": "active", "nextDelivery": "2026-05-10" } ], "recentOrders": [ { "orderId": "ORD-456", "date": "2026-04-10T14:20:00Z", "total": 8500, "status": "completed" } ], "notes": "Prefers morning deliveries. Contact before arrival.", "createdAt": "2025-01-15T10:30:00Z"}Add Customer to Plan
Enroll a customer in a medication plan.
# Add customer to subscription planaddCustomerPlan({ customerId: "CUST-123", planId: "PLAN-456", startDate: "2026-05-01", preferences: { deliveryDay: "Monday", deliveryTime": "morning" }})Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | Customer ID |
planId | string | Yes | Plan ID to enroll in |
startDate | string | No | When plan starts (default: today) |
preferences | object | No | Delivery preferences |
Response:
{ "success": true, "subscriptionId": "SUB-789", "plan": { "id": "PLAN-456", "name": "Hypertension Care", "medications": ["Amlodipine 5mg", "Lisinopril 10mg"], "frequency": "monthly", "price": 15000 }, "nextDelivery": "2026-05-01", "status": "active"}Update Customer
Modify customer information.
# Update customer detailsupdateProviderCustomer({ customerId: "CUST-123", email: "john.doe@newdomain.com", address: "20 Admiralty Way, Lekki Phase 1", allergies: ["Penicillin", "Ibuprofen"]})Customer Segments
Group customers for targeted campaigns:
# Get customers by conditiongetCustomersByCondition({ condition: "diabetes" })
# Get customers with upcoming refillsgetCustomersWithUpcomingRefills({ days: 7 })
# Get high-value customersgetHighValueCustomers({ minSpend: 100000 })Example: Customer Workflow
# Step 1: Search for customerfetchCustomers({ search: "John" })# → Returns matching customers
# Step 2: View customer detailsviewProviderCustomerDetails({ customerId: "CUST-123" })# → Shows full profile and history
# Step 3: Add to medication planaddCustomerPlan({ customerId: "CUST-123", planId: "PLAN-456"})# → Customer enrolled in planData Privacy
- All customer data is encrypted at rest
- HIPAA-compliant storage
- Access logs for audit trails
- Consent required for marketing communications