Create Transaction
POST /api/v1/transactions
Creates a new transaction.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | Transaction date (YYYY-MM-DD) |
| account_id | string | Yes | Account ID |
| inflow | number | * | Credit amount (money received) |
| outflow | number | * | Debit amount (money spent) |
| particulars | string | No | Description |
| balance | number | No | Account balance after transaction |
| entity | string | No | Entity/counterparty name |
| category | string | No | Category name |
| type | string | No | Transaction type (default: unknown) |
| po | string | No | Purchase order reference |
| comments | string | No | Additional 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
statementfield will be null for manually created transactions - Rules are not automatically applied; set category and entity in the request
Errors
| Code | Description |
|---|---|
| 400 | Validation error (missing date, missing account_id, no inflow/outflow) |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks transactions:create permission |
| 404 | Account not found |