Developer API

TPVStream API: sales, closures and statistics

Read tickets, Z closures and sales totals. Read only.

On this page

Sales are read with the sales:read right. The API cannot create, change or void a ticket: sales and corrective invoices are always made on the POS.

Common rules are in API rules.

Tickets

Method Route
GET /tickets (?from&to&status&series)
GET /tickets/{id}

The list returns tickets without lines or payments. GET /tickets/{id} adds items and payments:

{
  "id": 1042,
  "uuid": "5b7e…",
  "number": "T2026-001042",
  "series": "T",
  "invoiceType": null,
  "status": "closed",
  "subtotalCents": 2450,
  "taxCents": 223,
  "discountCents": 0,
  "tipCents": 0,
  "totalCents": 2450,
  "rectifiedNumber": null,
  "clientId": null,
  "customerName": null,
  "closureId": 87,
  "createdAt": "2026-11-27T12:31:05.000Z",
  "closedAt": "2026-11-27T12:33:40.000Z",
  "fiscal": { "verifactuStatus": "submitted", "ticketbaiStatus": null, "qr": "https://…" },
  "items": [
    { "productId": "8f1c…", "name": "Menú del día", "quantity": 2, "unitPriceCents": 1225, "taxRate": 10, "discountCents": 0, "totalCents": 2450, "notes": null }
  ],
  "payments": [
    { "method": "card", "status": "completed", "amountCents": 2450, "tipCents": 0, "createdAt": "2026-11-27T12:33:40.000Z" }
  ]
}
  • status: open, paying, closed (paid), invoiced, refunded (corrected) or cancelled (voided before payment).
  • Payment methods (method): cash, card, bizum, transfer, voucher or other.
  • Amounts include VAT; taxCents is the tax part.
  • A corrective invoice has negative amounts and the number of the ticket it corrects in rectifiedNumber.
  • fiscal: status of the VeriFactu or TicketBAI submission and the QR content.
  • customerName only shows if the key has clients:read; otherwise only clientId.

Z closures

Method Route
GET /closures (?from&to)
GET /closures/{id}

Each closure gives openedAt, closedAt, salesCount, totalSalesCents and the split by payment method (totalCashCents, totalCardCents, totalBizumCents, totalTransferCents), tips (totalTipsCents), the opening float (openingCashCents) and the difference (differenceCents).

Statistics

GET /stats/summary?from=2026-11-01&to=2026-11-30&groupBy=day

groupBy: day, product, category or payment. The answer gives ticketCount, totalCents, taxCents and one line per group in groups.

It counts closed, invoiced and corrected tickets (corrective invoices subtract). Days are UTC days.

For an ERP or accounting, read new tickets with the ticket.created webhook instead of asking every minute. See Webhooks.

WhatsApp