Get Bank Account Details
GET /api/detalleCuentaBancaria/{id}
Retrieves detailed information about a specific bank account.
Requires authenticated session. Users can only access their own bank accounts.
Bank account ID to retrieve
curl -X GET "https://api.investgo.com/api/detalleCuentaBancaria/1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Cookie: JSESSIONID=your_session_id"
200 - Success
404 - Not Found
400 - Bad Request
500 - Server Error
{
"idCuentaBancaria" : 1 ,
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "00212345678901234567" ,
"cvv" : "123" ,
"mes" : "12" ,
"year" : "2025" ,
"nombreCompleto" : "Juan Pérez" ,
"saldo" : 45000.00 ,
"enable" : "Activo" ,
"fechaRegistro" : "2024-03-15" ,
"bancos" : {
"idBancos" : 1 ,
"nomBancos" : "Banco de Crédito del Perú"
},
"monedas" : {
"idMonedas" : 1 ,
"nomMonedas" : "Soles" ,
"valorMoneda" : "PEN"
},
"usuarioId" : 5
}
List All Bank Accounts (Admin)
GET /api/listarCuentaBancaria
Retrieves all bank accounts in the system.
Admin authentication required
curl -X GET "https://api.investgo.com/api/listarCuentaBancaria" \
-H "Authorization: Bearer ADMIN_TOKEN"
[
{
"idCuentaBancaria" : 1 ,
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "00212345678901234567" ,
"nombreCompleto" : "Juan Pérez" ,
"saldo" : 45000.00 ,
"enable" : "Activo" ,
"fechaRegistro" : "2024-03-15" ,
"bancos" : {
"idBancos" : 1 ,
"nomBancos" : "Banco de Crédito del Perú"
},
"monedas" : {
"idMonedas" : 1 ,
"nomMonedas" : "Soles" ,
"valorMoneda" : "PEN"
},
"usuarioId" : 5
}
]
List Current User’s Bank Accounts
GET /api/user/listarCuentaBancaria
Retrieves all bank accounts belonging to the authenticated user.
Requires authenticated session. Uses session to identify current user.
curl -X GET "https://api.investgo.com/api/user/listarCuentaBancaria" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Cookie: JSESSIONID=your_session_id"
[
{
"idCuentaBancaria" : 1 ,
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "00212345678901234567" ,
"nombreCompleto" : "Juan Pérez" ,
"saldo" : 45000.00 ,
"enable" : "Activo" ,
"fechaRegistro" : "2024-03-15" ,
"bancos" : {
"idBancos" : 1 ,
"nomBancos" : "Banco de Crédito del Perú"
},
"monedas" : {
"idMonedas" : 1 ,
"nomMonedas" : "Soles" ,
"valorMoneda" : "PEN"
},
"usuarioId" : 5
},
{
"idCuentaBancaria" : 2 ,
"nroCuenta" : "987654321" ,
"nroCuentaCci" : "00298765432109876543" ,
"nombreCompleto" : "Juan Pérez" ,
"saldo" : 25000.00 ,
"enable" : "Activo" ,
"fechaRegistro" : "2024-04-10" ,
"bancos" : {
"idBancos" : 2 ,
"nomBancos" : "BBVA Continental"
},
"monedas" : {
"idMonedas" : 2 ,
"nomMonedas" : "Dólares" ,
"valorMoneda" : "USD"
},
"usuarioId" : 5
}
]
Register New Bank Account
POST /api/registrarCuentaBancaria
Creates a new bank account for the authenticated user.
Requires authenticated session. The system automatically assigns the user ID from the session.
New bank accounts are created with an initial balance of 45,000.00 and “Activo” status.
Bank account number (must be unique)
CCI (Cuenta de Cargo Interbancario) number (must be unique)
Card expiration month (01-12)
Card expiration year (e.g., “2025”)
Account holder’s full name
Bank information Bank ID from the banks catalog
Currency information Currency ID from the currencies catalog
curl -X POST "https://api.investgo.com/api/registrarCuentaBancaria" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Cookie: JSESSIONID=your_session_id" \
-d '{
"nroCuenta": "123456789",
"nroCuentaCci": "00212345678901234567",
"cvv": "123",
"mes": "12",
"year": "2025",
"nombreCompleto": "Juan Pérez",
"bancos": {
"idBancos": 1
},
"monedas": {
"idMonedas": 1
}
}'
200 - Success
400 - Validation Error
400 - Validation Error
400 - Validation Error
400 - Validation Error
400 - Validation Error
400 - Registration Failed
500 - Server Error
{
"mensaje" : " Tú cuenta se registro exitosamente" ,
"cuentaBancaria" : {
"idCuentaBancaria" : 1 ,
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "00212345678901234567" ,
"cvv" : "123" ,
"mes" : "12" ,
"year" : "2025" ,
"nombreCompleto" : "Juan Pérez" ,
"saldo" : 45000.00 ,
"enable" : "Activo" ,
"fechaRegistro" : "2024-03-15" ,
"bancos" : {
"idBancos" : 1
},
"monedas" : {
"idMonedas" : 1
},
"usuarioId" : 5
}
}
Update Bank Account
PUT /api/actualizarCuentaBancaria
Updates an existing bank account for the authenticated user.
Requires authenticated session. Users can only update their own bank accounts. The account status is automatically set to “Activo”.
Bank account ID to update
Bank account number (must be unique)
CCI number (must be unique)
Account holder’s full name
Original registration date (yyyy-MM-dd format)
Bank information Bank ID from the banks catalog
Currency information Currency ID from the currencies catalog
curl -X PUT "https://api.investgo.com/api/actualizarCuentaBancaria" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Cookie: JSESSIONID=your_session_id" \
-d '{
"idCuentaBancaria": 1,
"nroCuenta": "123456789",
"nroCuentaCci": "00212345678901234567",
"cvv": "456",
"mes": "06",
"year": "2026",
"nombreCompleto": "Juan Pérez García",
"saldo": 45000.00,
"fechaRegistro": "2024-03-15",
"bancos": {
"idBancos": 1
},
"monedas": {
"idMonedas": 1
}
}'
200 - Success
400 - Validation Error
400 - Validation Error
400 - Validation Error
200 - Account Not Found
200 - Update Failed
200 - Server Error
{
"mensaje" : "Se actualizo la cuenta: 1"
}
Delete Bank Account (Soft Delete)
DELETE /api/user/eliminarCuentaBancaria/{id}
Soft deletes a bank account by setting its status to “No Activo”.
Requires authenticated session. Users can only delete their own bank accounts. This is a soft delete - the account is not permanently removed, just marked as inactive.
Bank account ID to delete
curl -X DELETE "https://api.investgo.com/api/user/eliminarCuentaBancaria/1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Cookie: JSESSIONID=your_session_id"
200 - Success
404 - Not Found
400 - Deletion Failed
500 - Server Error
{
"mensaje" : "Se elimino la cuenta"
}
Bank Account Schema
Bank account unique identifier
CCI (Cuenta de Cargo Interbancario) number for interbank transfers
Card expiration month (01-12)
Account holder’s full name
Current account balance (default: 45000.00 for new accounts)
Account status (“Activo” or “No Activo”)
Account registration date (yyyy-MM-dd format)
User ID who owns the account
User details (optional, may not be included in all responses) User’s paternal last name
Validation Rules
The system enforces strict validation rules for bank accounts:
Uniqueness Validation
Account number (nroCuenta) must be unique across all bank accounts
CCI number (nroCuentaCci) must be unique across all bank accounts
Account number and CCI number cannot be the same value
A CCI number cannot match any existing account number
An account number cannot match any existing CCI number
Example Validation Scenarios
Valid Registration
{
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "00212345678901234567"
}
✓ Both numbers are unique and different from each other
Invalid: Duplicate Account Number
{
"nroCuenta" : "123456789" , // Already exists
"nroCuentaCci" : "00299999999999999999"
}
❌ Error: “El número de cuenta bancaria ya existe”
Invalid: Duplicate CCI Number
{
"nroCuenta" : "999999999" ,
"nroCuentaCci" : "00212345678901234567" // Already exists
}
❌ Error: “El número CCI ya existe”
Invalid: Same Number for Both Fields
{
"nroCuenta" : "123456789" ,
"nroCuentaCci" : "123456789" // Same as account number
}
❌ Error: “El número de cuenta bancaria no puede ser igual al número de CCI”
Invalid: CCI Matches Existing Account Number
{
"nroCuenta" : "999999999" ,
"nroCuentaCci" : "123456789" // Matches someone's account number
}
❌ Error: “El número de CCI ingresado pertenece a una cuenta bancaria existente”
Bank Account Management
Account Lifecycle
Registration
User provides account details
System validates uniqueness of account number and CCI
Account created with initial balance of 45,000.00
Status set to “Activo”
Registration date recorded
Active Use
Account can be used for deposits and withdrawals
Balance updated through transactions
Account details can be updated
Soft Deletion
User deletes account
Status changed to “No Activo”
Account data retained in database
Cannot be used for new transactions
Balance Operations
View Balance
Deposit to Wallet (from Bank Account)
Withdraw to Bank Account (from Wallet)
curl -X GET "https://api.investgo.com/api/detalleCuentaBancaria/1" \
-H "Authorization: Bearer YOUR_TOKEN"
Integration with Other Features
Wallet Integration
Bank accounts are the primary method for funding user wallets:
Deposit Flow
User transfers money from bank account to wallet
Bank account balance decreased
Wallet balance increased
Withdrawal Flow
User transfers money from wallet to bank account
Wallet balance decreased
Bank account balance increased
Transaction History
All deposits and withdrawals involving bank accounts are recorded in the transaction history with references to:
Bank account ID
Bank name
Currency type
Transaction amount
Transaction date
Security Considerations
CVV and card details are stored in the database - ensure proper encryption in production
Users can only access their own bank accounts
Account number and CCI validation prevents duplicate entries
Soft delete preserves data for audit trails