Transaction Editing
Edit transactions, restore the originals, or re-run validation and metrics.
After a document is processed, edit its transactions, restore the originals, or re-run validation and metrics on edited data, for correcting errors, re-categorizing, or adjusting values before reporting.
Scope
Available for bank_statement and passbook. PUT /transactions auto-revalidates by default; pass revalidate: false to call /revalidate separately.
/api/v1/documents/{id}/transactionsReplace the transaction array on a processed document. A full replacement, not a patch. revalidate: true (default) re-runs validation and metrics inline; set false to call POST /revalidate separately.
Python
updated = client.edit_transactions(12345, transactions=[
{
"date": "01-02-2024",
"description": "SALARY CREDIT",
"credit": 30000.00,
"debit": None,
"balance": 80000.00,
"category": "income",
"subcategory": "salary",
"transaction_type": "credit",
},
])
print(updated.status, updated.transactions_count)Edit response
{
"success": true,
"transactions": [
{
"date": "01-02-2024",
"description": "SALARY CREDIT",
"credit": 30000.00,
"debit": null,
"balance": 80000.00,
"category": "income",
"subcategory": null,
"transaction_type": "credit"
}
],
"metrics": {
"total_inflow": 45000.00,
"total_outflow": 33000.00,
"net_cash_flow": 12000.00,
"total_transactions": 2
},
"balance_checks": { "..." : "..." },
"edit_history": {
"edited_at": "2025-06-15T10:30:00Z",
"previous_count": 25,
"new_count": 2
}
}/api/v1/documents/{id}/transactions/revertDiscard all edits and restore the original extracted transactions, resetting metrics and validation to their original state.
Python
reverted = client.revert_transactions(12345)
print(reverted.status, reverted.transactions_count)Revert response
{
"success": true,
"transactions": [
{
"date": "01-02-2024",
"description": "SALARY CREDIT",
"credit": 30000.00,
"debit": null,
"balance": 80000.00,
"category": "income"
}
],
"message": "Original transactions restored successfully."
}/api/v1/documents/{id}/transactions/revalidateRe-run validation and re-compute all metrics (inflow/outflow, category breakdowns, extended metrics) and fraud signals against the current transaction data. Call after editing transactions.
Python
result = client.revalidate_transactions(12345)
print(result.status)
print(result.metrics) # re-computed metricsRevalidate response
{
"success": true,
"transactions": [
{
"date": "01-02-2024",
"description": "SALARY CREDIT",
"credit": 30000.00,
"debit": null,
"balance": 80000.00,
"category": "income"
}
],
"metrics": {
"total_inflow": 45000.00,
"total_outflow": 33000.00,
"net_cash_flow": 12000.00,
"opening_balance": 50000.00,
"closing_balance": 62000.00,
"average_balance": 58000.00,
"total_transactions": 25,
"by_category": { "..." : "..." },
"by_month": { "..." : "..." },
"extended_metrics": { "..." : "..." }
},
"balance_checks": { "..." : "..." }
}Typical workflow
PUT /transactions (auto-revalidates) → GET /results/{id} for updated output. With revalidate: false, call POST /revalidate to re-compute metrics. POST /revert undoes all edits at any time.


