Skip to main content
POST
/
api
/
Venta
/
Registrar
Register Sale
curl --request POST \
  --url https://api.example.com/api/Venta/Registrar \
  --header 'Content-Type: application/json' \
  --data '
{
  "NumeroDocumento": "<string>",
  "TipoPago": "<string>",
  "TotalTexto": "<string>",
  "DetalleVenta": [
    {
      "IdProducto": 123,
      "DescripcionProducto": "<string>",
      "Cantidad": 123,
      "PrecioTexto": "<string>",
      "TotalTexto": "<string>"
    }
  ]
}
'
{
  "status": true,
  "value": {
    "IdVenta": 123,
    "NumeroDocumento": "<string>",
    "TipoPago": "<string>",
    "TotalTexto": "<string>",
    "FechaRegistro": "<string>",
    "DetalleVenta": [
      {}
    ]
  },
  "msg": "<string>"
}

Request Body

The request accepts a sale object containing the sale header information and an array of detail items.
NumeroDocumento
string
required
Document number for the sale (invoice or receipt number)
TipoPago
string
required
Payment type (e.g., “Efectivo”, “Tarjeta”, “Transferencia”)
TotalTexto
string
required
Total amount as text (formatted string)
DetalleVenta
array
required
Array of sale detail items

Response

status
boolean
Indicates whether the operation was successful
value
object
The registered sale object
msg
string
Error message if status is false

Example Request

curl -X POST http://localhost:5000/api/Venta/Registrar \
  -H "Content-Type: application/json" \
  -d '{
    "NumeroDocumento": "0001-00000123",
    "TipoPago": "Efectivo",
    "TotalTexto": "150.00",
    "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"
      }
    ]
  }'

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"
      }
    ]
  },
  "msg": null
}
Error Response
{
  "status": false,
  "value": null,
  "msg": "No se pudo registrar la venta"
}

Build docs developers (and LLMs) love