Transaction Object
A Transaction represents a single financial transaction extracted from a bank statement or created manually.
Object Structure
{
"id": "abc123xyz789",
"date": "2025-01-05",
"particulars": "ATM WITHDRAWAL HDFC BANK",
"inflow": 0,
"outflow": 5000000,
"balance": 45000000,
"entity": "HDFC Bank",
"category": "cash_withdrawal",
"type": "expense",
"po": null,
"comments": "Monthly cash withdrawal",
"account_id": "acc123xyz",
"account_name": "Main Savings",
"account_currency": "INR",
"statement": "stmt456abc"
}
Fields
Core Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Auto | 12-character unique identifier |
| date | string | Yes | Transaction date (YYYY-MM-DD format) |
| particulars | string | No | Transaction description/narration from bank |
| inflow | number | * | Credit amount (money received) |
| outflow | number | * | Debit amount (money spent) |
| balance | number | No | Account balance after transaction |
*Either inflow or outflow must be provided when creating a transaction.
Categorization Fields
| Field | Type | Description |
|---|---|---|
| entity | string | Counterparty name (e.g., vendor, customer) |
| category | string | Transaction category (e.g., salary, utilities) |
| type | string | Transaction type (see types below) |
| po | string | Purchase order or reference number |
| comments | string | User notes or additional context |
Relationship Fields
| Field | Type | Description |
|---|---|---|
| account_id | string | ID of the account this transaction belongs to |
| account_name | string | Name of the account (read-only, populated from account) |
| account_currency | string | Currency code of the account, e.g. INR, USD (read-only, derived from the account; defaults to INR). Transactions carry no currency of their own. |
| statement | string | ID of the statement this transaction was extracted from |
Transaction Types
| Type | Description |
|---|---|
income | Income transactions (salary, revenue, etc.) |
expense | Expense transactions (purchases, bills, etc.) |
transfer | Transfer between accounts |
asset | Asset acquisition |
liability | Liability payments |
unknown | Type not determined (default) |
Money Values
All monetary values are returned and accepted as integers in milli-units (1/1000 of the currency unit). This avoids floating-point precision issues common in financial applications.
Conversion:
- Divide by 1000 to get the currency value for display
- Multiply by 1000 when sending values to the API
Examples:
| API Value | Currency Value |
|---|---|
1500 | 1.50 (1 rupee 50 paise) |
1000500 | 1000.50 (1000 rupees 50 paise) |
5000000 | 5000.00 (5000 rupees) |
0 | 0.00 |
Why integers?
- No floating-point precision errors (e.g.,
0.1 + 0.2 !== 0.3) - Safe arithmetic operations
- Consistent storage and retrieval
Fingerprinting
Each transaction has a unique fingerprint used for deduplication when importing statements. The fingerprint is computed as:
D-(date)-IF-(inflow)-OF-(outflow)-P-(particulars_without_spaces)
This prevents duplicate transactions when the same statement is uploaded multiple times.
Field Selection
When retrieving transactions, use the fields parameter to request only specific fields:
GET /api/v1/transactions?fields=id,date,inflow,outflow,entity
Available fields:
id, date, particulars, inflow, outflow, balance, entity, category, type, po, comments, account_id, account_name, account_currency, statement
Example: Complete Transaction
{
"id": "txn789xyz123",
"date": "2025-01-15",
"particulars": "NEFT-CR-ACME CORP-INVOICE 1234",
"inflow": 150000000,
"outflow": 0,
"balance": 250000000,
"entity": "Acme Corporation",
"category": "income",
"type": "income",
"po": "INV-1234",
"comments": "January invoice payment",
"account_id": "acc123xyz",
"account_name": "Business Account",
"account_currency": "INR",
"statement": "stmt456abc"
}
Note: inflow: 150000000 = 150,000.00 rupees, balance: 250000000 = 250,000.00 rupees
Related
- Transactions API - Overview and all endpoints
- Create Transaction - Create endpoint
- Account Object - Account reference
- Statement Object - Statement reference