Get Invoice by Code
GET /api/buscarfac/{codFactura}
Retrieves a single invoice by its code.
The invoice code (e.g., “F-001”)
curl -X GET "https://api.investgo.com/api/buscarfac/F-001" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"factura": {
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00,
"fechaEmision": "2024-01-15",
"fechaPago": "2024-02-15",
"enable": "Activo",
"descripcion": "Servicio de consultoría",
"empresa": {
"idEmpresa": 1,
"nomEmpresa": "Tech Solutions SAC",
"ruc": "20123456789"
}
}
}
List Invoices by Date Range
GET /api/facturas/{fechaInicio}/{fechaFin}
Retrieves invoices within a specified date range.
Start date (format: yyyy-MM-dd)
End date (format: yyyy-MM-dd)
curl -X GET "https://api.investgo.com/api/facturas/2024-01-01/2024-01-31" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"facturas": [
{
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00,
"fechaEmision": "2024-01-15",
"fechaPago": "2024-02-15",
"enable": "Activo",
"descripcion": "Servicio de consultoría"
}
]
}
List Invoices by Company
GET /api/facturas/{idEmpresa}
Retrieves all invoices for a specific company.
curl -X GET "https://api.investgo.com/api/facturas/1" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"facturas": [
{
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00,
"fechaEmision": "2024-01-15",
"fechaPago": "2024-02-15",
"enable": "Activo",
"descripcion": "Servicio de consultoría"
}
]
}
List Active Invoices by Company
GET /api/facturas/activas/{idEmpresa}
Retrieves all active invoices for a specific company.
curl -X GET "https://api.investgo.com/api/facturas/activas/1" \
-H "Authorization: Bearer YOUR_TOKEN"
List All Active Invoices
GET /api/active/listaFactura
Retrieves all active invoices (excludes “No Activo” invoices).
curl -X GET "https://api.investgo.com/api/active/listaFactura" \
-H "Authorization: Bearer YOUR_TOKEN"
List All Invoices
Retrieves all invoices in the system.
curl -X GET "https://api.investgo.com/api/listaFacturas" \
-H "Authorization: Bearer YOUR_TOKEN"
List Invoices (Paginated)
GET /api/listaFacturas/page/{page}
Retrieves invoices with pagination (8 per page).
curl -X GET "https://api.investgo.com/api/listaFacturas/page/0" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"content": [
{
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00,
"fechaEmision": "2024-01-15",
"fechaPago": "2024-02-15",
"enable": "Activo"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 8
},
"totalPages": 5,
"totalElements": 37
}
Create Invoice
POST /api/registrarFactura
Creates a new invoice.
- Invoice code (codFactura) is auto-generated as “F-XXX” format
- fechaEmision is automatically set to current date
- Status (enable) is automatically set to “Activo”
- Company must exist
Request Body
Expected payment date (format: yyyy-MM-dd)
curl -X POST "https://api.investgo.com/api/registrarFactura" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"monto": 15000.00,
"fechaPago": "2024-02-15",
"descripcion": "Servicio de consultoría",
"empresa": {
"idEmpresa": 1
}
}'
{
"mensaje": "Factura registrada exitosamente",
"factura": {
"idFactura": 1,
"codFactura": "F-001",
"monto": 15000.00,
"fechaEmision": "2024-03-15",
"fechaPago": "2024-02-15",
"enable": "Activo",
"descripcion": "Servicio de consultoría",
"empresa": {
"idEmpresa": 1,
"nomEmpresa": "Tech Solutions SAC"
}
}
}
Update Invoice
PUT /api/actualizarFactura
Updates an existing invoice.
Can only update: monto, fechaPago, and descripcion. Cannot change invoice code, emission date, or company.
Request Body
Company ID (used to identify the invoice)
curl -X PUT "https://api.investgo.com/api/actualizarFactura" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"empresa": {
"idEmpresa": 1
},
"monto": 16000.00,
"fechaPago": "2024-03-15",
"descripcion": "Servicio de consultoría actualizado"
}'
{
"mensaje": "Factura actualizada exitosamente",
"factura": {
"idFactura": 1,
"monto": 16000.00,
"fechaPago": "2024-03-15",
"descripcion": "Servicio de consultoría actualizado"
}
}
Delete Invoice (Soft Delete)
DELETE /api/eliminarFactura/{id}
Soft deletes an invoice by setting status to “No Activo”.
This is a soft delete - the invoice is marked as inactive but not removed from the database.
curl -X DELETE "https://api.investgo.com/api/eliminarFactura/1" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"mensaje": "Se eliminó exitosamente la factura"
}