Dermifi API Documentation

Comprehensive REST API for dermatology practice management, patient care, and prescription workflows

API Overview

REST
Architecture
HIPAA
Compliant

Base Configuration

Base URL

https://api.dermifi.com/v1

Authentication

Authorization: Bearer {your_api_token}

All API requests must include this header

Content-Type

Content-Type: application/json

All request bodies must be valid JSON

IP Allowlist

Speak with your solutions engineer so that we can add your IPs to our allowlist

Required for production API access

Authentication API

POST/auth/login
Authenticate user and obtain access token

Request Body

{
  "email": "provider@dermifi.com",
  "password": "SecurePass123!",
  "mfaCode": "123456"
}

Response (200)

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIs...",
  "tokenType": "Bearer",
  "expiresIn": 3600,
  "user": {
    "id": "usr_123",
    "email": "provider@dermifi.com",
    "role": "provider",
    "permissions": ["read", "write", "prescribe"]
  }
}
POST/auth/refresh
Refresh access token

Request Body

{
  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}

Response (200)

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "tokenType": "Bearer",
  "expiresIn": 3600
}
POST/auth/logout
Revoke current access token

Request Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Response (204)

No Content - Token successfully revoked

Patients API

GET/patients
List all patients with pagination and filtering

Query Parameters

?page=1&limit=20&search=john&status=active&sortBy=lastName&order=asc

• page: Page number (default: 1)

• limit: Items per page (default: 20, max: 100)

• search: Search by name, email, or phone

• status: Filter by status (active|inactive|pending)

• sortBy: Sort field (lastName|firstName|createdAt)

• order: Sort order (asc|desc)

Response (200)

{
  "data": [
    {
      "id": "pat_123",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@email.com",
      "phone": "+1 (555) 123-4567",
      "dateOfBirth": "1985-06-15",
      "gender": "male",
      "address": {
        "street": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "zipCode": "94105"
      },
      "insurance": {
        "provider": "Blue Cross",
        "memberId": "BC123456789",
        "groupNumber": "GRP001"
      },
      "status": "active",
      "createdAt": "2024-01-01T12:00:00Z",
      "updatedAt": "2024-01-15T14:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8,
    "hasNext": true,
    "hasPrevious": false
  }
}
POST/patients
Create a new patient

Request Body

{
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jane.smith@email.com",
  "phone": "+1 (555) 987-6543",
  "dateOfBirth": "1990-03-21",
  "gender": "female",
  "address": {
    "street": "456 Oak Ave",
    "city": "Los Angeles",
    "state": "CA",
    "zipCode": "90001"
  },
  "emergencyContact": {
    "name": "John Smith",
    "relationship": "spouse",
    "phone": "+1 (555) 987-6544"
  },
  "insurance": {
    "provider": "Aetna",
    "memberId": "AET987654321",
    "groupNumber": "GRP002",
    "copay": 25
  },
  "allergies": ["penicillin", "sulfa"],
  "medications": ["lisinopril 10mg daily"],
  "conditions": ["hypertension"],
  "consentToTreat": true,
  "hipaaConsent": true
}

Response (201)

{
  "id": "pat_124",
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jane.smith@email.com",
  "phone": "+1 (555) 987-6543",
  "dateOfBirth": "1990-03-21",
  "gender": "female",
  "address": {
    "street": "456 Oak Ave",
    "city": "Los Angeles",
    "state": "CA",
    "zipCode": "90001"
  },
  "emergencyContact": {
    "name": "John Smith",
    "relationship": "spouse",
    "phone": "+1 (555) 987-6544"
  },
  "insurance": {
    "provider": "Aetna",
    "memberId": "AET987654321",
    "groupNumber": "GRP002",
    "copay": 25,
    "verified": false
  },
  "allergies": ["penicillin", "sulfa"],
  "medications": ["lisinopril 10mg daily"],
  "conditions": ["hypertension"],
  "status": "active",
  "patientNumber": "P-2024-0124",
  "createdAt": "2024-01-20T10:00:00Z",
  "updatedAt": "2024-01-20T10:00:00Z"
}
GET/patients/{id}
Get specific patient details

Path Parameter

id: pat_123

Query Parameters (Optional)

?include=appointments,prescriptions,notes

Response (200)

{
  "id": "pat_123",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@email.com",
  "phone": "+1 (555) 123-4567",
  "dateOfBirth": "1985-06-15",
  "age": 38,
  "gender": "male",
  "address": {
    "street": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "zipCode": "94105"
  },
  "emergencyContact": {
    "name": "Jane Doe",
    "relationship": "spouse",
    "phone": "+1 (555) 123-4568"
  },
  "insurance": {
    "provider": "Blue Cross",
    "memberId": "BC123456789",
    "groupNumber": "GRP001",
    "copay": 20,
    "verified": true,
    "verifiedAt": "2024-01-10T09:00:00Z"
  },
  "allergies": ["peanuts", "latex"],
  "medications": ["metformin 500mg twice daily"],
  "conditions": ["diabetes type 2", "hypertension"],
  "lastVisit": "2024-01-10T14:00:00Z",
  "nextAppointment": "2024-02-15T10:00:00Z",
  "provider": {
    "id": "prov_789",
    "name": "Dr. Emily Johnson"
  },
  "status": "active",
  "createdAt": "2024-01-01T12:00:00Z",
  "updatedAt": "2024-01-15T14:30:00Z"
}
PUT/patients/{id}
Update patient information

Request Body

{
  "email": "john.newemail@email.com",
  "phone": "+1 (555) 999-8888",
  "address": {
    "street": "789 New Street",
    "city": "San Francisco",
    "state": "CA",
    "zipCode": "94110"
  },
  "insurance": {
    "provider": "Kaiser Permanente",
    "memberId": "KP987654321",
    "groupNumber": "GRP003",
    "copay": 30
  },
  "medications": [
    "metformin 500mg twice daily",
    "lisinopril 10mg daily"
  ]
}

Response (200)

{
  "id": "pat_123",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.newemail@email.com",
  "phone": "+1 (555) 999-8888",
  "dateOfBirth": "1985-06-15",
  "gender": "male",
  "address": {
    "street": "789 New Street",
    "city": "San Francisco",
    "state": "CA",
    "zipCode": "94110"
  },
  "insurance": {
    "provider": "Kaiser Permanente",
    "memberId": "KP987654321",
    "groupNumber": "GRP003",
    "copay": 30,
    "verified": false
  },
  "medications": [
    "metformin 500mg twice daily",
    "lisinopril 10mg daily"
  ],
  "updatedAt": "2024-01-20T15:00:00Z",
  "updatedBy": "usr_456"
}
DELETE/patients/{id}
Soft delete patient (mark as inactive)

Path Parameter

id: pat_123

Request Body (Optional)

{
  "reason": "patient_request",
  "notes": "Patient moved to another state"
}

Response (200)

{
  "id": "pat_123",
  "status": "inactive",
  "deactivatedAt": "2024-01-20T16:00:00Z",
  "deactivatedBy": "usr_456",
  "reason": "patient_request",
  "notes": "Patient moved to another state",
  "dataRetentionDate": "2031-01-20T16:00:00Z"
}
GET/patients/{id}/history
Get patient medical history

Query Parameters

?startDate=2024-01-01&endDate=2024-12-31&type=visit

• startDate: Filter from date (ISO 8601)

• endDate: Filter to date (ISO 8601)

• type: History type (visit|prescription|lab|imaging|all)

Response (200)

{
  "patientId": "pat_123",
  "history": [
    {
      "id": "hist_001",
      "date": "2024-01-10T14:00:00Z",
      "type": "visit",
      "provider": {
        "id": "prov_789",
        "name": "Dr. Emily Johnson"
      },
      "chiefComplaint": "Annual skin check",
      "diagnosis": ["Actinic keratosis", "Seborrheic keratosis"],
      "treatment": "Cryotherapy",
      "notes": "Multiple lesions treated",
      "followUp": "3 months"
    },
    {
      "id": "hist_002",
      "date": "2023-10-15T10:00:00Z",
      "type": "visit",
      "provider": {
        "id": "prov_789",
        "name": "Dr. Emily Johnson"
      },
      "chiefComplaint": "Suspicious mole",
      "diagnosis": ["Dysplastic nevus"],
      "treatment": "Excision biopsy",
      "pathology": {
        "result": "Benign",
        "reportDate": "2023-10-20T00:00:00Z"
      }
    }
  ],
  "totalRecords": 15,
  "dateRange": {
    "from": "2024-01-01T00:00:00Z",
    "to": "2024-12-31T23:59:59Z"
  }
}
POST/patients/{id}/photos
Upload patient photos

Request Body (multipart/form-data)

{
  "photo": <binary>,
  "type": "lesion",
  "bodyPart": "left_forearm",
  "description": "Pigmented lesion, 8mm diameter",
  "takenAt": "2024-01-20T11:00:00Z",
  "metadata": {
    "dermoscopy": true,
    "magnification": "10x",
    "lighting": "polarized"
  }
}

Response (201)

{
  "id": "photo_456",
  "patientId": "pat_123",
  "url": "https://storage.dermifi.com/photos/photo_456.jpg",
  "thumbnailUrl": "https://storage.dermifi.com/photos/thumb_456.jpg",
  "type": "lesion",
  "bodyPart": "left_forearm",
  "description": "Pigmented lesion, 8mm diameter",
  "takenAt": "2024-01-20T11:00:00Z",
  "uploadedAt": "2024-01-20T11:05:00Z",
  "uploadedBy": "usr_456",
  "metadata": {
    "dermoscopy": true,
    "magnification": "10x",
    "lighting": "polarized",
    "fileSize": "2.5MB",
    "dimensions": "3024x4032"
  }
}
GET/patients/{id}/photos
Get patient photos

Query Parameters

?type=lesion&bodyPart=left_forearm&limit=10

Response (200)

{
  "photos": [
    {
      "id": "photo_456",
      "url": "https://storage.dermifi.com/photos/photo_456.jpg",
      "thumbnailUrl": "https://storage.dermifi.com/photos/thumb_456.jpg",
      "type": "lesion",
      "bodyPart": "left_forearm",
      "description": "Pigmented lesion, 8mm diameter",
      "takenAt": "2024-01-20T11:00:00Z",
      "uploadedAt": "2024-01-20T11:05:00Z",
      "uploadedBy": {
        "id": "usr_456",
        "name": "Dr. Emily Johnson"
      }
    },
    {
      "id": "photo_455",
      "url": "https://storage.dermifi.com/photos/photo_455.jpg",
      "thumbnailUrl": "https://storage.dermifi.com/photos/thumb_455.jpg",
      "type": "lesion",
      "bodyPart": "left_forearm",
      "description": "Same lesion, 3 months prior",
      "takenAt": "2023-10-20T10:00:00Z",
      "uploadedAt": "2023-10-20T10:05:00Z"
    }
  ],
  "total": 2
}
POST/patients/{id}/notes
Add clinical note

Request Body

{
  "type": "progress_note",
  "visitId": "visit_789",
  "content": {
    "chiefComplaint": "Follow-up for acne treatment",
    "hpi": "Patient reports improvement with tretinoin...",
    "examination": "Facial examination shows decreased comedones...",
    "assessment": "Acne vulgaris - improving",
    "plan": "Continue current regimen, follow-up in 6 weeks"
  },
  "icd10Codes": ["L70.0"],
  "cptCodes": ["99213"],
  "confidential": false
}

Response (201)

{
  "id": "note_987",
  "patientId": "pat_123",
  "type": "progress_note",
  "visitId": "visit_789",
  "content": {
    "chiefComplaint": "Follow-up for acne treatment",
    "hpi": "Patient reports improvement with tretinoin...",
    "examination": "Facial examination shows decreased comedones...",
    "assessment": "Acne vulgaris - improving",
    "plan": "Continue current regimen, follow-up in 6 weeks"
  },
  "icd10Codes": ["L70.0"],
  "cptCodes": ["99213"],
  "createdAt": "2024-01-20T14:30:00Z",
  "createdBy": {
    "id": "prov_789",
    "name": "Dr. Emily Johnson"
  },
  "signedAt": "2024-01-20T14:35:00Z",
  "locked": true
}

Providers API

GET/providers
List all providers

Query Parameters

?specialty=dermatology&available=true&location=SF

Response (200)

{
  "providers": [
    {
      "id": "prov_789",
      "firstName": "Emily",
      "lastName": "Johnson",
      "title": "MD",
      "specialty": "Dermatology",
      "npiNumber": "1234567890",
      "licenseNumber": "CA12345",
      "licenseState": "CA",
      "email": "ejohnson@dermifi.com",
      "phone": "+1 (555) 111-2222",
      "locations": ["SF", "Oakland"],
      "languages": ["English", "Spanish"],
      "acceptingNewPatients": true,
      "rating": 4.8,
      "reviewCount": 245,
      "yearsOfExperience": 12,
      "education": [
        {
          "degree": "MD",
          "institution": "Stanford University",
          "year": 2008
        }
      ],
      "certifications": [
        "American Board of Dermatology"
      ]
    }
  ],
  "total": 15
}
POST/providers
Add new provider

Request Body

{
  "firstName": "Michael",
  "lastName": "Chen",
  "title": "MD, PhD",
  "specialty": "Dermatology",
  "subspecialty": "Mohs Surgery",
  "npiNumber": "9876543210",
  "licenseNumber": "CA54321",
  "licenseState": "CA",
  "licenseExpiry": "2025-12-31",
  "deaNumber": "BC1234567",
  "email": "mchen@dermifi.com",
  "phone": "+1 (555) 333-4444",
  "locations": ["SF", "San Jose"],
  "languages": ["English", "Mandarin", "Cantonese"],
  "acceptingNewPatients": true,
  "education": [
    {
      "degree": "MD",
      "institution": "Harvard Medical School",
      "year": 2010
    },
    {
      "degree": "PhD",
      "institution": "MIT",
      "year": 2008
    }
  ],
  "residency": {
    "institution": "UCSF",
    "specialty": "Dermatology",
    "completionYear": 2014
  },
  "fellowship": {
    "institution": "Mayo Clinic",
    "specialty": "Mohs Surgery",
    "completionYear": 2015
  },
  "certifications": [
    "American Board of Dermatology",
    "American College of Mohs Surgery"
  ]
}

Response (201)

{
  "id": "prov_790",
  "firstName": "Michael",
  "lastName": "Chen",
  "title": "MD, PhD",
  "specialty": "Dermatology",
  "subspecialty": "Mohs Surgery",
  "npiNumber": "9876543210",
  "licenseNumber": "CA54321",
  "licenseState": "CA",
  "licenseExpiry": "2025-12-31",
  "licenseVerified": false,
  "deaNumber": "BC1234567",
  "email": "mchen@dermifi.com",
  "phone": "+1 (555) 333-4444",
  "locations": ["SF", "San Jose"],
  "languages": ["English", "Mandarin", "Cantonese"],
  "acceptingNewPatients": true,
  "status": "pending_verification",
  "createdAt": "2024-01-20T12:00:00Z"
}
GET/providers/{id}/schedule
Get provider schedule

Query Parameters

?date=2024-01-20&location=SF

Response (200)

{
  "providerId": "prov_789",
  "date": "2024-01-20",
  "location": "SF",
  "schedule": {
    "workingHours": {
      "start": "09:00",
      "end": "17:00",
      "break": {
        "start": "12:00",
        "end": "13:00"
      }
    },
    "appointments": [
      {
        "time": "09:00",
        "duration": 30,
        "patientId": "pat_123",
        "type": "follow_up",
        "status": "confirmed"
      },
      {
        "time": "09:30",
        "duration": 30,
        "patientId": "pat_124",
        "type": "consultation",
        "status": "confirmed"
      }
    ],
    "availableSlots": [
      "10:00", "10:30", "11:00", "11:30",
      "13:00", "13:30", "14:00", "14:30",
      "15:00", "15:30", "16:00", "16:30"
    ]
  }
}

Orders API

POST/orders
Create new order

Request Body

{
  "patientId": "pat_123",
  "providerId": "prov_789",
  "type": "prescription",
  "priority": "routine",
  "items": [
    {
      "type": "medication",
      "name": "Tretinoin Cream 0.025%",
      "quantity": 1,
      "unit": "tube",
      "size": "45g",
      "instructions": "Apply thin layer to affected areas nightly"
    },
    {
      "type": "medication",
      "name": "Clindamycin Gel 1%",
      "quantity": 1,
      "unit": "tube",
      "size": "30g",
      "instructions": "Apply twice daily to affected areas"
    }
  ],
  "pharmacy": {
    "id": "pharm_456",
    "name": "CVS Pharmacy",
    "address": "123 Market St, San Francisco, CA 94105",
    "phone": "+1 (555) 678-9012",
    "fax": "+1 (555) 678-9013"
  },
  "shipping": {
    "method": "mail",
    "address": {
      "street": "123 Main St",
      "city": "San Francisco",
      "state": "CA",
      "zipCode": "94105"
    },
    "expedited": false
  },
  "notes": "Patient prefers generic if available"
}

Response (201)

{
  "id": "ord_234",
  "orderNumber": "ORD-2024-0234",
  "patientId": "pat_123",
  "providerId": "prov_789",
  "type": "prescription",
  "priority": "routine",
  "status": "pending",
  "items": [
    {
      "id": "item_001",
      "type": "medication",
      "name": "Tretinoin Cream 0.025%",
      "genericName": "tretinoin",
      "quantity": 1,
      "unit": "tube",
      "size": "45g",
      "ndcCode": "12345-678-90",
      "instructions": "Apply thin layer to affected areas nightly",
      "refills": 3,
      "daysSupply": 90
    },
    {
      "id": "item_002",
      "type": "medication",
      "name": "Clindamycin Gel 1%",
      "genericName": "clindamycin phosphate",
      "quantity": 1,
      "unit": "tube",
      "size": "30g",
      "ndcCode": "98765-432-10",
      "instructions": "Apply twice daily to affected areas",
      "refills": 3,
      "daysSupply": 30
    }
  ],
  "pharmacy": {
    "id": "pharm_456",
    "name": "CVS Pharmacy",
    "ncpdpId": "1234567"
  },
  "totalCost": {
    "subtotal": 125.00,
    "insurance": -100.00,
    "copay": 25.00,
    "tax": 0,
    "total": 25.00
  },
  "createdAt": "2024-01-20T10:00:00Z",
  "estimatedReadyTime": "2024-01-20T14:00:00Z"
}
GET/orders
List orders with filters

Query Parameters

?status=pending&patientId=pat_123&startDate=2024-01-01

• status: Order status (pending|processing|completed|cancelled)

• patientId: Filter by patient

• providerId: Filter by provider

• startDate: Orders from date

• endDate: Orders until date

Response (200)

{
  "orders": [
    {
      "id": "ord_234",
      "orderNumber": "ORD-2024-0234",
      "patientName": "John Doe",
      "providerName": "Dr. Emily Johnson",
      "type": "prescription",
      "status": "pending",
      "itemCount": 2,
      "totalAmount": 25.00,
      "createdAt": "2024-01-20T10:00:00Z",
      "priority": "routine"
    },
    {
      "id": "ord_233",
      "orderNumber": "ORD-2024-0233",
      "patientName": "John Doe",
      "providerName": "Dr. Emily Johnson",
      "type": "lab",
      "status": "completed",
      "itemCount": 3,
      "totalAmount": 150.00,
      "createdAt": "2024-01-15T09:00:00Z",
      "completedAt": "2024-01-17T14:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45
  }
}
GET/orders/{id}
Get order details

Path Parameter

id: ord_234

Response (200)

{
  "id": "ord_234",
  "orderNumber": "ORD-2024-0234",
  "patient": {
    "id": "pat_123",
    "name": "John Doe",
    "dateOfBirth": "1985-06-15",
    "phone": "+1 (555) 123-4567"
  },
  "provider": {
    "id": "prov_789",
    "name": "Dr. Emily Johnson",
    "npiNumber": "1234567890"
  },
  "type": "prescription",
  "priority": "routine",
  "status": "processing",
  "statusHistory": [
    {
      "status": "pending",
      "timestamp": "2024-01-20T10:00:00Z",
      "notes": "Order created"
    },
    {
      "status": "processing",
      "timestamp": "2024-01-20T10:30:00Z",
      "notes": "Sent to pharmacy"
    }
  ],
  "items": [
    {
      "id": "item_001",
      "type": "medication",
      "name": "Tretinoin Cream 0.025%",
      "status": "sent_to_pharmacy",
      "quantity": 1,
      "refills": 3,
      "prescriptionId": "rx_567"
    }
  ],
  "pharmacy": {
    "id": "pharm_456",
    "name": "CVS Pharmacy",
    "phone": "+1 (555) 678-9012",
    "status": "received"
  },
  "createdAt": "2024-01-20T10:00:00Z",
  "updatedAt": "2024-01-20T10:30:00Z"
}
PUT/orders/{id}/cancel
Cancel order

Request Body

{
  "reason": "patient_request",
  "notes": "Patient found alternative treatment"
}

Response (200)

{
  "id": "ord_234",
  "status": "cancelled",
  "cancelledAt": "2024-01-20T11:00:00Z",
  "cancelledBy": "usr_456",
  "reason": "patient_request",
  "notes": "Patient found alternative treatment",
  "refund": {
    "amount": 25.00,
    "status": "processing",
    "expectedDate": "2024-01-23"
  }
}
POST/orders/{id}/fulfill
Mark order as fulfilled

Request Body

{
  "fulfilledBy": "pharm_456",
  "fulfilledItems": ["item_001", "item_002"],
  "pickupMethod": "in_store",
  "notes": "Patient picked up at 2:30 PM"
}

Response (200)

{
  "id": "ord_234",
  "status": "completed",
  "fulfilledAt": "2024-01-20T14:30:00Z",
  "fulfilledBy": "pharm_456",
  "fulfilledItems": ["item_001", "item_002"],
  "pickupMethod": "in_store",
  "completionTime": "4 hours 30 minutes"
}

Prescriptions API

POST/prescriptions
Create new prescription

Request Body

{
  "patientId": "pat_123",
  "providerId": "prov_789",
  "medication": {
    "name": "Doxycycline",
    "strength": "100mg",
    "form": "capsule",
    "ndcCode": "00000-0000-00"
  },
  "sig": "Take 1 capsule by mouth twice daily with food",
  "quantity": 60,
  "quantityUnit": "capsules",
  "refills": 2,
  "daysSupply": 30,
  "substitutionAllowed": true,
  "indication": "Moderate acne vulgaris",
  "icd10Code": "L70.0",
  "notes": "Take with full glass of water",
  "priorAuthorization": {
    "required": false
  }
}

Response (201)

{
  "id": "rx_567",
  "rxNumber": "RX-2024-000567",
  "patientId": "pat_123",
  "providerId": "prov_789",
  "medication": {
    "name": "Doxycycline",
    "genericName": "doxycycline hyclate",
    "strength": "100mg",
    "form": "capsule",
    "ndcCode": "00000-0000-00",
    "manufacturer": "Generic Pharma"
  },
  "sig": "Take 1 capsule by mouth twice daily with food",
  "quantity": 60,
  "quantityUnit": "capsules",
  "refills": 2,
  "refillsRemaining": 2,
  "daysSupply": 30,
  "substitutionAllowed": true,
  "indication": "Moderate acne vulgaris",
  "icd10Code": "L70.0",
  "status": "active",
  "writtenDate": "2024-01-20T11:00:00Z",
  "expirationDate": "2025-01-20T11:00:00Z",
  "deaSchedule": null,
  "eSigned": true,
  "eSignedAt": "2024-01-20T11:00:00Z"
}
POST/prescriptions/{id}/send
Send prescription to pharmacy

Request Body

{
  "pharmacyId": "pharm_456",
  "method": "electronic",
  "priority": "routine",
  "patientNotes": "Please use generic if available",
  "pharmacyNotes": "Patient prefers morning pickup"
}

Response (200)

{
  "prescriptionId": "rx_567",
  "transmissionId": "trans_890",
  "sentTo": {
    "id": "pharm_456",
    "name": "CVS Pharmacy",
    "ncpdpId": "1234567",
    "address": "123 Market St, San Francisco, CA"
  },
  "sentAt": "2024-01-20T11:05:00Z",
  "method": "electronic",
  "status": "transmitted",
  "confirmationNumber": "SURESCRIPT-123456",
  "estimatedReadyTime": "2024-01-20T15:00:00Z",
  "pharmacyAcknowledged": true,
  "pharmacyAcknowledgedAt": "2024-01-20T11:06:00Z"
}
GET/prescriptions
List prescriptions with filters

Query Parameters

?patientId=pat_123&status=active&includeExpired=false

• patientId: Filter by patient

• providerId: Filter by provider

• status: Prescription status (active|expired|cancelled)

• includeExpired: Include expired prescriptions

Response (200)

{
  "prescriptions": [
    {
      "id": "rx_567",
      "rxNumber": "RX-2024-000567",
      "medication": "Doxycycline 100mg",
      "patient": "John Doe",
      "provider": "Dr. Emily Johnson",
      "status": "active",
      "refillsRemaining": 2,
      "writtenDate": "2024-01-20",
      "lastFilled": "2024-01-20"
    },
    {
      "id": "rx_566",
      "rxNumber": "RX-2024-000566",
      "medication": "Tretinoin 0.025% Cream",
      "patient": "John Doe",
      "provider": "Dr. Emily Johnson",
      "status": "active",
      "refillsRemaining": 3,
      "writtenDate": "2024-01-15",
      "lastFilled": null
    }
  ],
  "total": 12,
  "page": 1
}
POST/prescriptions/{id}/refill
Process refill request

Request Body

{
  "requestedBy": "patient",
  "pharmacyId": "pharm_456",
  "quantity": 60,
  "notes": "Patient traveling, needs early refill",
  "earlyRefillReason": "vacation"
}

Response (201)

{
  "refillId": "ref_789",
  "prescriptionId": "rx_567",
  "status": "pending_approval",
  "requestedAt": "2024-01-20T12:00:00Z",
  "requestedBy": "patient",
  "quantity": 60,
  "refillNumber": 1,
  "refillsRemaining": 1,
  "requiresApproval": true,
  "approvalReason": "early_refill",
  "estimatedApprovalTime": "2024-01-20T14:00:00Z",
  "pharmacyNotified": true
}
PUT/prescriptions/{id}/dosage
Update prescription dosage

Request Body

{
  "newSig": "Take 2 capsules by mouth twice daily with food",
  "newQuantity": 120,
  "newDaysSupply": 30,
  "reason": "Increasing dose for better efficacy",
  "effectiveDate": "2024-01-21"
}

Response (200)

{
  "id": "rx_567",
  "previousSig": "Take 1 capsule by mouth twice daily with food",
  "newSig": "Take 2 capsules by mouth twice daily with food",
  "previousQuantity": 60,
  "newQuantity": 120,
  "updatedAt": "2024-01-20T13:00:00Z",
  "updatedBy": "prov_789",
  "reason": "Increasing dose for better efficacy",
  "effectiveDate": "2024-01-21",
  "pharmacyNotified": true,
  "requiresNewRx": false
}

Refills API

GET/refills/pending
Get pending refill requests

Query Parameters

?providerId=prov_789&priority=urgent

Response (200)

{
  "refills": [
    {
      "id": "ref_789",
      "patient": {
        "id": "pat_123",
        "name": "John Doe"
      },
      "medication": "Doxycycline 100mg",
      "requestedAt": "2024-01-20T12:00:00Z",
      "priority": "urgent",
      "reason": "Patient out of medication",
      "lastFilled": "2023-12-20",
      "refillsRemaining": 1
    }
  ],
  "total": 5,
  "urgentCount": 2
}
PUT/refills/{id}/approve
Approve refill request

Request Body

{
  "approvedBy": "prov_789",
  "quantity": 60,
  "notes": "Approved for vacation supply",
  "sendToPharmacy": true,
  "pharmacyId": "pharm_456"
}

Response (200)

{
  "refillId": "ref_789",
  "status": "approved",
  "approvedAt": "2024-01-20T14:00:00Z",
  "approvedBy": "prov_789",
  "quantity": 60,
  "sentToPharmacy": true,
  "pharmacyConfirmation": "SURE-REF-123456",
  "estimatedReadyTime": "2024-01-20T16:00:00Z",
  "patientNotified": true
}
POST/refills/{id}/deny
Deny refill request

Request Body

{
  "deniedBy": "prov_789",
  "reason": "too_soon",
  "explanation": "Last refill was 10 days ago",
  "alternativeAction": "schedule_appointment"
}

Response (200)

{
  "refillId": "ref_789",
  "status": "denied",
  "deniedAt": "2024-01-20T14:00:00Z",
  "deniedBy": "prov_789",
  "reason": "too_soon",
  "explanation": "Last refill was 10 days ago",
  "alternativeAction": "schedule_appointment",
  "patientNotified": true,
  "pharmacyNotified": true
}

HTTP Response Codes

200OK - Request successful
201Created - Resource created successfully
204No Content - Request successful, no response body
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing authentication
403Forbidden - Insufficient permissions
404Not Found - Resource not found
409Conflict - Resource already exists
422Unprocessable Entity - Validation error
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error occurred
503Service Unavailable - Service temporarily unavailable

Rate Limiting

API requests are subject to rate limiting to ensure fair usage:

  • Default: 1000 requests per hour per API key
  • Burst: 100 requests per minute
  • Headers returned with each response:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1642550400

Error Response Format

All error responses follow a consistent format:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      {
        "field": "email",
        "message": "Invalid email format"
      }
    ],
    "requestId": "req_abc123",
    "timestamp": "2024-01-20T12:00:00Z"
  }
}

Need Help?

Contact our developer support team for API integration assistance

📧 api-support@dermifi.com📚 Full Documentation🔧 SDK Downloads