Let me address all three aspects of your CSV format issue:
CSV Header Validation:
The Treasury API in ICS 2023-1 requires exact header names matching the API schema. Your current headers are incorrect. Here’s the proper format:
Payment_Reference,Payment_Amount,Payment_Currency,Beneficiary_Account_Number,Payment_Date,Payment_Method
PMT001,5000.00,USD,ACC123456,2024-12-11,WIRE
Key differences:
- Use underscores, not camel case:
Payment_Reference not `PaymentID
- Include mandatory columns even if not immediately needed:
Payment_Date and Payment_Method are required
- Column order doesn’t matter, but all required headers must be present
API Import Template:
The official template includes these mandatory columns for bulk payment upload:
Payment_Reference (unique identifier)
Payment_Amount (decimal, no thousand separators)
Payment_Currency (3-letter ISO code)
Beneficiary_Account_Number (alphanumeric)
Payment_Date (YYYY-MM-DD format)
Payment_Method (WIRE, ACH, CHECK, or EFT)
Optional but recommended columns:
Beneficiary_Name (for validation)
Payment_Description (for reference)
Bank_Code (if multiple bank accounts)
Download the current template from: Treasury API Documentation > Import Templates > Bulk Payment Upload v2.3
Encoding Issues:
The API strictly requires UTF-8 without BOM. Here’s how to ensure correct encoding:
- If generating CSV programmatically:
import csv
with open('payments.csv', 'w', encoding='utf-8', newline='') as f:
writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL)
-
If using Excel:
- Save as “CSV UTF-8 (Comma delimited) (*.csv)” not regular CSV
- Verify no BOM by opening in Notepad++ and checking encoding
-
Remove BOM if present:
sed '1s/^\xEF\xBB\xBF//' input.csv > output.csv
Additional Validation Rules:
- Decimal amounts: use period as decimal separator, no thousand separators
- Text fields with commas: enclose in double quotes
- Date format: strictly YYYY-MM-DD
- Empty optional fields: leave blank, don’t use NULL or N/A
- Maximum file size: 5000 rows per upload
Common Validation Error Messages:
- “Unexpected column format” = Header name mismatch
- “Invalid encoding” = BOM present or wrong encoding
- “Missing required field” = Mandatory column absent
- “Invalid date format” = Date not in YYYY-MM-DD
After correcting your CSV structure with proper headers, UTF-8 encoding without BOM, and all mandatory columns, the bulk upload should process successfully. Test with a small file (5-10 rows) first to verify the format before uploading larger payment batches.