The Sales module is the primary transactional engine of Kantuta POS. When a sale is created, the backend automatically calculates line-item subtotals, sums theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_front/llms.txt
Use this file to discover all available pages before exploring further.
total, and decrements stock_actual for every product in the detalles array — all in a single atomic operation. Sales can be in one of three states: COMPLETADA, ANULADA, or EDITADA, which you can update via the PATCH endpoint. All routes require a valid Bearer Token JWT in the Authorization header.
Interface Reference
POST /ventas
Creates a new sale, computes subtotals and the grand total, and decrementsstock_actual for each product listed in detalles. Returns the complete Venta object with its computed total and saved line items.
Authentication: Required — Authorization: Bearer <access_token>
Request Body
Payment method for this sale. One of:
"EFECTIVO", "QR", "TRANSFERENCIA".ID of the active cash register session where this payment is received. The session must be in
ABIERTA state.Array of line items for the sale. Must contain at least one entry.
ID of the authenticated user (cashier) creating this sale. Used for audit tracking.
Response Fields
Auto-generated unique identifier for the sale.
Grand total calculated by the backend as the sum of all
(cantidad * precio_unitario) subtotals.Payment method used. One of:
EFECTIVO, QR, TRANSFERENCIA.ISO 8601 timestamp of when the sale was recorded.
Cash session that received the payment.
Initial state of the sale. Defaults to
"COMPLETADA" upon creation.Reason for any modification.
null on initial creation.ISO 8601 timestamp of the last status change.
Saved line items, each with a computed
subtotal.Active flag, defaults to
true.ISO 8601 creation timestamp.
GET /ventas
Returns the full sales history. EveryVenta record includes the detalles array with line-item details.
Authentication: Required — Authorization: Bearer <access_token>
Response Fields
Unique identifier of the sale.
Grand total of the sale.
Payment method:
EFECTIVO, QR, or TRANSFERENCIA.ISO 8601 date the sale was made.
Cash session associated with this sale.
Current state:
COMPLETADA, ANULADA, or EDITADA.Reason provided when the sale was edited or cancelled.
Line items included in this sale.
GET /ventas/:id
Fetches a single sale by its numeric ID, including the fulldetalles array.
Authentication: Required — Authorization: Bearer <access_token>
Path Parameters
The unique identifier of the sale to retrieve.
Response Fields
Unique identifier of the sale.
Grand total of the sale.
Payment method used.
ISO 8601 timestamp of the sale.
Current state:
COMPLETADA, ANULADA, or EDITADA.Edit or cancellation reason, or
null.ISO 8601 timestamp of the most recent state change.
Line items for this sale, each with
cantidad, precio_unitario, subtotal, and an optional nested producto object.PATCH /ventas/:id
Updates or cancels an existing sale. Use this endpoint to change the payment method, mark a sale asANULADA or EDITADA, or record an edit reason. All fields are optional.
Authentication: Required — Authorization: Bearer <access_token>
Path Parameters
The unique identifier of the sale to update.
Request Body
Updated payment method. One of:
"EFECTIVO", "QR", "TRANSFERENCIA".Updated cash session reference.
New state for the sale. One of:
"COMPLETADA", "ANULADA", "EDITADA". Use "ANULADA" to cancel a sale.A free-text explanation for the change. Required by convention when setting
estado_venta to "ANULADA" or "EDITADA".ID of the authenticated user performing this update. Used for audit tracking.
Response Fields
Unique identifier of the updated sale.
Grand total of the sale (unchanged by a status update).
Current payment method after the update.
Updated state:
COMPLETADA, ANULADA, or EDITADA.The recorded reason for this modification.
ISO 8601 timestamp updated to reflect the time of this change.
ID of the user who performed this update.
Unchanged line items of the sale.