monto_pagado reaches monto_total (within a 0.01 tolerance), the transaction automatically transitions to cerrado — provided the kitchen status is also terminado.
Payments are also recorded in the associated
caja_turno record automatically, incrementing either ventas_efectivo or ventas_qr.POST /api/transacciones/:id/pagos
Registers a payment for the transaction.
Authentication: Required
Required role: Any authenticated user
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
| Content-Type | application/json | Yes |
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | The transaction ID |
Body
Payment method. Must be
efectivo or qr.Amount to apply to this payment. Must be ≥ 0.01 and cannot exceed the current
monto_pendiente.Cash received from the customer. Required when
metodo_pago is efectivo. Must be ≥ monto.QR transaction reference code. Recommended when
metodo_pago is qr.Response
Success (201)
Auto-generated payment ID.
Parent transaction ID.
Payment method used (
efectivo or qr).Payment amount as a decimal string.
Cash received, for
efectivo payments.QR reference code, for
qr payments.Change to return to the customer (
monto_recibido - monto). Always "0.00" for QR payments.ID of the user who registered the payment.
Payment timestamp.
Error responses
| Status | Description |
|---|---|
| 400 | Transaction already fully paid |
| 400 | monto exceeds monto_pendiente |
| 400 | monto_recibido missing or less than monto when using efectivo |
| 401 | Unauthorized |
| 404 | Transaction not found |
GET /api/transacciones/:id/pagos
Returns all active payments for the specified transaction.
Authentication: Required
Required role: Any authenticated user
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | The transaction ID |
Response
Success (200)
An array of payment objects (same shape as thePOST response minus cambio).