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, docx5MB

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/upload

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/upload' \
  -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": {
        "id": "FILE_abc123xyz.pdf",
        "purpose": "payment_evidence",
        "mimeType": "application/pdf",
        "uploadedAt": "2024-11-21T10:15:00Z"
    }
}

Response Fields

The response returns a file object containing:

FieldTypeDescription
idstringThe 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)

Get File Details

The Get File Details endpoint allows you to retrieve metadata for an uploaded file by its file ID. Use the file ID returned when the file was uploaded.

Request

GEThttps://files.harpfi.com/v1/files/:fileId/details

Path Parameters

ParameterTypeDescription
fileIdstringThe unique identifier of the file

Response

JSON
{
    "success": true,
    "message": "File details retrieved successfully",
    "data": {
        "id": "1771616981673hx0Tq8HWQd9ekKzg2hCF.pdf",
        "purpose": "payment_evidence",
        "name": "UTILITY Bill.pdf",
        "mimeType": "application/pdf",
        "contentLink": {
            "url": "https://files.harpfi.com/v1/files/1771616981673hx0Tq8HWQd9ekKzg2hCF.pdf/content",
            "expiryDate": null
        },
        "expiryDate": null,
        "uploadedAt": "2026-02-20T19:49:41.000Z"
    }
}

Response Fields

FieldTypeDescription
idstringThe unique identifier for the file
purposestringThe purpose for which the file was uploaded (payment_evidence or business_entity_documents)
namestringThe original file name
mimeTypestringThe MIME type of the file
contentLinkobjectLink to download the file content
contentLink.urlstringURL to retrieve the file content
contentLink.expiryDatestring | nullWhen the content link expires (null if it does not expire)
expiryDatestring | nullWhen the file record expires (null if it does not expire)
uploadedAtstringThe timestamp when the file was uploaded (ISO 8601 format)

Note: Use the same authentication (API key) as for other file endpoints. If the file does not exist or you do not have access, the API returns an error response.