Skip to main content

Upload File Content

Suggest Edits


Overview

Upload the actual file content to a previously created File resource using multipart/form-data. This is the second step in the file upload process - first create the file metadata using the /files endpoint, then upload the binary content using this endpoint.


Resource Access

Production (api.ahrvo.network)

POST https://api.ahrvo.network/payments/na/files/\{file_id}/upload

Staging (gateway.ahrvo.network)

POST http://gateway.ahrvo.network/payments/na/files/\{file_id}/upload

Arguments

AttributeMandatory / OptionalDescription
file_idMandatoryThe ID of the File resource that was previously created
fileMandatoryThe binary contents of the file to upload (multipart/form-data)

Example Request

curl -X POST https://gateway.ahrvo.network/payments/na/files/FIxxxxxxxxxxxxxxxxxx/upload \
-H "Authorization: Basic <base64_encoded_credentials>" \
-F "file=@/path/to/bank_statement_dec_2025.pdf"

Example Response

{
"id": "FIxxxxxxxxxxxxxxxxxx",
"status": "UPLOADED",
"created_at": "2025-12-10T17:00:00Z",
"updated_at": "2025-12-10T17:05:00Z",
"linked_type": "MERCHANT",
"linked_to": "MRxxxxxxxxxxxxxxxxxx",
"extension": "pdf",
"display_name": "Bank Statement (December 2025)",
"type": "BANK_STATEMENT",
"size_in_bytes": 245678,
"file_name": "bank_statement_dec_2025.pdf",
"tags": {
"month": "2025-12",
"purpose": "merchant_onboarding"
},
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/files/FIxxxxxxxxxxxxxxxxxx"
},
"merchant": {
"href": "https://api.ahrvo.network/payments/na/merchants/MRxxxxxxxxxxxxxxxxxx"
}
}
}

Upload Process

Step 1: Create File Resource

First, create the file metadata using POST /files:

curl -X POST https://gateway.ahrvo.network/payments/na/files \
-H "Content-Type: application/json" \
-H "Authorization: Basic <base64_encoded_credentials>" \
-d '{
"display_name": "Bank Statement (December 2025)",
"linked_to": "MRxxxxxxxxxxxxxxxxxx",
"type": "BANK_STATEMENT"
}'

Step 2: Upload File Content

Then, upload the actual file using the returned file_id:

curl -X POST https://gateway.ahrvo.network/payments/na/files/FIxxxxxxxxxxxxxxxxxx/upload \
-H "Authorization: Basic <base64_encoded_credentials>" \
-F "file=@/path/to/document.pdf"

Important Notes

  • File Status: After upload, status changes from REQUIRES_UPLOAD to PENDING and then UPLOADED
  • Supported Formats: PDF, JPEG, PNG (check your specific requirements)
  • File Size: Maximum file size varies by type (typically 10MB limit)
  • One Upload: Each file resource can only be uploaded once
  • Metadata Population: After successful upload, extension, file_name, and size_in_bytes fields are populated

Common Use Cases

  • Merchant Onboarding: Upload bank statements, tax documents (W9, EIN)
  • Compliance: PCI compliance certificates and documentation
  • Verification: Business licenses, articles of incorporation
  • Financial Records: Bank statements for underwriting

API Documentation