List All Orders
Retrieve all orders in the system.Response
Returns an array of order objects. See Create Order for the full order object schema.Get Order by ID
Retrieve a specific order by its ID.Path Parameters
The unique identifier of the order
Response
Returns a single order object or 404 if not found.Update Order
Update an existing order, including its state and details.Path Parameters
The unique identifier of the order to update
Request Body
Provide the complete order object with updated fields. See Create Order for the full schema.Update the order state (e.g., “PROCESANDO”, “COMPLETADO”, “CANCELADO”)
Update the expected delivery date
Update order items (replaces all existing detail items)
Response
Returns the updated order object.Delete Order
Delete an order and all associated detail items.Path Parameters
The unique identifier of the order to delete
Response
Returns 204 No Content on successful deletion.Order State Management
Orders follow a state-based workflow. Common state transitions include:Common States
Initial state when order is created. Order is awaiting processing.
Order is being prepared or fulfilled.
Order has been completed and delivered.
Order has been cancelled.
State Transition Example
Updating Order State
To change an order’s state, use the PUT endpoint with the new estado value:When updating an order, you must provide the complete order object including all required fields and the full detalle array.
Best Practices
Managing Order Lifecycle
- Create: Orders are created with “PENDIENTE” state
- Process: Update to “PROCESANDO” when fulfillment begins
- Complete: Update to “COMPLETADO” when delivered
- Track: Use fechaEntrega to manage delivery expectations
- Modify: Update order details and quantities as needed before processing
Handling Cancellations
To cancel an order:- Update the estado to “CANCELADO”
- Optionally add cancellation reason in descripcion
- Ensure inventory adjustments are handled separately
Delivery Date Management
- Default delivery is 1 week after order date
- Update fechaEntrega based on inventory availability
- Consider estado when calculating realistic delivery dates