Transactions
Overview
A transaction represents an expense event — for example, a card payment, bank transfer, or cash withdrawal. Transactions serve as the core entity for tracking business spending. They can be created directly by your system or imported from external sources such as accounting software or banking feeds.
Transactions can optionally be linked to receipts, which provide supporting documentation for auditing and reconciliation purposes.
Create a transaction
To manually create a new transaction, call POST /transactions
:
The successful 201
response returns the created transaction:
Create multiple transactions
You can create multiple transactions at once by calling POST /transactions/bulk
.
This endpoint is designed for high-volume inserts and supports up to 5000 records per request.
Each request must include a data
array of transaction objects. The order of records in the request will be preserved in the response, so each result corresponds to the same index in the input.
If a transaction is successfully saved, the response will include its id
. If a record fails validation or is ignored as a duplicate, the corresponding id
will be null
. A duplicate is defined as an identical pair of entity_id + external_id
(where external_id
is not null
); in that case, the second duplicate will be skipped.
The response also contains counters showing how many records were successfully saved and how many failed:
Match a receipt to a transaction
To match a receipt to a transaction, send a PATCH
request to the /receipts/{receipt_id}
endpoint with the request body containing the transaction_id
associated with the recepit:
AI Receipt-to-Transaction Automatching
Receipts can be automatically matched to transactions by an AI-driven matching engine once the OCR is completed. The system evaluates only unmatched items with the same entity_id
, a timestamp difference of ≤1 day, and either the same (amount + currency)
or (merchant_amount + currency)
(with ≤1% allowed difference).
The AI logic applies a two-step approach:
- Equal match - Exact merchant name match (case-insensitive, trimmed).
- Semantic match - If no exact match, merchant name + location are embedded and compared using fuzzy semantic similarity (≥0.8).
Considerations
- The matching process runs only when receipts and transactions share the same
entity_id
and satisfy the required timestamp and amount conditions. - When an exact merchant name match is found, the receipt is immediately linked to the transaction.
- If there is no exact match but the semantic similarity between merchant name and location is at least 0.8, the system also links the receipt automatically.
- If neither condition is met, the receipt remains unmatched.
- To ensure data consistency, each receipt can only ever be linked to one transaction.
List all transactions
To get information about all transactions associated with the specified entity, call GET /transactions
.
Retrieve a transaction
To get information about a specific transaction, call GET /transactions/{transaction_id}
.
Edit a transaction
To edit an existing transaction, call PATCH /transactions/{transaction_id}
.
Delete a transaction
To delete a specific transaction, call DELETE /transactions/{transaction_id}
.