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:

PurposeDescriptionSupported MIME TypesMax File Size
payment_evidenceSupporting documentation for payments, such as invoices, receiptspng, jpeg, pdf, docx5MB
business_entity_documentsFiles related to business entity verification, such as registration documents, certificates, or identificationpng, jpeg, pdf, docx10MB

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:

FieldTypeRequiredDescription
filefileYesThe file to upload
purposestringYesThe 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:

FieldTypeDescription
referencestringThe unique identifier for the uploaded file
purposestringThe purpose for which the file was uploaded (payment_evidence or business_entity_documents)
mimeTypestringThe MIME type of the uploaded file
uploadedAtstringThe timestamp when the file was uploaded (ISO 8601 format)