Search Products for Sale
Headers
Bearer token for authentication
Query Parameters
Search term to filter products
Maximum number of results to return
Include stock information in response
Response
Indicates if the search was successful
Array of products matching the search criteria
Example Request
Example Response
Error Codes
401- Unauthorized500- Internal server error
Get Vendors
Headers
Bearer token for authentication
Query Parameters
Include inactive vendors in the results
Response
Indicates if the request was successful
Array of vendor objects
Example Request
Example Response
Create Sale
Headers
Bearer token for authentication
Request Body
Customer name or ID
Vendor/seller ID
Array of products being sold
Product ID
Product name
Quantity being sold
Unit price
Total price for this product (quantity × price)
Subtotal before discounts and taxes
Discount amount applied
Tax (IVA) amount
Total sale amount
Payment method (e.g., “Efectivo”, “Tarjeta”, “Transferencia”)
Sale status
Response
Indicates if the sale was created
Created sale object with ID
Success or error message
Example Request
Example Response
Error Codes
400- Invalid input or insufficient stock401- Unauthorized500- Internal server error
Get Sales
Headers
Bearer token for authentication
Query Parameters
Page number for pagination
Number of sales per page
Filter sales from this date (ISO 8601 format)
Filter sales until this date (ISO 8601 format)
Filter by vendor ID
Filter by customer name
Filter by sale status
Field to sort by
Sort order: “asc” or “desc”
Response
Indicates if the request was successful
Array of sale objects
Pagination information
Example Request
Example Response
Get Sale by ID
Headers
Bearer token for authentication
Path Parameters
ID of the sale to retrieve
Response
Indicates if the sale was found
Sale object with complete details
Example Request
Example Response
Error Codes
401- Unauthorized404- Sale not found500- Internal server error
Update Sale Status
Headers
Bearer token for authentication
Path Parameters
ID of the sale to update
Request Body
New status (e.g., “completada”, “cancelada”, “pendiente”)
Response
Indicates if the update was successful
Updated sale object
Example Request
Example Response
Get Sales Report
Headers
Bearer token for authentication
Query Parameters
Report start date (ISO 8601 format)
Report end date (ISO 8601 format)
Filter by specific vendor
Response
Indicates if the report was generated
Summary report data
Total number of sales
Total revenue amount
Average order value
Example Request
Example Response
Error Codes
401- Unauthorized500- Internal server error