This guide covers invoice operations and online payment flows in ProMediClinic, including Stripe, PayPal, refunds, analytics, and invoice lifecycle.
Access
- Invoicing (dashboard):
/dashboard/invoicing/dashboard/invoicing/create
- Payments:
/payments/event/{event}/payments/history/payments/analytics
Invoicing Module
List and Filter Invoices
From /dashboard/invoicing, you can filter invoices by:
- status
- date range (
from,to) - search text (invoice number, customer name, customer email)
Dashboard counters include:
- total
- paid
- sent
- overdue
- draft
- paid revenue
- outstanding balance
Create Ad-Hoc Invoice
- Open
Invoicing -> Create. - Select patient (optional) or fill customer fields manually.
- Add one or more line items:
- description
- quantity
- unit price
- Set optional values:
- tax rate
- discount amount
- issue date
- due date
- notes
- Save as draft.
Validation rules:
- at least one valid line item is required
- discount cannot exceed subtotal
- due date must be on/after issue date
Payment Flows
Event Payment Page
For payable events, open /payments/event/{event}.
The system checks:
- whether the event type requires payment
- whether a payment is already completed
Stripe
- Create intent:
POST /payments/event/{event}/create-intent - Confirm payment:
POST /payments/confirm - Webhook endpoint:
POST /stripe/webhook
PayPal
- Create order:
POST /payments/event/{event}/paypal/create - Success callback:
GET /payments/paypal/success - Cancel callback:
GET /payments/paypal/cancel - Webhook endpoint:
POST /paypal/webhook
Payment Operations
Supported management actions:
- retry failed payment
- cancel pending payment
- process refund (permission-gated)
- check payment status for event
- view payment details
Key routes:
POST /payments/{payment}/retryPOST /payments/{payment}/cancelPOST /payments/{payment}/refundGET /payments/event/{event}/statusGET /payments/{payment}
Payment History and Analytics
History
/payments/history provides filtering by:
- status
- method
- date range
- search (transaction id, payment intent id, customer, event)
Analytics
/payments/analytics supports period views:
- week
- month
- quarter
- year
Also available via JSON endpoint:
GET /payments/analytics/data?period=month
Invoice API-Like Actions (Dashboard)
From payment routes, you can:
- create invoice from event
- send invoice email
- mark invoice paid
- fetch invoice stats
Routes:
POST /payments/event/{event}/invoicePOST /payments/invoice/{invoice}/sendPOST /payments/invoice/{invoice}/mark-paidGET /payments/invoice/stats
Configuration Dependencies
Before going live, verify:
- Stripe keys and webhook secret
- PayPal credentials and webhook setup
- SMTP settings for invoice sending
- role permissions for invoicing/refund actions
Common Errors
- Event does not require payment: use invoice flow or free scheduling path.
- Permission denied on refund/retry/cancel: adjust role permissions.
- Webhook signature failure: check endpoint secret and payload integrity.
- Invoice validation errors: review line items, discount, and due-date logic.
Related
configuration/settings.mdfeatures/patients.mdreference/route-map.mdreference/troubleshooting.md