List Active Investment Opportunities (User)
GET /api/user/listarOportunidadInversion
Retrieves all active investment opportunities for users.
User authentication required
curl -X GET "https://api.investgo.com/api/user/listarOportunidadInversion" \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"idOportunidad": 1,
"rendimiento": 12.5,
"tir": 14.2,
"monto": 50000.00,
"montoRecaudado": 25000.00,
"fechaCaducidad": "2024-06-15",
"fechaRegistro": "2024-01-15",
"fechaPago": "2024-04-15",
"enable": "Activo",
"idEmpresa": 1,
"idUsu": 2
}
]
List Active Investment Opportunities (Admin)
GET /api/admin/listarOportunidadInversion
Retrieves all active investment opportunities for admins.
Admin authentication required
curl -X GET "https://api.investgo.com/api/admin/listarOportunidadInversion" \
-H "Authorization: Bearer ADMIN_TOKEN"
List Investment Opportunities (Paginated)
GET /api/user/listarOportunidadInversion/page/{page}
Retrieves active investment opportunities with pagination (8 per page).
curl -X GET "https://api.investgo.com/api/user/listarOportunidadInversion/page/0" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"content": [
{
"idOportunidad": 1,
"rendimiento": 12.5,
"tir": 14.2,
"monto": 50000.00,
"montoRecaudado": 25000.00,
"fechaCaducidad": "2024-06-15",
"enable": "Activo"
}
],
"totalPages": 4,
"totalElements": 30,
"pageNumber": 0,
"pageSize": 8
}
Get Investment Opportunity by ID
GET /api/user/buscarOportunidades/{idOportunidadIn}
Retrieves a specific investment opportunity by ID.
Investment opportunity ID
curl -X GET "https://api.investgo.com/api/user/buscarOportunidades/1" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"idOportunidad": 1,
"rendimiento": 12.5,
"tir": 14.2,
"monto": 50000.00,
"montoRecaudado": 25000.00,
"fechaCaducidad": "2024-06-15",
"fechaRegistro": "2024-01-15",
"fechaPago": "2024-04-15",
"enable": "Activo",
"empresa": {
"idEmpresa": 1,
"nomEmpresa": "Tech Solutions SAC",
"ruc": "20123456789"
},
"idEmpresa": 1,
"idUsu": 2
}
Get Investment Opportunity Details
GET /api/detalleOportunidadInversion/{id}
Retrieves detailed information about an investment opportunity.
Investment opportunity ID
curl -X GET "https://api.investgo.com/api/detalleOportunidadInversion/1" \
-H "Authorization: Bearer YOUR_TOKEN"
List All Investment Opportunities
GET /api/listarOportunidadInversion
Retrieves all investment opportunities (active and inactive).
curl -X GET "https://api.investgo.com/api/listarOportunidadInversion" \
-H "Authorization: Bearer YOUR_TOKEN"
List Invoices by Investment Opportunity
GET /api/listarFacXIdOpo/{idOportunidad}
Retrieves all invoices associated with an investment opportunity.
Investment opportunity ID
curl -X GET "https://api.investgo.com/api/listarFacXIdOpo/1" \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"idOportunidadFactura": 1,
"idOportunidad": 1,
"idFactura": 1
},
{
"idOportunidadFactura": 2,
"idOportunidad": 1,
"idFactura": 2
}
]
Add Invoice to Temporary List
Adds an invoice to a temporary list for creating an investment opportunity.
This is a session-based temporary list. Use before creating an investment opportunity.
Request Body
curl -X POST "https://api.investgo.com/api/addFactura" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"idFactura": 1
}'
{
"Facturas": [
{
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00
}
]
}
Remove Invoice from Temporary List
DELETE /api/deleteFacturalist/{id}
Removes an invoice from the temporary list.
curl -X DELETE "https://api.investgo.com/api/deleteFacturalist/1" \
-H "Authorization: Bearer YOUR_TOKEN"
Clear Temporary Invoice List
GET /api/refrescarListaFactura
Clears the temporary invoice list.
curl -X GET "https://api.investgo.com/api/refrescarListaFactura" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"Limpio lista Factura": []
}
Create Investment Opportunity
POST /api/insertaOportunidadInversion
Creates a new investment opportunity with invoices from the temporary list.
Requires authenticated session. At least one invoice must be added to temporary list before creating.
- Uses invoices from the temporary session list
- Status is automatically set to “Activo”
- Registration date is set to current date
- montoRecaudado is initialized to 0
- fechaPago is calculated as fechaCaducidad minus 2 months
- Associated invoices are automatically set to “No Activo” after creation
- Temporary list is cleared after successful creation
Request Body
Expected return rate (percentage)
Internal rate of return (TIR)
Expiration date (format: yyyy-MM-dd)
curl -X POST "https://api.investgo.com/api/insertaOportunidadInversion" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"rendimiento": 12.5,
"tir": 14.2,
"monto": 50000.00,
"fechaCaducidad": "2024-06-15",
"idEmpresa": 1
}'
{
"mensaje": "La oportunidad de inversion se registro exitosamente!",
"OportunidadInversion": {
"idOportunidad": 1,
"rendimiento": 12.5,
"tir": 14.2,
"monto": 50000.00,
"montoRecaudado": 0,
"fechaCaducidad": "2024-06-15",
"fechaRegistro": "2024-03-15",
"fechaPago": "2024-04-15",
"enable": "Activo",
"idEmpresa": 1,
"idUsu": 2
}
}
Update Investment Opportunity
PUT /api/actualizarOportunidadInversion
Updates an existing investment opportunity.
- Cannot change: enable status, fechaRegistro, montoRecaudado
- fechaPago is automatically recalculated based on fechaCaducidad
Request Body
Investment opportunity ID
Updated investment amount
curl -X PUT "https://api.investgo.com/api/actualizarOportunidadInversion" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"idOportunidad": 1,
"rendimiento": 13.0,
"tir": 15.0,
"monto": 55000.00,
"fechaCaducidad": "2024-07-15",
"idEmpresa": 1
}'
{
"mensaje": "La oportunidad de inversion se actualizo exitosamente!",
"OportunidadInversion": {
"idOportunidad": 1,
"rendimiento": 13.0,
"tir": 15.0,
"monto": 55000.00
}
}
Delete Investment Opportunity (Soft Delete)
DELETE /api/eliminarOportunidadInversion/{id}
Soft deletes an investment opportunity by setting status to “No Activo”.
This is a soft delete - the opportunity is marked as inactive but not removed from the database.
Investment opportunity ID to delete
curl -X DELETE "https://api.investgo.com/api/eliminarOportunidadInversion/1" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"mensaje": "La oportunidad de inversion se elimino exitosamente!",
"OportunidadInversion": {
"idOportunidad": 1,
"enable": "No Activo"
}
}