Encrypted, deleted after conversion, never shared

For developers

API Documentation

Reference for uploading, processing, and downloading a bank statement as Excel, programmatically.

Coming soon

API keys

You will create keys from your dashboard and call the endpoints below from your server. This page shows the API as it will work at launch.

Request early access

Authentication

Send your API key in the Authorization header of every request. Keep it on your server, never in a browser or mobile app.

Authorization: Bearer <your_api_key>

Base URL

https://api.bayainy.com/api/v1
POST/upload/preview

Preview before uploading

Classifies each page (digital or scanned) and calculates the exact page cost. Nothing is charged.

POST /upload/preview HTTP/1.1
Authorization: Bearer <your_api_key>
Content-Type: multipart/form-data
file: statement.pdf

Response

{
"page_count": 3,
"digital_pages": 2,
"scanned_pages": 1,
"credit_cost": 4,
"pages": [
{ "page": 1, "type": "digital" },
{ "page": 2, "type": "digital" },
{ "page": 3, "type": "scanned" }
]
}
POST/upload

Upload a statement

Upload a PDF to start extraction. The statement starts at status pending and moves through processing automatically.

POST /upload HTTP/1.1
Authorization: Bearer <your_api_key>
Content-Type: multipart/form-data
file: statement.pdf

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "statement.pdf",
"status": "pending",
"page_count": 3,
"estimated_seconds": 6
}
GET/statements/{id}

Get a statement and its transactions

Use this to find out when processing finishes, and to get the extracted transactions and balances back.

Note: Poll this endpoint every few seconds until status changes from processing to completed (or failed).

GET /statements/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Authorization: Bearer <your_api_key>

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"bank_name": "Al Rajhi Bank",
"transaction_count": 42,
"opening_balance": 12480.00,
"closing_balance": 24755.00,
"available_exports": ["excel", "csv", "qbo", "xml"],
"transactions": [
{
"date": "2026-09-01",
"description": "Card purchase, Panda",
"debit": 184.50,
"credit": 0.00,
"balance": 12295.50,
"category": "grocery",
"reference": "FT26244S1K7Q",
"page_number": 1
}
]
}

Transaction fields

datestring

Transaction date, YYYY-MM-DD.

descriptionstring

What the transaction was, cleaned of reference numbers.

debitnumber

Money out. Always positive, 0 when none.

creditnumber

Money in. Always positive, 0 when none.

balancenumber

Running balance printed on that row. Negative when overdrawn.

categorystring

Spending category, e.g. grocery, transfer, fuel.

referencestring | null

The bank's own reference, when printed.

page_numberinteger

The PDF page the row came from.

GET/statements

List your statements

Returns every statement tied to your account, newest first.

GET /statements HTTP/1.1
Authorization: Bearer <your_api_key>

Response

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "statement.pdf",
"status": "completed",
"transaction_count": 42
}
]
GET/download/{id}/{format}

Download the file

Only available once status is completed. The formats your plan includes are listed in available_exports.

excelcsvqboquickbooksxmlodoozohomt940camt053iif
GET /download/550e8400-e29b-41d4-a716-446655440000/excel HTTP/1.1
Authorization: Bearer <your_api_key>

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
<binary .xlsx file>
DELETE/statements/{id}

Delete a statement

Deletes the statement, its transactions and its files. This cannot be undone.

DELETE /statements/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Authorization: Bearer <your_api_key>

Response

HTTP/1.1 204 No Content

Possible status values

StatusMeaning
pending

Received, about to start.

queued

Waiting for a free slot.

processing

Extraction is running.

completed

Transactions and files are ready.

failed

Could not be processed. The reason is in error_message.

Questions about integrating?

Contact us