Skip to main content

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.
id
integer
required
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"
{
  "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.
nroCuenta
string
required
Bank account number (must be unique)
nroCuentaCci
string
required
CCI (Cuenta de Cargo Interbancario) number (must be unique)
cvv
string
required
Card CVV security code
mes
string
required
Card expiration month (01-12)
year
string
required
Card expiration year (e.g., “2025”)
nombreCompleto
string
required
Account holder’s full name
bancos
object
required
Bank information
monedas
object
required
Currency information
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
    }
  }'
{
  "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”.
idCuentaBancaria
integer
required
Bank account ID to update
nroCuenta
string
required
Bank account number (must be unique)
nroCuentaCci
string
required
CCI number (must be unique)
cvv
string
required
Card CVV security code
mes
string
required
Card expiration month
year
string
required
Card expiration year
nombreCompleto
string
required
Account holder’s full name
saldo
double
required
Account balance
fechaRegistro
date
required
Original registration date (yyyy-MM-dd format)
bancos
object
required
Bank information
monedas
object
required
Currency information
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
    }
  }'
{
  "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.
id
integer
required
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"
{
  "mensaje": "Se elimino la cuenta"
}

Bank Account Schema

idCuentaBancaria
integer
Bank account unique identifier
nroCuenta
string
Bank account number
nroCuentaCci
string
CCI (Cuenta de Cargo Interbancario) number for interbank transfers
cvv
string
Card CVV security code
mes
string
Card expiration month (01-12)
year
string
Card expiration year
nombreCompleto
string
Account holder’s full name
saldo
double
Current account balance (default: 45000.00 for new accounts)
enable
string
Account status (“Activo” or “No Activo”)
fechaRegistro
date
Account registration date (yyyy-MM-dd format)
bancos
object
Bank information
monedas
object
Currency information
usuarioId
long
User ID who owns the account
usuario
object
User details (optional, may not be included in all responses)

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

  1. Valid Registration
    {
      "nroCuenta": "123456789",
      "nroCuentaCci": "00212345678901234567"
    }
    
    ✓ Both numbers are unique and different from each other
  2. Invalid: Duplicate Account Number
    {
      "nroCuenta": "123456789",  // Already exists
      "nroCuentaCci": "00299999999999999999"
    }
    
    ❌ Error: “El número de cuenta bancaria ya existe”
  3. Invalid: Duplicate CCI Number
    {
      "nroCuenta": "999999999",
      "nroCuentaCci": "00212345678901234567"  // Already exists
    }
    
    ❌ Error: “El número CCI ya existe”
  4. 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”
  5. 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

  1. 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
  2. Active Use
    • Account can be used for deposits and withdrawals
    • Balance updated through transactions
    • Account details can be updated
  3. Soft Deletion
    • User deletes account
    • Status changed to “No Activo”
    • Account data retained in database
    • Cannot be used for new transactions

Balance Operations

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:
  1. Deposit Flow
    • User transfers money from bank account to wallet
    • Bank account balance decreased
    • Wallet balance increased
  2. 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

Build docs developers (and LLMs) love