List Sales
Sales
List Sales
Get a paginated list of all sales (admin only) or user sales
GET
List Sales
Authentication
This endpoint requires authentication with admin privileges to list all sales. Regular users can only access their own sales via the/api/sales/my-sales endpoint.
Endpoints
List All Sales (Admin)
GET /api/sales
Requires admin role.
List My Sales (User)
GET /api/sales/my-sales
Returns sales for the authenticated user.
Query Parameters
number
default:"1"
Page number for pagination (admin endpoint only)
number
Filter by month (1-12, admin endpoint only)
number
Filter by year (admin endpoint only)
string
Filter by payment method (admin endpoint only). One of:
MERCADOPAGOEFECTIVOVIUMITRANSFERENCIABINANCE
string
Filter by specific date in format
YYYY-MM-DD (admin endpoint only)Response
All Sales Response (Admin)
boolean
Indicates if the request was successful
array
Array of sale objects
number
Sale ID
string
Sale date (ISO 8601 timestamp)
number
Total amount including shipping
string
Sale status:
PENDIENTE_PAGO, PENDIENTE_APROBACION, APROBADO, ENVIADO, ENTREGADO, RECHAZADO, CANCELADOstring
Payment method used
string
Delivery type:
ENVIO or RETIROnumber
Shipping cost
number
Customer ID
object
Customer information
array
Array of line items with product details
number
Total number of sales matching the filters
number
Current page number
number
Total number of pages
My Sales Response (User)
boolean
Indicates if the request was successful
array
Array of user’s sale objects (same structure as above)
Example Request (Admin)
Example Request (User)
Example Response
Error Responses
Unauthorized (401)
Forbidden - Not Admin (403)
Notes
- The
/api/salesendpoint is restricted to admin users only - Results are paginated with 20 items per page
- The
/api/sales/my-salesendpoint returns all sales for the authenticated user without pagination - Sales include full details of line items and associated products
- Filters can be combined to narrow down results