SS Restaurant’s billing system is built around three linked records: a pago (payment), an optional ticket (receipt), and an optional factura (tax invoice). A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FloresJesus/SS_RESTAURANT/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/payments call can create all three atomically. The payment logic tracks partial payments — estado_pago on the order only becomes 'pagado' when the cumulative amount received equals or exceeds the order total. Only admin and cajero roles can access all payment, ticket, and invoice endpoints.
Payment methods
The following four values are accepted for themetodo field:
efectivo
Cash payment at the table or cashier.
tarjeta
Debit or credit card via POS terminal.
qr
QR code scan (Bolivian payment apps).
transferencia
Bank transfer with a reference number.
Processing a payment
| Field | Required | Description |
|---|---|---|
pedido_id | ✅ | ID of the order being paid |
monto | ✅ | Amount received in Bolivianos |
metodo | ✅ | One of efectivo, tarjeta, qr, transferencia |
referencia | Optional | Transaction reference (slip number, transfer code, etc.) |
generar_ticket | Optional | true to automatically create a ticket; only fires when estado_pago becomes 'pagado' |
generar_factura | Optional | true to automatically create a factura; requires nit_ci and razon_social |
nit_ci | Optional | Tax ID for invoice (required when generar_factura: true) |
razon_social | Optional | Business name for invoice (required when generar_factura: true) |
generar_factura: true is included alongside valid nit_ci and razon_social:
Payment status logic
The order’sestado_pago is determined by comparing the running sum of all payments for that order against the order total (sum of detalle_pedido.subtotal):
POST /api/payments call re-evaluates the total and updates pedido.estado_pago accordingly.
The server logs a warning (but does not reject) if
monto is less than half the order total. This allows tip-splitting or advance deposits.Tickets
Tickets are numbered receipts generated per order. Each order can have at most one ticket; attempting to generate a second ticket for the same order returns400.
Ticket number format: YYYYMMDD-NNNN
YYYYMMDD— the calendar date the ticket was created.NNNN— a zero-padded daily counter reset each calendar day (0001, 0002, …).
20250720-0003 is the third ticket issued on 20 July 2025.
| Method | Path | Description |
|---|---|---|
GET | /api/tickets | List all tickets (filter by ?fecha=YYYY-MM-DD) |
GET | /api/tickets/hoy | List all tickets created today |
GET | /api/tickets/:id | Get ticket with full order details |
GET | /api/tickets/pedido/:pedido_id | Get the ticket for a specific order |
GET | /api/tickets/numero/:numero | Look up a ticket by its printed number |
POST | /api/tickets | Manually generate a ticket ({ "pedido_id": 84 }) |
Invoices (Facturas)
Facturas are tax invoices with a NIT/CI identifier. Each order can have at most one factura. Invoice number format:YYYY-NNNNNN
YYYY— the year the invoice was created.NNNNNN— a zero-padded sequential counter per year (000001, 000002, …).
2025-000009 is the ninth invoice issued in 2025.
| Field | Description |
|---|---|
numero_factura | Formatted invoice number |
nit_ci | Tax identification number of the recipient |
razon_social | Legal name of the company or person |
subtotal | Sum of order line items |
impuesto | Tax amount (currently stored as 0) |
total | Total charged (subtotal + impuesto) |
| Method | Path | Description |
|---|---|---|
GET | /api/invoices | List all invoices (filter by ?fecha=YYYY-MM-DD) |
GET | /api/invoices/hoy | List today’s invoices |
GET | /api/invoices/resumen | Summary of today’s invoices |
GET | /api/invoices/:id | Get an invoice with full order details |
GET | /api/invoices/pedido/:pedido_id | Get the invoice for a specific order |
GET | /api/invoices/numero/:numero | Look up an invoice by its number |
POST | /api/invoices | Manually generate a factura |