Create Transaction

POST /api/v1/transactions

Creates a new transaction.

Request Body

FieldTypeRequiredDescription
datestringYesTransaction date (YYYY-MM-DD)
account_idstringYesAccount ID
inflownumber*Credit amount (money received)
outflownumber*Debit amount (money spent)
particularsstringNoDescription
balancenumberNoAccount balance after transaction
entitystringNoEntity/counterparty name
categorystringNoCategory name
typestringNoTransaction type (default: unknown)
postringNoPurchase order reference
commentsstringNoAdditional notes

*Either inflow or outflow must be provided.

Example: Create Income Transaction

curl -X POST "https://statements.finopsbricks.com/api/v1/transactions" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2025-01-05",
    "account_id": "acc123",
    "inflow": 1000500,
    "particulars": "Invoice payment",
    "entity": "Customer Inc",
    "category": "income"
  }'

Note: inflow: 1000500 = 1000.50 in currency units

Example: Create Expense Transaction

curl -X POST "https://statements.finopsbricks.com/api/v1/transactions" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2025-01-05",
    "account_id": "acc123",
    "outflow": 500000,
    "particulars": "Office supplies",
    "entity": "Amazon",
    "category": "office_expenses",
    "po": "PO-12345"
  }'

Note: outflow: 500000 = 500.00 in currency units

Response

{
  "data": {
    "id": "new123xyz",
    "date": "2025-01-05",
    "particulars": "Invoice payment",
    "inflow": 1000500,
    "outflow": 0,
    "balance": 0,
    "entity": "Customer Inc",
    "category": "income",
    "type": "unknown",
    "po": null,
    "comments": null,
    "account_id": "acc123"
  }
}

Note: Monetary values are integers in milli-units. See Money Values for details.

Notes

  • Manually created transactions are assigned a unique fingerprint
  • The statement field will be null for manually created transactions
  • Rules are not automatically applied; set category and entity in the request

Errors

CodeDescription
400Validation error (missing date, missing account_id, no inflow/outflow)
401Invalid or missing API credentials
403API key lacks transactions:create permission
404Account not found