Skip to main content
GET
/
api
/
Venta
/
Historial
Sales History
curl --request GET \
  --url https://api.example.com/api/Venta/Historial
{
  "status": true,
  "value": [
    {
      "IdVenta": 123,
      "NumeroDocumento": "<string>",
      "TipoPago": "<string>",
      "TotalTexto": "<string>",
      "FechaRegistro": "<string>",
      "DetalleVenta": [
        {
          "IdProducto": 123,
          "DescripcionProducto": "<string>",
          "Cantidad": 123,
          "PrecioTexto": "<string>",
          "TotalTexto": "<string>"
        }
      ]
    }
  ],
  "msg": "<string>"
}

Query Parameters

buscarPor
string
required
Search criteria type. Possible values:
  • "numero" - Search by sale number
  • "fecha" - Search by date range
numeroVenta
string
Sale document number to search for. Required when buscarPor is "numero".Example: "0001-00000123"
fechaInicio
string
Start date for date range search. Required when buscarPor is "fecha".Format: dd/MM/yyyy (e.g., "01/03/2026")
fechaFin
string
End date for date range search. Required when buscarPor is "fecha".Format: dd/MM/yyyy (e.g., "05/03/2026")

Response

status
boolean
Indicates whether the operation was successful
value
array
Array of sale objects matching the search criteria
msg
string
Error message if status is false

Example Requests

curl "http://localhost:5000/api/Venta/Historial?buscarPor=numero&numeroVenta=0001-00000123"

Example Response

Success Response
{
  "status": true,
  "value": [
    {
      "IdVenta": 42,
      "NumeroDocumento": "0001-00000123",
      "TipoPago": "Efectivo",
      "TotalTexto": "150.00",
      "FechaRegistro": "05/03/2026 10:30:45 AM",
      "DetalleVenta": [
        {
          "IdProducto": 5,
          "DescripcionProducto": "Laptop HP 15",
          "Cantidad": 1,
          "PrecioTexto": "120.00",
          "TotalTexto": "120.00"
        },
        {
          "IdProducto": 8,
          "DescripcionProducto": "Mouse Inalámbrico",
          "Cantidad": 2,
          "PrecioTexto": "15.00",
          "TotalTexto": "30.00"
        }
      ]
    },
    {
      "IdVenta": 45,
      "NumeroDocumento": "0001-00000126",
      "TipoPago": "Tarjeta",
      "TotalTexto": "89.50",
      "FechaRegistro": "05/03/2026 02:15:30 PM",
      "DetalleVenta": [
        {
          "IdProducto": 12,
          "DescripcionProducto": "Teclado Mecánico",
          "Cantidad": 1,
          "PrecioTexto": "89.50",
          "TotalTexto": "89.50"
        }
      ]
    }
  ],
  "msg": null
}
Empty Result
{
  "status": true,
  "value": [],
  "msg": null
}
Error Response
{
  "status": false,
  "value": null,
  "msg": "Error al obtener el historial de ventas"
}

Build docs developers (and LLMs) love