The Ventas API is a Spring Boot REST service that manages sales records for the Innovatech Chile pet store. It exposes five CRUD endpoints under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DevOpsDuoc/Evaluacion02_Devop_Innovatech/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1/ventas path and requires no authentication.
Base URL
| Environment | Base URL |
|---|---|
| Local | http://localhost:3001/api/v1/ventas |
| AWS | http://{ec2-app-ip}:3001/api/v1/ventas |
Request format
All requests and responses use JSON. Set theContent-Type header to application/json for requests that include a body.
@CrossOrigin(origins = "*")), so the API is accessible from any client without preflight restrictions.
Data model
Each sale (Venta) contains the following fields.
Auto-generated unique identifier for the sale. Assigned by the database on creation.
Purchase and delivery address. Cannot be blank.
Purchase value (amount) in the store’s currency.
Purchase date in ISO-8601 format (
YYYY-MM-DD). Cannot be null.Indicates whether a dispatch record has been generated for this sale. Defaults to
false.Available endpoints
See the endpoints page for full request/response details.| Method | Path | Description |
|---|---|---|
POST | /api/v1/ventas | Create a new sale |
GET | /api/v1/ventas | List all sales |
GET | /api/v1/ventas/{idVenta} | Get a sale by ID |
PUT | /api/v1/ventas/{idVenta} | Update an existing sale |
DELETE | /api/v1/ventas/{idVenta} | Delete a sale |
Error handling
HTTP status enum value (e.g.
NOT_FOUND, BAD_REQUEST).Human-readable error message.
| Condition | Status code | Description |
|---|---|---|
| Sale not found | 404 Not Found | Thrown by VentaNotFoundException when the requested idVenta does not exist. |
| Validation failure | 400 Bad Request | Returned when required fields are missing or blank (e.g., direccionCompra, fechaCompra, despachoGenerado). |
Example 404 response
Example 400 response