ApiResponse<T>. See the API Overview for the envelope schema.
GET /api/ordenes-compra/list
Returns all purchase orders with their product details.Example request
Example response
GET /api/ordenes-compra/{id}
Returns a single purchase order by its ID.Path parameters
Numeric ID of the purchase order (
idOrden).Example request
Example response
GET /api/ordenes-compra/{id}/vigente
Checks whether a purchase order is still within its validity window. Returns a plain string message inside theApiResponse<T> data field.
Validity is determined by fechaEmision + vigenciaDias. If today is before that expiry date the order is considered active.
Path parameters
Numeric ID of the purchase order (
idOrden).Example request
Example response (order is active)
Example response (order is expired)
POST /api/ordenes-compra
Creates a new purchase order.Request body
Issue date of the order in
yyyy-MM-dd format.Number of days the order remains valid after
fechaEmision.Total quantity requested across all line items.
Ignored on creation. The server always sets the initial status to
VIGENTE regardless of this field.Division. Must be one of:
PERECEDEROS, NO_PERECEDEROS.Department. Must be one of:
FRUTAS, VERDURAS, LACTEOS, CARNES, EMBUTIDOS, MULTIPLE, FARMACIA.Line items for this order.
Example request
Example response
PUT /api/ordenes-compra/{id}/estado
Updates the status of an existing purchase order.Path parameters
Numeric ID of the purchase order (
idOrden).Request body
New status value. Case-insensitive; converted to uppercase before matching. Must be one of:
VIGENTE, EXPIRADA, CERRADA.Example request
Example response
OrdenCompra object schema
Auto-generated primary key.
Issue date in
yyyy-MM-dd format.Number of days the order is valid after
fechaEmision.Total quantity requested.
Order status enum:
VIGENTE, EXPIRADA, or CERRADA.Division enum:
PERECEDEROS or NO_PERECEDEROS.Department enum:
FRUTAS, VERDURAS, LACTEOS, CARNES, EMBUTIDOS, MULTIPLE, or FARMACIA.Line items for this order.