Update Transaction
PUT /api/v1/transactions/:id
Updates an existing transaction. Only provided fields will be updated.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Transaction ID |
Request Body
All fields are optional. Only provided fields will be updated.
| Field | Type | Description |
|---|---|---|
| date | string | Transaction date (YYYY-MM-DD) |
| account_id | string | Account ID |
| inflow | number | Credit amount |
| outflow | number | Debit amount |
| particulars | string | Description |
| balance | number | Account balance |
| entity | string | Entity name |
| category | string | Category name |
| type | string | Transaction type |
| po | string | Purchase order reference |
| comments | string | Additional notes |
Example: Update Category and Entity
curl -X PUT "https://statements.finopsbricks.com/api/v1/transactions/abc123xyz789" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"category": "expense",
"entity": "Updated Entity"
}'
Example: Add Comments
curl -X PUT "https://statements.finopsbricks.com/api/v1/transactions/abc123xyz789" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"comments": "Approved by finance team",
"po": "PO-2025-001"
}'
Example: Clear a Field
To clear a field, set it to null:
curl -X PUT "https://statements.finopsbricks.com/api/v1/transactions/abc123xyz789" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"entity": null
}'
Response
{
"data": {
"id": "abc123xyz789",
"date": "2025-01-05",
"particulars": "Payment received",
"inflow": 1000500,
"outflow": 0,
"balance": 5000000,
"entity": "Updated Entity",
"category": "expense",
"type": "expense",
"po": null,
"comments": null,
"account_id": "acc123",
"account_name": "Main Account",
"statement": "stmt123"
}
}
Note: Monetary values are integers in milli-units. Divide by 1000 for display.
Errors
| Code | Description |
|---|---|
| 400 | Validation error |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks transactions:edit permission |
| 404 | Transaction not found |