Returns
Process returns and refunds for pharmacy sales.
MediFlux provides a structured return and refund workflow that ensures compliance with pharmacy regulations while making the process straightforward for your staff. Returns are linked to the original sale transaction, maintaining a complete audit trail from purchase through return.
Not all pharmacy products are eligible for return. Prescription medications, controlled substances, and certain health products may have restrictions based on your jurisdiction's regulations and your pharmacy's return policy. MediFlux enforces these rules automatically based on your configuration.
Return Policy Configuration
Before processing returns, ensure your return policy is configured in MediFlux. The policy defines which products can be returned, the return window, and refund methods.
pharmacy:
returns:
enabled: true
default_window_days: 30
require_receipt: true
require_manager_approval_above: 100.00
restocking_fee_percent: 0
non_returnable_categories:
- prescription_medications
- controlled_substances
- compounded_medications
- opened_medical_devices
- refrigerated_items
refund_methods:
- original_payment
- store_credit
- cashPrescription medications and controlled substances cannot be returned once dispensed in most jurisdictions. MediFlux blocks return attempts for these categories by default. Consult your state pharmacy board for specific regulations.
Processing a Return
Look Up the Original Sale
Start by finding the original sale transaction. You can search by sale ID, receipt number, date, or customer information.
const originalSale = await fetch(
"https://api.mediflux.io/v1/sales/sale_2024_00456",
{
headers: { Authorization: "Bearer your-api-key" },
}
);
const saleData = await originalSale.json();
console.log("Original sale found:", saleData.id);
console.log("Items:", saleData.items.length);Select Items to Return
Choose which items from the original sale are being returned. MediFlux validates each item against the return policy and flags any that are ineligible.
const returnRequest = await fetch("https://api.mediflux.io/v1/returns", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer your-api-key",
},
body: JSON.stringify({
original_sale_id: "sale_2024_00456",
reason: "customer_dissatisfied",
items: [
{
item_id: "item_bandages_medium",
quantity: 1,
condition: "unopened",
},
{
item_id: "item_vitamin_d3",
quantity: 1,
condition: "unopened",
},
],
notes: "Customer prefers a different brand.",
}),
});
const returnData = await returnRequest.json();MediFlux automatically calculates the refund amount based on the original sale price, any discounts that were applied, and the applicable tax. Partial returns correctly prorate discounts that were applied to the entire sale.
Manager Approval (If Required)
Returns exceeding the configured threshold require manager approval. The manager receives a notification and can approve or reject the return from the dashboard or mobile app.
await fetch(`https://api.mediflux.io/v1/returns/${returnData.id}/approve`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer manager-api-key",
},
body: JSON.stringify({
approved_by: "usr_manager_01",
notes: "Approved - items are in original packaging.",
}),
});Process the Refund
Once approved (or if approval isn't required), process the refund. MediFlux supports refunding to the original payment method, issuing store credit, or providing a cash refund.
const refund = await fetch(
`https://api.mediflux.io/v1/returns/${returnData.id}/refund`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer your-api-key",
},
body: JSON.stringify({
method: "original_payment",
}),
}
);
const refundResult = await refund.json();
console.log("Refund processed:", refundResult.refund_amount);
// Output: Refund processed: 22.48Refunds automatically reverse the corresponding accounting entries. The inventory is restocked (for items in resalable condition), and the revenue adjustment is posted to your sales ledger.
Return Reasons
MediFlux tracks return reasons for reporting and trend analysis. The following standard reason codes are available:
Returns with reason adverse_reaction are automatically flagged for pharmacovigilance review. MediFlux generates an adverse event report that can be submitted to the FDA's MedWatch program if required.
Void vs. Return
It's important to understand the difference between voiding a sale and processing a return:
- Void — Cancels a sale before the end of the business day. The transaction is reversed entirely as if it never happened. Use void for same-day corrections.
- Return — Processes a refund for a previously completed sale (typically on a different day). Creates a new return transaction linked to the original sale for audit purposes.
For same-day corrections, voiding is preferred because it produces a cleaner audit trail and doesn't affect your return metrics.