curl --request GET \
--url https://api.example.com/api/sales{
"success": true,
"data": [
{}
],
"total": 123,
"page": 123,
"totalPages": 123
}Get a paginated list of all sales (admin only) or user sales
curl --request GET \
--url https://api.example.com/api/sales{
"success": true,
"data": [
{}
],
"total": 123,
"page": 123,
"totalPages": 123
}/api/sales/my-sales endpoint.
GET /api/sales
Requires admin role.
GET /api/sales/my-sales
Returns sales for the authenticated user.
MERCADOPAGOEFECTIVOVIUMITRANSFERENCIABINANCEYYYY-MM-DD (admin endpoint only)PENDIENTE_PAGO, PENDIENTE_APROBACION, APROBADO, ENVIADO, ENTREGADO, RECHAZADO, CANCELADOENVIO or RETIROGET /api/sales?page=1&month=3&year=2026&paymentMethod=TRANSFERENCIA
GET /api/sales/my-sales
{
"success": true,
"data": [
{
"id": 789,
"fecha": "2026-03-05T10:30:00.000Z",
"montoTotal": 50000,
"estado": "APROBADO",
"medioPago": "TRANSFERENCIA",
"tipoEntrega": "ENVIO",
"costoEnvio": 5000,
"clienteId": 42,
"direccionEnvio": "Av. Corrientes 1234",
"ciudadEnvio": "Buenos Aires",
"provinciaEnvio": "Capital Federal",
"cpEnvio": "1414",
"codigoSeguimiento": "AR123456789",
"cliente": {
"id": 42,
"userId": 100,
"user": {
"email": "[email protected]",
"nombre": "Juan",
"apellido": "Pérez"
}
},
"lineasVenta": [
{
"id": 1,
"productoId": 123,
"cantidad": 2,
"subTotal": 30000,
"producto": {
"id": 123,
"nombre": "Procesador AMD Ryzen 5",
"precio": 15000,
"foto": "https://example.com/cpu.jpg"
}
},
{
"id": 2,
"productoId": 456,
"cantidad": 1,
"subTotal": 15000,
"producto": {
"id": 456,
"nombre": "Memoria RAM 8GB",
"precio": 15000,
"foto": "https://example.com/ram.jpg"
}
}
]
},
{
"id": 790,
"fecha": "2026-03-04T15:20:00.000Z",
"montoTotal": 25000,
"estado": "ENVIADO",
"medioPago": "MERCADOPAGO",
"tipoEntrega": "ENVIO",
"costoEnvio": 5000,
"clienteId": 42,
"codigoSeguimiento": "AR987654321",
"cliente": {
"id": 42,
"userId": 100
},
"lineasVenta": [
{
"id": 3,
"productoId": 789,
"cantidad": 1,
"subTotal": 20000,
"producto": {
"id": 789,
"nombre": "Mouse Gaming",
"precio": 20000
}
}
]
}
],
"total": 50,
"page": 1,
"totalPages": 3
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Admin access required"
}
/api/sales endpoint is restricted to admin users only/api/sales/my-sales endpoint returns all sales for the authenticated user without pagination