Skip to content

Request Refill

Request Refill

Running low on your regular medications? Request a refill in seconds — no need to search again or re-enter details.

How Refills Work

Refills use your order history to quickly reorder the same medications from the same pharmacy. Perfect for chronic conditions like diabetes, hypertension, or asthma.

Request Refill

Reorder a previous order with one call.

Terminal window
# Request refill for order ORD-789
request_refill({
orderId: "ORD-789",
quantity: 2, // optional: override quantity
deliveryType: "delivery", // optional: change from pickup to delivery
notes: "Same as before, thank you!"
})

Parameters:

ParameterTypeRequiredDescription
orderIdstringYesPrevious order ID to refill
quantitynumberNoOverride the original quantity
deliveryTypestringNo"delivery" or "pickup" (defaults to original)
notesstringNoSpecial instructions

Response:

{
"success": true,
"orderId": "ORD-790",
"refillId": "REF-456",
"status": "pending_payment",
"originalOrder": "ORD-789",
"items": [
{
"medicationId": "MED-123",
"name": "Metformin 500mg",
"quantity": 2,
"price": 2500
}
],
"total": 5000,
"pharmacy": {
"id": "PH-456",
"name": "GreenCross Pharmacy",
"phone": "+2348012345678"
},
"checkoutUrl": "https://pay.famasi.ai/checkout/ORD-790"
}

Eligible Orders for Refill

Orders can be refilled if:

  • Order status is completed
  • Medication is still in stock
  • Pharmacy is still active
  • Prescription is still valid (if required)
Terminal window
# Get order history with refill eligibility
get_order_history({ limit: 10 })
# Each order includes:
# {
# "canRefill": true,
# "refillId": "REF-456",
# "prescriptionValidUntil": "2026-06-15"
# }

Prescription Renewals

For prescription medications, the system automatically:

  1. Checks if your prescription is still valid
  2. Contacts your doctor if renewal is needed
  3. Waits for approval before processing
Terminal window
# Request refill (prescription will be checked)
request_refill({ orderId: "ORD-789" })
# If prescription expired:
# → Order status: "pending_prescription"
# → Pharmacy will contact your doctor

Setting Up Auto-Refills

For medications you take regularly:

Terminal window
# Enable auto-refill for an order
enable_auto_refill({
orderId: "ORD-789",
frequency: "monthly", // weekly, biweekly, monthly
reminderDays: 3 // remind 3 days before
})

Response:

{
"success": true,
"autoRefillId": "AUTO-123",
"schedule": "Monthly on the 15th",
"nextRefill": "2026-05-15",
"enabled": true
}

Managing Auto-Refills

Terminal window
# View all auto-refills
get_auto_refills()
# Pause auto-refill
pause_auto_refill({ autoRefillId: "AUTO-123" })
# Resume auto-refill
resume_auto_refill({ autoRefillId: "AUTO-123" })
# Cancel auto-refill
cancel_auto_refill({ autoRefillId: "AUTO-123" })

Example: Refill Workflow

Terminal window
# Step 1: View order history
get_order_history({ limit: 5 })
# → Find order with canRefill: true
# Step 2: Request refill
request_refill({ orderId: "ORD-789" })
# → New order created: ORD-790
# Step 3: Get checkout link
get_checkout_link({ orderId: "ORD-790" })
# → Complete payment
# Step 4: Track the refill order
check_order_status({ orderId: "ORD-790" })

Refill Reminders

You’ll receive reminders when it’s time to refill:

  • SMS notification 3 days before (configurable)
  • Email reminder (if provided)
  • In-app notification

Chronic Condition Management

For managing chronic conditions, refills include:

  • Medication adherence tracking — See if you’re taking meds on time
  • Supply monitoring — Alerts when running low
  • Doctor notifications — Automatic updates to your healthcare provider

Next steps