LedgerRocket API Documentation

Welcome to the LedgerRocket API - a comprehensive financial ledger platform built for modern fintech applications. Our API provides enterprise-grade double-entry accounting, event-driven transaction processing, and real-time balance queries.

What is LedgerRocket?

LedgerRocket is a distributed ledger system that helps you:

  • Track financial transactions with double-entry accounting precision

  • Process events through customizable templates that generate journal entries

  • Query balances in real-time across accounts, entities, and ledgers

  • Manage multi-tenant environments with site-level isolation

  • Maintain audit trails with immutable event and transfer records

API Architecture

The LedgerRocket API is composed of three core services, each handling specific aspects of the ledger system:

🏦 Ledger Service (/v2/ledger/*)

Manages the foundational ledger structures:

  • Sites - Multi-tenant environments for platform isolation

  • Entities - Legal entities (companies, individuals, custodians)

  • Ledgers - Entity-currency ledgers containing financial accounts

  • Accounts - Financial accounts with chart of accounts codes

  • Metadata - Countries, currencies, event types, products, categories

⚡ Event Service (/v2/event-service/*)

Handles transaction processing and event ingestion:

  • Events - Ingest business events that trigger financial transactions

  • Templates - Define how events map to journal entries

  • Transfers - Query transfer history by account

  • Validation - Dry-run validation for events and templates

📊 Balance Service (/v2/balances/*)

Provides real-time financial data queries:

  • Account Balances - Current and historical balance queries

  • Balance History - Point-in-time balance snapshots

  • Transfers - Transfer lookups across the ledger

  • Events - Balance impact of specific events

Development Status

⚠️ This is a Development Environment

The API documented here is actively being developed and improved. Expect:

  • New features and endpoints to be added regularly

  • Occasional breaking changes as we refine the design

  • Response schemas to evolve based on real-world usage

  • Performance optimizations as we scale

Production API - Once available, production documentation will be published separately with stability guarantees and versioning commitments.

Quick Start

1. Get Credentials

Contact your LedgerRocket representative to receive:

  • API Key for machine-to-machine access

  • OAuth credentials for user authentication (if applicable)

2. Choose Your Service

Explore the three API services in the navigation:

3. Authentication

Include your API key in all requests:

curl -H "X-API-Key: your-api-key-here" \
  https://dev.ledgerrocket.com/v2/ledger/api/v1/sites

For user sessions (dashboard/UI), include a JWT token:

curl -H "Authorization: Bearer <your-jwt-token>" \
  https://dev.ledgerrocket.com/v2/balances/api/v1/accounts

4. Try the API

Use the "Try It" feature in the API reference to test endpoints directly from your browser. No code required!

Common Workflows

Creating a Ledger System

  1. Create a Site - Establish your multi-tenant environment

  2. Create Entities - Add legal entities (companies, users)

  3. Create Ledgers - Set up entity-currency ledgers

  4. Create Accounts - Add financial accounts to ledgers

  5. Set up Templates - Define event-to-transaction mappings

Processing Transactions

  1. Send Events - POST events to /v2/event-service/api/v1/events

  2. Validate First - Use validation endpoints to dry-run events

  3. Query Transfers - Check resulting transfers via Event or Balance service

  4. Monitor Balances - Track account balances in real-time

Querying Financial Data

  1. List Accounts - Get all accounts for a site

  2. Get Account Balance - Fetch current balance for specific account

  3. Balance History - Query historical balances at specific dates

  4. Transfer Lookups - Search transfers by various criteria

API Conventions

Multi-Tenancy

Most resources are scoped to a Site ID. Include the site_id in the path:

/api/v1/sites/{site_id}/accounts
/api/v1/sites/{site_id}/templates

Resource IDs

  • UUIDs are used for all resource identifiers

  • IDs are immutable once created

  • External IDs can be provided for integration with your systems

Pagination

List endpoints support pagination:

  • limit - Number of results per page (default: 50, max: 100)

  • offset - Number of results to skip

  • Response includes total_count for total available records

Error Handling

API errors follow standard HTTP status codes:

  • 400 - Bad Request (invalid parameters)

  • 401 - Unauthorized (missing/invalid credentials)

  • 404 - Not Found (resource doesn't exist)

  • 422 - Unprocessable Entity (validation failed)

  • 500 - Internal Server Error (something went wrong on our end)

Error responses include a message explaining what went wrong.

Need Help?

Next Steps

  1. Browse the API Reference - Explore endpoints in the left sidebar

  2. Review Schemas - Understand request/response structures

  3. Test Endpoints - Use "Try It" to make real API calls

  4. Build Integration - Start integrating LedgerRocket into your application

Happy building! 🚀