File uploads

Upload files to Rainforest for processes such as merchant onboarding and disputing chargebacks

Rainforest supports uploading files for the following processes:

When using the components, Rainforest handles the file upload process for you. But if you're integrating with the Rainforest API, then this guide will explain how to upload files through a direct API integration.

Initiate the file upload process


Create file upload config

Create a file upload config specifying the file name and the purpose of the file upload.

Merchant onboarding

If the file is for the Needs Information process, then set the type corresponding to the underwriting review reason the file is for.

File types

TypeUnderwriting Review Reasons
BUSINESS_VERIFICATIONbusiness_verification
DEPOSIT_METHOD_VERIFICATIONdeposit_method_1 and deposit_method_2
FINANCIAL_REVIEWfinancial_1 and financial_2

Chargebacks

If the file is for responding to a chargeback dispute and uploading chargeback evidence, the set the type to CHARGEBACK_EVIDENCE and pass the chargeback_id the file is for.

Pre-signed payload

The file upload config response returns a pre-signed payload in the presigned_post_data field that you'll need to upload the file in the next step.

Upload the file


Supported file types

Rainforest supports the following file types:

  • JPEG
  • PNG
  • TIFF
  • PDF

The file cannot be protected and must be visible to Rainforest without any additional steps, such as a password.

Post the file

Once the file upload config is created and the pre-signed payload is received, the file can be uploaded by posting the pre-signed payload and file data as multipart/form-data to the following endpoint, respective of the environment.

File endpoint

EnvironmentEndpoint
SandboxPOST https://api.sandbox.rainforestpay.com/v1/file_uploads/simulate
ProductionPOST https://upload.rainforestpay.com

Example of Form Data

------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="key"
fic_2tJYp6L4rl1wu2yXsIhImk51Uzp
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-algorithm"
AWS4-HMAC-SHA256
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-credential"
ASIAV23BBR56NYZUNARN/20250220/us-east-2/s3/aws4_request
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-date"
20250220T171703Z
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-security-token"
IQoJb3JpZ2luX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IrUk9FSmI2UXhKanI1Y3EyWUVtSGlRNXZuTVJHMjd1YlgzbHVzL01JUFdwTlpScTVPbitDdjdnb2J1QmdNWVVYTTlIdWtjVkhSL3dScldFdGFUanBQaHM0Umg4WkVZYWhrUTBaakNGZGxFVXhBM1hNcUJRL0YvWUJaczI2WjNmUlZSeHpRPSJ9LHsieC1hbXotYWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsieC1hbXotZGF0ZSI6IjIwMjUwMjIwVDE3MTcwM1oifV19
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-signature"
8851e1846666c4a768e77b26305e75a642a75e2915a36cb615f5336bf9effe69
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-meta-fileuploadconfigid"
fic_2tJYp6L4rl1wu2yXsIhImk51Uzp
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="x-amz-meta-originalfilename"
testfile.pdf
------WebKitFormBoundaryri1jWg8UDQUDwnc7
Content-Disposition: form-data; name="file"; filename="testfile.pdf"
Content-Type: application/pdf
------WebKitFormBoundaryri1jWg8UDQUDwnc7--

Poll the file status

Uploading the file to the upload endpoint starts an asynchronous process to scan and store the file. The file will not be immediately ready as we are ensuring the file is valid and secure.

Get the file upload config

Poll the get file upload config endpoint, using the file_upload_config_id from the first step, until a file_upload_id is returned.

{
    "file_upload_config_id": "fic_2tn03u3n9L6aozuRtvSUEkoqazr",
+   "file_upload_id": "fiu_2tn06e4iML70Q1ivGq8dbdZ4jDJ"
}

Get the file upload

Once you have a file_upload_id, get the file upload and check the status. It will be one of the following:

  • AVAILABLE - the file was successfully uploaded
  • FAILED - the file failed to upload
{
    "file_upload_id": "fiu_2tn06e4iML70Q1ivGq8dbdZ4jDJ",
    "file_upload_config_id": "fic_2tn03u3n9L6aozuRtvSUEkoqazr",
    "filename": "testfile.pdf",
    "type": "BUSINESS_VERIFICATION",
+   "status": "AVAILABLE",
    "created_at": "2022-01-01T12:00:00Z",
    "updated_at": "2022-01-01T12:00:00Z"
}

Associate the file


Once the file upload is complete and the status is Available, it can now be associated to a merchant application or chargeback.

Merchant onboarding

Files are associated to a merchant application in the Needs Information process to complete the underwriting review reasons. Update a merchant application's underwriting review reason and set the file upload fields.

{
  "underwriting_reviews": {
    "business_verification": {
      "file_upload_ids": [
        "fiu_2DrDU206kzAhclm1WrZbuwDERRk"
      ]
    },
    "deposit_method_1": {
      "file_upload_id": "fiu_2tmycnLHXvd7Hscnf0nNTSvluvA"
    }
  }
}

Chargeback disputes

Files are associated to a chargeback evidence when disputing chargebacks in the Inquiry Action Required and Dispute Action Required statuses. Update a chargeback evidence and set the file uploads field.

{
  "file_upload_ids": [
    "fiu_2tmz9V1zqYdELOFditLO1pmwG9k"
  ]
}