The Purchases module lets you record the intake of goods from suppliers. When a purchase is created, the backend automatically increments 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.
stock_actual of every product listed in the detalles array, keeping your inventory counts accurate without a separate update call. All routes require a valid Bearer Token JWT in the Authorization header.
Interface Reference
POST /compras
Records a new purchase order, increments stock for each product indetalles, and optionally registers an automatic cash outflow (EGRESO) in the specified SesionCaja.
Authentication: Required — Authorization: Bearer <access_token>
Request Body
Name of the supplier or vendor. Optional — pass
null or omit for anonymous purchases.Set to
true if the purchase total should be paid from the POS cash register, which creates an automatic EGRESO movement in the specified caja session.ID of the open cash register session to deduct from. Required when
pagar_con_caja is true. Ignored when pagar_con_caja is false.Array of line items for this purchase. Must contain at least one entry.
ID of the authenticated user creating the purchase record. Used for audit tracking.
Response Fields
Auto-generated unique identifier for the purchase.
Sum of all
(cantidad * costo_unitario) subtotals, calculated by the backend.Supplier name or
null.Whether the purchase triggered a cash outflow.
The cash session used for payment, or
null.ISO 8601 timestamp of when the purchase was recorded.
The saved purchase line items, each with a computed
subtotal.Active flag, defaults to
true.ISO 8601 creation timestamp.
GET /compras
Returns the full purchase history. EachCompra record includes its detalles array, and each detail includes the nested producto object so you can display product names and details without additional requests.
Authentication: Required — Authorization: Bearer <access_token>
Response Fields
Unique identifier of the purchase record.
Total cost of the purchase (sum of all line-item subtotals).
Supplier name, or
null if not recorded.Whether a cash outflow was created for this purchase.
The cash session that was charged, or
null.ISO 8601 timestamp of the purchase.
Line items for the purchase.
Active flag for the purchase record.
ISO 8601 creation timestamp.