Finance Data Ingest Operations
Overview
Two ingest pipelines import NDIS financial CSV data into the database:
- Billing History -- NDIA payment approval records (what was paid)
- Payment Request History -- outbound bulk claim submissions (what was requested)
Both follow the same workflow: drop CSVs in the ingest folder, trigger ingest from the admin UI, files get archived after processing.
Folder Structure
admin_drive/
├── Ingest/Finance/
│ ├── Billing/ ← Drop billing CSVs here
│ └── Payment Requests/ ← Drop payment request CSVs here
│
└── Finance/Ingested/
├── Billing Archive/ ← Processed billing files moved here
│ ├── 2026-04-03/
│ └── 2026-04-03(1)/ ← Multiple runs same day
└── Payment Request Archive/
└── 2026-04-03/ ← Preserves subfolder structure
How to Ingest
Billing History
- Place NDIS billing export CSVs (from the NDIA portal) into
admin_drive/Ingest/Finance/Billing/ - Navigate to Finance > Billing in the admin app
- Go to the Import section and click "Ingest from Server"
- Wait for completion (can take a few minutes for large batches)
- Files are automatically moved to
Finance/Ingested/Billing Archive/YYYY-MM-DD/
Payment Requests
- Place payment request CSVs into
admin_drive/Ingest/Finance/Payment Requests/- Can include nested folders (by year, category, etc.)
- Files named
*2021_12-002K*are automatically skipped (legacy templates) - Error/response CSVs from the NDIA portal go in
Errors/subfolders
- Navigate to Finance > Payment Requests in the admin app
- Go to the Import tab and click "Ingest from Server"
- Wait for completion (5 minute timeout for large batches)
- Files are archived to
Finance/Ingested/Payment Request Archive/YYYY-MM-DD/preserving folder structure
CSV Formats
Billing History (NDIA Bulk Payment Export)
19 columns: ProviderBPNumber, ProviderABN, PaymentRequestNum, DateApproved, ClaimRef, ItemID, ItemQty, UnitPrice, AmountClaimed, GSTAmount, Amount, ParticipantBPNumber, ParticipantName, SuppSDate, SuppEDate, ServiceBookingID, GSTCode, BulkClaimRefID, ClearingNum
Payment Requests
Two formats:
- 13-column (2017-2021):
RegistrationNumber, NDISNumber, SupportsDeliveredFrom, SupportsDeliveredTo, SupportNumber, ClaimReference, Quantity, Hours, UnitPrice, GSTCode, AuthorisedBy, ParticipantApproved, InKindFundingProgram - 16-column (2022+): adds
ClaimType, CancellationReason, ABN of Support Provider
Error/Response CSVs (18-column): adds PaidTotalAmount, Payment Request Number, Participant Name, Capped Price, Payment Request Status, Error Message
Deduplication
Both pipelines use data-level deduplication (not file-based):
- Billing: composite key of
PaymentRequestNum + ItemID + ServiceStartDate + ServiceEndDate - Payment Requests: composite key of
NDISNumber + SupportNumber + SupportsDeliveredFrom + SupportsDeliveredTo + ClaimReference
This means:
- Moving files between folders does NOT create duplicates
- Re-ingesting the same data is safe (duplicates are skipped)
- Files from different folders with the same data are correctly deduplicated
- New, genuinely different data is always imported
Data Handling
| Scenario | Billing | Payment Requests |
|---|---|---|
| Empty/padding rows | Silently skipped | Silently skipped |
| Inverted dates (from > to) | Auto-swapped | Auto-swapped |
| Impossible dates (e.g. Apr 31) | Skipped (null) | Skipped (null) |
| Missing claim reference | Uses PaymentRequestNum as fallback | Generates synthetic ref from filename |
| Template files (2021_12-002K) | N/A | Automatically skipped |
| Dollar signs in prices | N/A | Stripped automatically |
| Date format DD/MM/YYYY | Handled | Handled |
| Quoted CSV fields with commas | Handled | Handled |
Database Schema
Billing History (finance schema)
billing_import_batches-- batch trackingbilling_raw_lines-- verbatim CSV rows (audit trail)billing_lines-- normalised, typed, with derived fieldsbilling_item_catalog-- distinct item codes with statsbilling_participant_summary-- per-participant aggregates
Payment Requests (finance schema)
pr_import_batches-- batch trackingpayment_request_lines-- normalised request datapayment_request_responses-- NDIA error/response datav_pr_monthly-- monthly summary viewv_pr_by_participant-- participant summary view
File Naming Convention
All system-generated files (reports, statements) follow:
YYYY-MM-DD Title [period].ext
Examples:
2026-04-03 Billing Statement 2026-01-01_2026-03-31.pdf2026-04-03 Participant Revenue Report.pdf
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| "No CSV files found" | Ingest folder is empty | Place CSVs in the correct ingest folder |
| Timeout on frontend | Large batch exceeding timeout | Ingest still runs server-side; check batch history |
| High error count | Data quality issues in source CSVs | Check server console for specific row errors |
| Duplicate data after re-ingest | Expected for billing (soft dedup) | Totals exclude duplicates via is_duplicate = false |
| "Billing directory not found" | Ingest folder doesn't exist | Create admin_drive/Ingest/Finance/Billing/ |
API Endpoints
Billing History (/api/v1/billing-history/)
POST /ingest-- trigger CSV ingestGET /lines-- query billing lines (paginated, filterable)GET /summary-- monthly summariesGET /dashboard-- dashboard widget dataGET /batches-- import batch historyGET /participant/:id-- participant billing detailGET /participant/:id/statement-- download PDF statementPOST /participant/:id/statement/save-- save statement to admin driveGET /report/:type-- download PDF reportPOST /report/:type/save-- save report to admin drive
Payment Requests (/api/v1/payment-requests/)
POST /ingest-- trigger CSV ingestGET /lines-- query request lines (paginated, filterable)GET /summary-- monthly summariesGET /dashboard-- dashboard statsGET /batches-- import batch historyGET /responses-- NDIA error/response lines