Skip to main content
GET
/
api
/
Producto
/
Lista
List Products
curl --request GET \
  --url https://api.example.com/api/Producto/Lista
{
  "status": true,
  "value": [
    {
      "idProducto": 123,
      "nombre": "<string>",
      "idCategoria": 123,
      "descripcionCategoria": "<string>",
      "stock": 123,
      "precio": "<string>",
      "esActivo": 123
    }
  ],
  "msg": "<string>"
}

Endpoint

GET /api/Producto/Lista
Retrieves all products with their associated category information, stock levels, and pricing.

Response

The response is wrapped in a Response<T> object that includes status information.
status
boolean
required
Indicates whether the request was successful
value
array
required
Array of product objects
msg
string
Error message (only populated when status is false)

Example Request

curl -X GET "http://localhost:5000/api/Producto/Lista" \
  -H "Content-Type: application/json"

Example Response

{
  "status": true,
  "value": [
    {
      "idProducto": 1,
      "nombre": "Laptop HP Pavilion",
      "idCategoria": 1,
      "descripcionCategoria": "Electrónica",
      "stock": 15,
      "precio": "899.99",
      "esActivo": 1
    },
    {
      "idProducto": 2,
      "nombre": "Mouse Logitech MX Master",
      "idCategoria": 2,
      "descripcionCategoria": "Accesorios",
      "stock": 50,
      "precio": "99.99",
      "esActivo": 1
    },
    {
      "idProducto": 3,
      "nombre": "Teclado Mecánico Corsair",
      "idCategoria": 2,
      "descripcionCategoria": "Accesorios",
      "stock": 0,
      "precio": "149.99",
      "esActivo": 0
    }
  ],
  "msg": null
}

Response Status

This endpoint always returns HTTP 200. Check the status field in the response body to determine success or failure.
  • status: true - Products retrieved successfully
  • status: false - An error occurred (check msg field for details)

Build docs developers (and LLMs) love