Skip to main content

List Transaction Types

GET /api/listaTipoTransacciones
Retrieves all available transaction types.
curl -X GET "https://api.investgo.com/api/listaTipoTransacciones" \
  -H "Authorization: Bearer YOUR_TOKEN"
[
  {
    "idTipoTransaccion": 1,
    "nombre": "Deposito"
  },
  {
    "idTipoTransaccion": 2,
    "nombre": "Retiro"
  }
]

List All Transactions (Admin)

GET /api/admin/listaTransacciones
Retrieves all transactions in the system.
Admin authentication required
curl -X GET "https://api.investgo.com/api/admin/listaTransacciones" \
  -H "Authorization: Bearer ADMIN_TOKEN"
[
  {
    "idTransaccion": 1,
    "monto": 5000.00,
    "fecha": "2024-03-15",
    "idCuentaBancaria": 1,
    "idTipoTransaccion": 1,
    "cuentaBancaria": {
      "idCuentaBancaria": 1,
      "nroCuenta": "123456789"
    },
    "tipoTransaccion": {
      "idTipoTransaccion": 1,
      "nombre": "Deposito"
    }
  }
]

List User Transactions

GET /api/user/listaTransacciones
Retrieves all transactions for the authenticated user.
User authentication required. Uses session to identify current user.
curl -X GET "https://api.investgo.com/api/user/listaTransacciones" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Cookie: JSESSIONID=your_session_id"

List User Transactions (Paginated)

GET /api/user/listTransacciones/page/{page}
Retrieves user transactions with pagination (8 per page).
Requires authenticated session
page
integer
required
Page number (0-indexed)
curl -X GET "https://api.investgo.com/api/user/listTransacciones/page/0" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Cookie: JSESSIONID=your_session_id"
{
  "content": [
    {
      "idTransaccion": 1,
      "monto": 5000.00,
      "fecha": "2024-03-15",
      "idCuentaBancaria": 1,
      "idTipoTransaccion": 1
    }
  ],
  "totalPages": 3,
  "totalElements": 22,
  "pageNumber": 0,
  "pageSize": 8
}

List Transactions by Bank Account

GET /api/user/listaTransacciones/{id}
Retrieves transactions for a specific bank account of the authenticated user.
Requires authenticated session. Only returns transactions for user’s own bank accounts.
id
long
required
Bank account ID
curl -X GET "https://api.investgo.com/api/user/listaTransacciones/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Cookie: JSESSIONID=your_session_id"
[
  {
    "idTransaccion": 1,
    "monto": 5000.00,
    "fecha": "2024-03-15",
    "idCuentaBancaria": 1,
    "idTipoTransaccion": 1
  },
  {
    "idTransaccion": 2,
    "monto": 2000.00,
    "fecha": "2024-03-16",
    "idCuentaBancaria": 1,
    "idTipoTransaccion": 2
  }
]

Create Deposit

POST /api/deposito
Deposits funds from a bank account to the user’s wallet (cartera).
Requires authenticated session. Bank account must belong to the authenticated user.
  • Transfers money from bank account to wallet
  • Transaction date is automatically set to current date
  • Transaction type is automatically set to 1 (Deposito)
  • Bank account balance must be sufficient
  • Updates both bank account and wallet balances atomically

Request Body

monto
double
required
Amount to deposit
idCuentaBancaria
integer
required
Bank account ID to deposit from
curl -X POST "https://api.investgo.com/api/deposito" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Cookie: JSESSIONID=your_session_id" \
  -d '{
    "monto": 5000.00,
    "idCuentaBancaria": 1
  }'
{
  "mensaje": "Deposito realizado con exito"
}

Create Withdrawal

POST /api/retiro
Withdraws funds from the user’s wallet (cartera) to a bank account.
Requires authenticated session. Bank account must belong to the authenticated user.
  • Transfers money from wallet to bank account
  • Transaction date is automatically set to current date
  • Transaction type is automatically set to 2 (Retiro)
  • Wallet balance must be sufficient
  • Updates both wallet and bank account balances atomically

Request Body

monto
double
required
Amount to withdraw
idCuentaBancaria
integer
required
Bank account ID to withdraw to
curl -X POST "https://api.investgo.com/api/retiro" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Cookie: JSESSIONID=your_session_id" \
  -d '{
    "monto": 3000.00,
    "idCuentaBancaria": 1
  }'
{
  "mensaje": "Retiro realizado con exito"
}

Transaction Flow

Deposit Flow

  1. User initiates deposit from bank account
  2. System validates bank account belongs to user
  3. System checks bank account has sufficient balance
  4. Bank account balance is decreased
  5. Wallet balance is increased
  6. Transaction record is created with type “Deposito”

Withdrawal Flow

  1. User initiates withdrawal to bank account
  2. System validates bank account belongs to user
  3. System checks wallet has sufficient balance
  4. Wallet balance is decreased
  5. Bank account balance is increased
  6. Transaction record is created with type “Retiro”

Transaction Schema

idTransaccion
long
Transaction unique identifier
monto
double
Transaction amount
fecha
date
Transaction date (format: yyyy-MM-dd)
idCuentaBancaria
integer
Bank account ID involved in transaction
idTipoTransaccion
long
Transaction type ID (1 = Deposito, 2 = Retiro)
cuentaBancaria
object
Bank account details
tipoTransaccion
object
Transaction type details

Build docs developers (and LLMs) love