Skip to content

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.

Terminal window
# Fetch customers with pagination
fetchCustomers({
page: 1,
limit: 20,
search: "John" // optional: filter by name/phone
})

Parameters:

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
limitnumberNoResults per page (default: 20, max: 100)
searchstringNoSearch 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.

Terminal window
# Create new customer record
addProviderCustomer({
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:

ParameterTypeRequiredDescription
namestringYesFull name
phonestringYesPhone number (international format)
emailstringNoEmail address
addressstringNoDelivery address
dateOfBirthstringNoDate of birth (YYYY-MM-DD)
allergiesarrayNoList of known allergies
medicalConditionsarrayNoChronic 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.

Terminal window
# View full customer profile
viewProviderCustomerDetails({
customerId: "CUST-123"
})

Parameters:

ParameterTypeRequiredDescription
customerIdstringYesCustomer 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.

Terminal window
# Add customer to subscription plan
addCustomerPlan({
customerId: "CUST-123",
planId: "PLAN-456",
startDate: "2026-05-01",
preferences: {
deliveryDay: "Monday",
deliveryTime": "morning"
}
})

Parameters:

ParameterTypeRequiredDescription
customerIdstringYesCustomer ID
planIdstringYesPlan ID to enroll in
startDatestringNoWhen plan starts (default: today)
preferencesobjectNoDelivery 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.

Terminal window
# Update customer details
updateProviderCustomer({
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:

Terminal window
# Get customers by condition
getCustomersByCondition({ condition: "diabetes" })
# Get customers with upcoming refills
getCustomersWithUpcomingRefills({ days: 7 })
# Get high-value customers
getHighValueCustomers({ minSpend: 100000 })

Example: Customer Workflow

Terminal window
# Step 1: Search for customer
fetchCustomers({ search: "John" })
# → Returns matching customers
# Step 2: View customer details
viewProviderCustomerDetails({ customerId: "CUST-123" })
# → Shows full profile and history
# Step 3: Add to medication plan
addCustomerPlan({
customerId: "CUST-123",
planId: "PLAN-456"
})
# → Customer enrolled in plan

Data Privacy

  • All customer data is encrypted at rest
  • HIPAA-compliant storage
  • Access logs for audit trails
  • Consent required for marketing communications

Next steps