Direct Transactions
Open Ledger offers a comprehensive Transaction API that allows for direct manipulation of transaction data within your application. This provides you with full control over how transactions are created, categorized, and managed in your financial ledger.
Transaction API Endpoints
The following endpoints are available for managing transactions:
Creating Transactions
To create a new transaction, send a POST request with the transaction details:
Response:
Getting Transactions
Retrieve transactions with cursor-based pagination:
Response:
Approving Transactions
To approve transactions (change status from PENDING
to POSTED
):
Response:
Editing Transactions
Edit an existing transaction:
Response:
Getting Transactions by Month
Retrieve transactions for a specific month:
Response:
Categorizing Transactions
Assign categories to transactions:
Response:
Searching Transactions
Search for transactions with advanced filtering:
Response:
Natural Language Interaction
Interact with your transactions using natural language:
Response:
Get Entity Counterparties
Get all counterparties for an entity with their transaction history:
Response:
AI Transaction Categorization
For AI-powered transaction categorization, use the AI Analysis endpoints instead of the transactions API. See the AI Analysis documentation for details on:
/v1/ai/{id}/suggest-categories-vector
- Vector-enhanced category suggestions- Advanced AI categorization features
- Machine learning-powered account suggestions
Transaction Status Values
Open Ledger supports the following transaction status values:
Best Practices
-
Provide Clear Descriptions: Include detailed, searchable descriptions for each transaction to make reporting more useful.
-
Use Double-Entry Accounting: Always specify both debit and credit accounts for proper ledger balance.
-
Handle Status Properly: Use the appropriate transaction status values and follow proper approval workflows.
-
Leverage AI Categorization: Use the AI Analysis endpoints to reduce manual work and improve accuracy.
-
Use Cursor-Based Pagination: The API uses cursor-based pagination for better performance with large datasets.
-
Validate Input Data: Ensure amounts, account IDs, and other data are valid before submitting to the API.
-
Implement Error Handling: Be prepared to handle and retry API failures gracefully.
-
Regular Reconciliation: Periodically approve and reconcile pending transactions to maintain up-to-date ledgers.
Error Responses
When an error occurs, the API will return an appropriate HTTP status code and a JSON response:
Common HTTP status codes:
400 Bad Request
: Missing or invalid parameters401 Unauthorized
: Authentication failure403 Forbidden
: Permission denied404 Not Found
: Resource not found500 Internal Server Error
: Server-side error