API Documentation

Integrate Statement Flow's bank statement processing into your applications with our REST API.

Important: All Endpoints Use POST Method

All Statement Flow API endpoints use the POST HTTP method, even for operations that traditionally use GET (like listing or retrieving data). This is due to the platform's architecture and ensures consistent authentication and request handling.

Pass all parameters in the JSON request body, including filters and IDs.

Quick Start

Get up and running in minutes

1

Get API Key

Generate an API key from your Settings page

2

Upload File

Upload your statement to a public URL

3

Call API

Send the file URL to our conversion endpoint

4

Get Results

Receive clean, formatted transaction data

Need an API Key?

Generate your API key from the Settings page to start making requests. API access is available on Professional plans and higher.

Generate API Key

Base URL

All API requests should be made to:

text
https://statementflow.co/functions

Note: Append the function name to this base URL (e.g., /convertDocument)

Authentication

All API requests require authentication using your API key in the Authorization header:

http
Authorization: Bearer YOUR_API_KEY

Important: Keep your API key secure. Never expose it in client-side code or public repositories.

Rate Limits & Quotas

Request Limits

  • • 60 requests per minute
  • • 1000 requests per hour
  • • Subject to monthly page quotas
  • • File size limit: 10MB

Quota Management

  • • Each page processed counts toward your quota
  • • Check remaining quota via /getUserUsage
  • • Upgrade your plan for higher limits
  • • API usage shares quota with web app

API Endpoints

POSThttps://statementflow.co/functions/convertDocument

Convert a bank statement from a URL to CSV or JSON format

Note: You must first upload your file to a publicly accessible URL, then pass that URL to this endpoint.

Parameters (JSON Body)

NameTypeRequiredDescription
file_urlstringRequiredURL of the PDF or image file to convert
output_formatstringOptionalOutput format: "csv" or "json". Default: "csv"
POSThttps://statementflow.co/functions/getUserUsage

Get current usage statistics and remaining quota

Note: Returns pages used, remaining quota, and billing cycle information.

POSThttps://statementflow.co/functions/listUserDocuments

List your processed documents

Note: Returns a list of documents with their processing status and metadata.

Parameters (JSON Body)

NameTypeRequiredDescription
limitintegerOptionalNumber of documents to return (default: 50, max: 100)
statusstringOptionalFilter by status: "parsed", "processing", "failed"
POSThttps://statementflow.co/functions/getDocumentDetails

Get details of a specific processed document

Note: Returns complete document metadata including transaction count and download URLs.

Parameters (JSON Body)

NameTypeRequiredDescription
document_idstringRequiredThe document ID to retrieve

Code Examples

Convert a bank statement using different programming languages

bash
curl -X POST https://statementflow.co/functions/convertDocument \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://your-storage.com/statement.pdf",
    "output_format": "csv"
  }'

Response Format

Successful conversion response:

json
{
  "data": {
    "success": true,
    "document_id": "doc_1234567890",
    "message": "Document processed successfully",
    "filename": "bank_statement.pdf",
    "pages_processed": 3,
    "transactions_found": 45,
    "csv_url": "https://files.statementflow.co/converted/abc123.csv",
    "json_url": "https://files.statementflow.co/converted/abc123.json",
    "pages_charged": 3,
    "balance_validation": {
      "opening_balance": 1250.00,
      "closing_balance": 1847.32,
      "calculated_balance": 1847.32,
      "balance_matches": true
    }
  }
}

Error response:

json
{
  "data": {
    "success": false,
    "error": "INVALID_FILE_FORMAT",
    "message": "Only PDF and image files are supported",
    "details": "Uploaded file type: application/excel"
  }
}

Output Formats

CSV Format

The generated CSV follows this exact format:

csv
Date,Description,Reference Number,Amount
2024-01-15,ATM WITHDRAWAL,REF123456,-50.00
2024-01-16,SALARY DEPOSIT,SAL789012,2500.00
2024-01-17,GROCERY STORE,CARD890123,-87.45

JSON Format

The JSON format provides structured data with additional metadata:

json
[
  {
    "date": "2024-01-15",
    "description": "ATM WITHDRAWAL",
    "reference_number": "REF123456",
    "amount": -50.00
  },
  {
    "date": "2024-01-16", 
    "description": "SALARY DEPOSIT",
    "reference_number": "SAL789012",
    "amount": 2500.00
  }
]

• Date: YYYY-MM-DD format

• Description: Transaction description (cleaned and formatted)

• Reference Number: Transaction reference, check number, or ID (if available)

• Amount: Positive for credits/deposits, negative for debits/withdrawals