Finpass API Collection
  1. Bank Statement Analyser
  • Introduction
  • Bureau
    • Commercial Credit Report
      POST
    • Multi-Bureau Fetch
      POST
  • Bank Statement Analyser
    • Batch Upload Statements
      POST
    • Batch Result
      GET
    • Upload Statement
      POST
    • Statement Result
      GET
  • Account Aggregator
    • Initialize
      POST
    • Fetch JSON Report
      POST
    • Fetch PDF Report
      POST
    • Refresh Data
      POST
  • Corporate
    • CIN Lookup
      POST
    • LLPIN
      POST
    • PAN Lookup
      POST
    • Company Autocomplete
      POST
  • EPFO
    • Fetch EPFO Data by Mobile Number
      POST
    • EPFO-CRIF Combined Report
      POST
  • ITR Analyzer
    • Initialize
      POST
    • Status
      POST
    • ITR Analyzer — Get Full Data
      POST
    • Create ITR Login Client
      POST
    • Check Credential
      POST
    • Generate 2FA
      POST
    • Submit 2FA OTP
      POST
    • Initiate ITR Password Reset
      POST
    • Confirm Password Reset (Submit OTP)
      POST
  • AA-BSA Analyzer
    • Initialize
    • Status
    • AA BSA — Statement Result
    • AA BSA — Analysis JSON
  • GST Analyser
    • Analyze
    • Status
    • GST Data
  • Hosted Collection
    • Create ITR Collection Session
    • Create GST Collection Session
  1. Bank Statement Analyser

Batch Upload Statements

POST
https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch

BSA Upload Statements Batch

POST /api/v1/services/bsa/upload-statements-batch

Description

The BSA Upload Statements Batch endpoint enables developers and financial platforms to submit multiple bank statement files in a single API call for Bank Statement Analysis (BSA). The endpoint accepts both individual PDF files and ZIP archives containing multiple PDFs, giving integrators flexibility in how they package and deliver statement data. The service processes the uploaded statements against a specified date range and notifies stakeholders via email once analysis is complete.

This endpoint is designed for high-throughput financial workflows where multiple statements — across accounts or months — need to be analysed together, eliminating the overhead of sequential uploads and providing a unified result set.

Key Benefits

  • Flexible File Formats: Upload individual PDF bank statements or ZIP archives containing multiple PDFs — choose the format that fits your workflow.
  • Batch Efficiency: Submit multiple files or a single ZIP in one request, reducing integration complexity and API round-trips.
  • Date-Range Scoping: Filter analysis to a precise period using from_date and to_date, ensuring only relevant transactions are processed.
  • Email Notifications: Automated result delivery to a specified email address keeps stakeholders informed without polling.
  • Scalable Integration: Built for fintech, lending, and compliance use cases that routinely handle large statement volumes.

Use Cases

- Automated underwriting pipelines that collect 6–24 months of bank statements from loan applicants and submit them in one batch for income and cash-flow analysis. - Personal loan and BNPL platforms verifying repayment capacity by analysing salary credits, recurring debits, and average monthly balances across multiple accounts. - AML/KYC compliance teams analysing customer transaction histories across a defined review period to flag unusual patterns or undisclosed income sources. - Internal auditors submitting departmental account statements for a financial year to reconcile expenses and detect anomalies. - Accounting software platforms allowing SME clients to bulk-upload statements from multiple bank accounts for automated bookkeeping and cash-flow reporting. - Expense management tools ingesting corporate account statements to categorise spend and generate management reports for a chosen period.

Technical Implementation

All API requests must be authenticated using your **API Key** and **API Secret** passed as request headers.
  1. Obtain API Credentials: Contact FinPass to receive your X-API-KEY and X-API-SECRET credentials.
  2. Include in Every Request: Add both headers to each API call as shown below.
  3. Environment Selection: Use the appropriate base URL for your target environment.
EnvironmentBase URL
Productionhttps://api.finpass.ai

Header format:

x-api-key: <YOUR_X_API_KEY>
x-api-secret: <YOUR_X_API_SECRET>

⚠️ Never expose your x-api-secret in client-side code or public repositories. Always make this call from a secure server-side environment.

### Request Headers
HeaderRequiredDescription
x-api-keyYesYour FinPass API key used for authentication.
x-api-secretYesYour FinPass API secret used for authentication.
Content-TypeYesMust be multipart/form-data (set automatically by most HTTP clients when using form data).

Request Body (multipart/form-data)

ParameterTypeRequiredDescription
filesFile (PDF or ZIP)YesOne or more bank statement files. Each file may be a single PDF or a ZIP archive containing multiple PDF statements. Repeat the files field for each file in the batch.
emailStringYesEmail address to which the analysis results or notifications will be sent upon completion.
from_dateString (YYYY-MM-DD)YesStart date of the analysis period. Only transactions on or after this date will be included in the analysis.
to_dateString (YYYY-MM-DD)YesEnd date of the analysis period. Only transactions on or before this date will be included in the analysis.

Supported File Types

FormatMIME TypeDescription
.pdfapplication/pdfA single bank statement document. Upload one or multiple individual PDF files.
.zipapplication/zipA ZIP archive bundling multiple PDF bank statements. The API extracts and processes all PDFs found inside. Only PDF files within the ZIP are processed; any non-PDF entries are ignored.

ZIP File Guidelines

  • The ZIP must contain only PDF files at the root level or in subdirectories.
  • Nested ZIPs (a ZIP inside a ZIP) are not supported.
  • Ensure PDFs inside the ZIP are not password-protected.
  • You may mix individual PDFs and ZIP archives in the same request (e.g., two .pdf files and one .zip).
    :::

Example Request (PDF files)

curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
  --header 'x-api-key: <X_API_KEY>' \
  --header 'x-api-secret: <X_API_SECRET>' \
  --form 'files=@"/path/to/statement-1.pdf"' \
  --form 'files=@"/path/to/statement-2.pdf"' \
  --form 'email="user@example.com"' \
  --form 'from_date="2024-04-01"' \
  --form 'to_date="2025-03-31"'

Example Request (ZIP archive)

curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
  --header 'x-api-key: <X_API_KEY>' \
  --header 'x-api-secret: <X_API_SECRET>' \
  --form 'files=@"/path/to/statements-bundle.zip"' \
  --form 'email="user@example.com"' \
  --form 'from_date="2024-04-01"' \
  --form 'to_date="2025-03-31"'

Example Request (mixed PDF and ZIP)

curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
  --header 'x-api-key: <X_API_KEY>' \
  --header 'x-api-secret: <X_API_SECRET>' \
  --form 'files=@"/path/to/statement-1.pdf"' \
  --form 'files=@"/path/to/statements-bundle.zip"' \
  --form 'email="user@example.com"' \
  --form 'from_date="2024-04-01"' \
  --form 'to_date="2025-03-31"'
### Response Parameters

The API returns a JSON response confirming receipt and processing initiation of the batch.

ParameterTypeDescription
statusStringIndicates the outcome of the request (e.g., success, error).
messageStringHuman-readable message describing the result or any issue encountered.
batch_idStringUnique identifier for the submitted batch, useful for tracking or support queries.
files_receivedIntegerNumber of statement files successfully received in the batch.
emailStringThe email address to which results will be delivered.
from_dateStringThe start date of the analysis period as provided in the request.
to_dateStringThe end date of the analysis period as provided in the request.

Example Successful Response

{
  "status": "success",
  "message": "Batch uploaded successfully. Analysis results will be sent to the provided email.",
  "batch_id": "bsa_batch_a1b2c3d4e5f6",
  "files_received": 2,
  "email": "user@example.com",
  "from_date": "2024-04-01",
  "to_date": "2025-03-31"
}

Possible Error Responses

```json { "status": "error", "message": "Invalid or missing API credentials.", "error_code": "UNAUTHORIZED" } ``` Returned when `x-api-key` or `x-api-secret` is absent, incorrect, or has been revoked. Verify your credentials and retry. ```json { "status": "error", "message": "Validation failed: 'from_date' is required and must be in YYYY-MM-DD format.", "error_code": "VALIDATION_ERROR" } ``` Returned when one or more required fields are missing or malformed. Check that `files`, `email`, `from_date`, and `to_date` are all present and correctly formatted. ```json { "status": "error", "message": "Unsupported file type. Only PDF and ZIP files are accepted for bank statement upload.", "error_code": "UNSUPPORTED_FILE_TYPE" } ``` Returned when an uploaded file is neither a valid PDF nor a ZIP archive. Ensure all files in the `files` field are `.pdf` documents or `.zip` archives containing PDFs. Note that ZIP files must contain only PDF documents; non-PDF contents inside a ZIP are ignored, but a ZIP containing no PDFs will trigger this error. ```json { "status": "error", "message": "An unexpected error occurred. Please try again later or contact support.", "error_code": "INTERNAL_ERROR" } ``` Returned when the server encounters an unexpected condition. Retry with exponential back-off; if the issue persists, contact FinPass support with your `batch_id` if one was issued.

Integration Best Practices

- **Server-side only**: Always make requests to this endpoint from your backend server. Never embed `x-api-key` or `x-api-secret` in mobile apps, browser JavaScript, or any client-facing code. - **Rotate credentials regularly**: Periodically rotate your API secret and update your server configuration to minimise the impact of accidental exposure. - **Validate files before upload**: Check that each file is a valid, non-corrupted PDF or ZIP and does not exceed any size limits before sending the request, to avoid wasted API calls. For ZIP files, verify that all contained files are PDFs and none are password-protected. - **Use HTTPS exclusively**: Always use the `https://` scheme for all API calls to ensure data in transit is encrypted. - **Restrict email recipients**: Ensure the `email` field points only to authorised recipients, as it will receive potentially sensitive financial analysis results. - **Inform users of asynchronous delivery**: Since results are delivered via email, clearly communicate to end users that analysis may take some time and they should check their inbox. - **Validate date ranges client-side**: Before submitting, confirm that `from_date` is earlier than `to_date` and that the range is reasonable (e.g., not more than 24 months) to reduce error rates. - **Provide upload progress feedback**: For large PDF or ZIP files, display a progress indicator in your UI so users know the upload is in progress. - **Handle partial failures gracefully**: If some files fail validation, notify users of which files were rejected and allow them to re-upload corrected versions without resubmitting the entire batch. - **Log batch IDs**: Store the returned `batch_id` in your system so you can reference it when following up with FinPass support or reconciling results.

Code Samples

```bash # Upload individual PDF files curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \ --header 'x-api-key: ' \ --header 'x-api-secret: ' \ --form 'files=@"/path/to/statement-1.pdf"' \ --form 'files=@"/path/to/statement-2.pdf"' \ --form 'email="user@example.com"' \ --form 'from_date="2024-04-01"' \ --form 'to_date="2025-03-31"'

Upload a ZIP archive containing multiple PDFs

curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch'
--header 'x-api-key: <X_API_KEY>'
--header 'x-api-secret: <X_API_SECRET>'
--form 'files=@"/path/to/statements-bundle.zip"'
--form 'email="user@example.com"'
--form 'from_date="2024-04-01"'
--form 'to_date="2025-03-31"'

</Tab>
<Tab title="Python">
```python
import requests

url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch"

headers = {
    "x-api-key": "<X_API_KEY>",
    "x-api-secret": "<X_API_SECRET>",
}

# Option 1: Upload individual PDF files
files = [
    ("files", ("statement-1.pdf", open("/path/to/statement-1.pdf", "rb"), "application/pdf")),
    ("files", ("statement-2.pdf", open("/path/to/statement-2.pdf", "rb"), "application/pdf")),
]

# Option 2: Upload a ZIP archive containing multiple PDFs
# files = [
#     ("files", ("statements-bundle.zip", open("/path/to/statements-bundle.zip", "rb"), "application/zip")),
# ]

# Option 3: Mix of PDFs and a ZIP
# files = [
#     ("files", ("statement-1.pdf", open("/path/to/statement-1.pdf", "rb"), "application/pdf")),
#     ("files", ("statements-bundle.zip", open("/path/to/statements-bundle.zip", "rb"), "application/zip")),
# ]

data = {
    "email": "user@example.com",
    "from_date": "2024-04-01",
    "to_date": "2025-03-31",
}

response = requests.post(url, headers=headers, files=files, data=data)

print(response.status_code)
print(response.json())
```javascript const fs = require("fs"); const FormData = require("form-data"); const axios = require("axios");

const url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch";

const form = new FormData();

// Option 1: Upload individual PDF files
form.append("files", fs.createReadStream("/path/to/statement-1.pdf"), "statement-1.pdf");
form.append("files", fs.createReadStream("/path/to/statement-2.pdf"), "statement-2.pdf");

// Option 2: Upload a ZIP archive containing multiple PDFs
// form.append("files", fs.createReadStream("/path/to/statements-bundle.zip"), {
// filename: "statements-bundle.zip",
// contentType: "application/zip",
// });

form.append("email", "user@example.com");
form.append("from_date", "2024-04-01");
form.append("to_date", "2025-03-31");

axios
.post(url, form, {
headers: {
"x-api-key": "<X_API_KEY>",
"x-api-secret": "<X_API_SECRET>",
...form.getHeaders(),
},
})
.then((response) => {
console.log(response.status);
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});

</Tab>
<Tab title="PHP">
```php
<?php

$url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch";

$curl = curl_init();

// Option 1: Upload individual PDF files
$postFields = [
    'files[0]' => new CURLFile('/path/to/statement-1.pdf', 'application/pdf', 'statement-1.pdf'),
    'files[1]' => new CURLFile('/path/to/statement-2.pdf', 'application/pdf', 'statement-2.pdf'),
    'email'     => 'user@example.com',
    'from_date' => '2024-04-01',
    'to_date'   => '2025-03-31',
];

// Option 2: Upload a ZIP archive containing multiple PDFs
// $postFields = [
//     'files[0]' => new CURLFile('/path/to/statements-bundle.zip', 'application/zip', 'statements-bundle.zip'),
//     'email'     => 'user@example.com',
//     'from_date' => '2024-04-01',
//     'to_date'   => '2025-03-31',
// ];

curl_setopt_array($curl, [
    CURLOPT_URL            => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => $postFields,
    CURLOPT_HTTPHEADER     => [
        'x-api-key: <X_API_KEY>',
        'x-api-secret: <X_API_SECRET>',
    ],
]);

$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

echo "HTTP Status: $httpCode\n";
echo $response;

Related APIs

  • BSA Single Statement Upload — Submit a single bank statement PDF for analysis when batch processing is not required.
  • BSA Analysis Status — Poll the processing status of a previously submitted batch using its batch_id.
  • BSA Results Retrieval — Fetch the structured analysis results (income, expenses, cash flow) for a completed batch.
  • Customer KYC Verification — Verify customer identity documents as part of a broader onboarding or lending workflow alongside bank statement analysis.

Compliance and Legal Considerations

  • Data Privacy: Bank statements contain highly sensitive personal and financial information. Ensure your integration complies with applicable data protection regulations such as DPDP (India), GDPR (EU), or equivalent frameworks in your jurisdiction. Do not store raw statement files longer than operationally necessary.
  • Consent: Obtain explicit, informed consent from individuals before uploading their bank statements to any third-party API. Maintain auditable records of consent.
  • PCI-DSS / Financial Regulations: If your platform handles payment card or regulated financial data, ensure your infrastructure meets the relevant compliance standards before transmitting data to this endpoint.
  • Email Security: Analysis results are delivered to the email address provided. Ensure this address belongs to an authorised recipient and that your email infrastructure is secured against interception or unauthorised forwarding.
  • Audit Trails: Retain logs of all API calls, including batch_id values and timestamps, to support audit and dispute resolution requirements.

Request

Header Params

Body Params multipart/form-dataRequired

Responses

🟢200Success
application/json
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
--header 'X-API-Key: YOUR API KEY' \
--header 'X-API-Secret: YOUR SECRET KEY' \
--form 'files=@""' \
--form 'passwords="YOUR PDF PASSWORDS"' \
--form 'tampering_check=""' \
--form 'from_date=""' \
--form 'to_date=""' \
--form 'salary_min_month=""' \
--form 'salary_min_occurrence=""' \
--form 'salary_keyword=""' \
--form 'emi_min_month=""' \
--form 'emi_min_occurrence=""'
Response Response Example
{
    "data": {
        "batch_id": "batch_e2d2f1924d24",
        "status": "processing",
        "total_files": 2,
        "uploaded_files": 2,
        "failed_files": 0,
        "files": [
            {
                "filename": "statement_bank_statement_9e04f9ced43e.pdf",
                "client_id": "bank_statement_8a192e69a43a",
                "status": "uploaded",
                "error": null
            },
            {
                "filename": "statement_bank_statement_e74919f9bdea.pdf",
                "client_id": "bank_statement_f98c3b15c8e7",
                "status": "uploaded",
                "error": null
            }
        ],
        "filter_from_date": null,
        "filter_to_date": null
    },
    "status_code": 200,
    "success": true,
    "message": "Batch upload successful, processing started",
    "message_code": "success"
}
Previous
Bank Statement Analyser
Next
Batch Result
Built with