Skip to main content

Get Invoice by Code

GET /api/buscarfac/{codFactura}
Retrieves a single invoice by its code.
codFactura
string
required
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.
fechaInicio
date
required
Start date (format: yyyy-MM-dd)
fechaFin
date
required
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.
idEmpresa
integer
required
Company ID
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.
idEmpresa
integer
required
Company ID
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

GET /api/listaFacturas
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).
page
integer
required
Page number (0-indexed)
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

monto
double
required
Invoice amount
fechaPago
date
required
Expected payment date (format: yyyy-MM-dd)
descripcion
string
required
Invoice description
empresa
object
required
Company information
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

empresa
object
required
monto
double
Updated invoice amount
fechaPago
date
Updated payment date
descripcion
string
Updated description
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.
id
integer
required
Invoice ID to delete
curl -X DELETE "https://api.investgo.com/api/eliminarFactura/1" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "mensaje": "Se eliminó exitosamente la factura"
}

Build docs developers (and LLMs) love