File Management
HarpFi provides a file management system that allows you to upload and store files for various purposes, such as payment documentation and business entity verification. Files uploaded through the API are securely stored and can be referenced in other API operations as needed.
File Configuration
The following table outlines the allowed file configurations for different purposes:
| Purpose | Description | Supported MIME Types | Max File Size |
|---|---|---|---|
| payment_evidence | Supporting documentation for payments, such as invoices, receipts | png, jpeg, pdf, docx | 5MB |
| business_entity_documents | Files related to business entity verification, such as registration documents, certificates, or identification | png, jpeg, pdf, docx | 10MB |
Upload File
The Upload File endpoint allows you to upload files to HarpFi for use in various operations. When uploading a file, you must specify the purpose for which the file will be used.
Request
POSThttps://files.harpfi.com/v1/files
The request should be sent as multipart/form-data with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload |
purpose | string | Yes | The purpose for which the file is being uploaded. Must be one of: payment_evidence or business_entity_documents |
Example Request
Bash
curl -X POST \ 'https://files.harpfi.com/v1/files' \ -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \ -F 'file=@/path/to/your/file.pdf' \ -F 'purpose=payment_evidence'
Response
JSON
{
"success": true,
"message": "File uploaded successfully",
"data": {
"reference": "FILE_abc123xyz",
"purpose": "payment_evidence",
"mimeType": "application/pdf",
"uploadedAt": "2024-11-21T10:15:00Z"
}
}
Response Fields
The response returns a file object containing:
| Field | Type | Description |
|---|---|---|
reference | string | The unique identifier for the uploaded file |
purpose | string | The purpose for which the file was uploaded (payment_evidence or business_entity_documents) |
mimeType | string | The MIME type of the uploaded file |
uploadedAt | string | The timestamp when the file was uploaded (ISO 8601 format) |