Link Core
Welcome to the Link Core API Reference. This service is the central orchestrator for transaction processing and digital asset management across the LedgerLink ecosystem.
Base URL: https://api.ledgerlink.ai/v1
Overview
Link Core is the backbone microservice of the LedgerLink platform, responsible for managing transactions, balances, and digital assets. It orchestrates the entire transaction lifecycle from initiation through screening, approval, and settlement while maintaining accurate balance records and asset definitions.
Technology Stack:
- NestJS backend framework with TypeScript
- PostgreSQL database with TypeORM
- Bull queue for job processing
- Blockchain event monitoring
- RESTful API with Swagger/OpenAPI documentation
Core Capabilities
- Transaction Management: Full lifecycle management of deposits, withdrawals, and transfers
- Transaction Screening: AML/compliance screening via webhook callback with freeze/approve workflows
- Balance Management: Real-time balance tracking for customers and accounts
- Asset Management: Digital asset CRUD operations and configuration
- Ledger Operations: Double-entry bookkeeping and balance reconciliation
- Job Processing: Background job processing with Bull queues
- Blockchain Integration: Monitor and react to blockchain events
Architecture
Data Flow
Deposit Flow:
- Blockchain event detected → Transaction created (PENDING)
- Transaction awaits external screening (external system performs AML checks)
- External system calls
/transactions/complete-screeningwebhook → Approve or freeze - If frozen → Manual review → Approve/Reject via API
- If approved → Balance updated → Customer notified
Withdrawal Flow:
- Customer requests withdrawal → Transaction created (PENDING)
- Transaction awaits external screening (external system performs AML checks)
- External system calls
/transactions/complete-screeningwebhook → Approve or freeze - If frozen → Manual review → Approve/Reject via API
- If approved → Blockchain transaction initiated
API Endpoints
Transaction Operations
- GET /transactions - List all transactions
- GET /transactions/:id - Get a specific transaction
- POST /transactions/withdrawal - Request a withdrawal
- POST /transactions/complete-screening - Complete transaction screening
- POST /transactions/:id/reject-frozen-deposit - Reject a frozen deposit
- POST /transactions/:id/approve-frozen-deposit - Approve a frozen deposit
- POST /transactions/:id/reject-frozen-withdrawal - Reject a frozen withdrawal
- POST /transactions/:id/approve-frozen-withdrawal - Approve a frozen withdrawal
Balance Operations
- GET /balances/customer/:customerId - Get balances for a customer
- GET /balances/account/:accountId - Get balances for an account
Asset Operations
- POST /assets - Create a new digital asset
- GET /assets - List all assets
- GET /assets/:id - Get a specific asset
- PATCH /assets/:id - Update an asset
- DELETE /assets/:id - Delete an asset
Health Check
- GET /health - Service health check
Authentication
Link Core is accessed through the Link Dashboard, which handles all authentication via the Auth Server (BFF).
Architecture:
User → Link Dashboard → Auth Server/BFF (Authentication) → Link Core Service
How It Works:
- Users authenticate with the Link Dashboard (username/password)
- The Auth Server validates JWT tokens and session cookies
- Authenticated requests are proxied to Link Core
- No role-based access control (RBAC) - all authenticated users have full access
- Link Core service itself does not implement authentication middleware
- Internal service-to-service calls are unauthenticated (secure network)
See the Getting Started Guide for integration details.
Transaction Statuses
Link Core manages transactions through various states:
- PENDING: Transaction created, awaiting screening
- SCREENING: Transaction undergoing AML/compliance checks
- FROZEN: Transaction flagged for manual review
- APPROVED: Transaction approved and processing
- COMPLETED: Transaction fully processed
- REJECTED: Transaction rejected by screening or manual review
- FAILED: Transaction processing failed
Job Processing
Link Core uses Bull queues for background processing:
- Screening Complete Queue: Processes approved transactions after screening
- Omnibus Balance Jobs: Manages omnibus wallet balance monitoring
- Blockchain Event Processing: Handles blockchain event reactions
Integration Points
External Services
- Link Quote: Real-time asset pricing for transaction valuation
- Link Tracker: Activity logging and audit trails
- External AML/Compliance System: Calls back to Link Core via webhook (
/transactions/complete-screening) - Wallet Manager: Digital asset custody and transfers
- Blockchain Listener: Blockchain event monitoring
Database
- PostgreSQL: Primary data store for transactions, balances, and assets
- TypeORM: Database ORM with migration support
- Double-entry bookkeeping: Ensures balance integrity
Next Steps
- Getting Started - Learn the basics of API integration
- Error Handling - Handle errors gracefully
- FAQ - Find answers to common questions
Need Help? Contact helpdesk@ledgerlink.ai for assistance with your Link Core integration.