The ledger system manages bank accounts, beneficiaries, and SPEI transfers. All operations require JWT authentication. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Alejandrin08/Hackathon-SPEI/llms.txt
Use this file to discover all available pages before exploring further.
BaseController extracts the authenticated user’s ID from the ClaimTypes.NameIdentifier JWT claim on every request.
SPEI (Sistema de Pagos Electrónicos Interbancarios) is Mexico’s interbank electronic payment network. Transfers settle in seconds between any CLABE-enabled account.
Accounts
Each user can hold one or more bank accounts. Accounts are identified by theiraccountNumber field, which can be a CLABE (Clave Bancaria Estandarizada) for incoming SPEI transfers.
Create account
POST /api/ledger/accountsCreates a new bank account for the authenticated user using a provided account number and type.List accounts
GET /api/ledger/accountsReturns all accounts belonging to the authenticated user, including current balances.Beneficiaries
Beneficiaries are trusted recipients saved by the user. Adding a beneficiary before sending money simplifies recurring transfers and enables the risk model to detect first-time recipients.Add beneficiary
POST /api/ledger/beneficiariesSaves a new recipient with their name, account number, and bank name.List beneficiaries
GET /api/ledger/beneficiariesReturns all saved beneficiaries for the authenticated user.Remove beneficiary
DELETE /api/ledger/beneficiaries/{id}Removes a beneficiary from the user’s saved list.Transactions
Create transaction
POST /api/ledger/transactionsInitiates a SPEI transfer. Called only after the user has confirmed via ConfirmDialog.List transactions
GET /api/ledger/transactionsReturns the transaction history for the authenticated user, ordered by timestamp descending.Transfer flow
Select or add a beneficiary
The user picks a recipient from their saved beneficiary list, or adds a new beneficiary by entering a name, account number, and bank name.
Enter amount
The user types the transfer amount. Basic validation (positive number, sufficient balance) runs client-side.
Risk evaluation
Before showing the confirmation screen, the frontend calls See the risk detection documentation for full response details.
POST /ai/risk with the transaction details.Review risk alert (if applicable)
If the risk level is
medium or high, the RiskBadge component shows the risk level and ConfirmDialog presents a plain-language explanation of the detected risk factors. The user can review or cancel before continuing.Frontend views
| View | Description |
|---|---|
TransferView | Send money to a saved beneficiary or a new recipient |
ReceiveView | Display the user’s CLABE number so others can send money to them |
PayServicesView | Pay bills and services using the same SPEI transfer mechanism |
