Update Transaction

PUT /api/v1/transactions/:id

Updates an existing transaction. Only provided fields will be updated.

Path Parameters

ParameterTypeDescription
idstringTransaction ID

Request Body

All fields are optional. Only provided fields will be updated.

FieldTypeDescription
datestringTransaction date (YYYY-MM-DD)
account_idstringAccount ID
inflownumberCredit amount
outflownumberDebit amount
particularsstringDescription
balancenumberAccount balance
entitystringEntity name
categorystringCategory name
typestringTransaction type
postringPurchase order reference
commentsstringAdditional 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

CodeDescription
400Validation error
401Invalid or missing API credentials
403API key lacks transactions:edit permission
404Transaction not found