Cubospot i fiskalna kasa — priključak

Za proizvođače i servisere programa fiskalnih kasa. Verzija 1 · novembar 2026.

Cubospot nikad ne izdaje fiskalni račun. Kad gost u aplikaciji zatraži račun, Cubospot Business pošalje račun vašem programu kase. Fiskalni račun izdaje i štampa vaša kasa, po propisima svoje države. Porezi, numeracija, način plaćanja i veza sa poreskom upravom ostaju posao kase.

Kako radi

  1. Lokal u Cubospot Business‑u (⚙ → Fiskalna kasa) štiklira „Poveži Cubospot sa fiskalnom kasom“ i upiše adresu na kojoj vaš program prima račun, npr. http://192.168.1.50:8080/cubospot. Adresa je u mreži lokala; internet nije potreban.
  2. Gost zatraži račun (ili konobar dodirne „Pošalji kasi“). Business na tu adresu pošalje POST sa računom u JSON‑u.
  3. Vaš program izda fiskalni račun i odgovori brojem računa i, ako ga ima, linkom za proveru.
  4. Broj i link stižu gostu na telefon, kao kopija uz papirni račun iz kase.

Zahtev

POST na adresu kase · Content-Type: application/json · ako je lokal upisao lozinku: Authorization: Bearer <lozinka>.

{
  "cubospot": 1,
  "id": "b40d56c396f35c20b0d32ab1",
  "country": "RS",
  "place": "Kafana Lipa",
  "table": "Sto 5",
  "guest": "Marko",
  "payment": "card",
  "currency": "RSD",
  "lines": [
    { "item": "a1b2c3d4e5f6", "name": "Espresso", "qty": 3, "price": 180, "total": 540 },
    { "item": "0f9e8d7c6b5a", "name": "Ćevapi", "qty": 1, "price": 890, "total": 890 }
  ],
  "total": 1430,
  "orders": ["0000000000000001", "0000000000000002"],
  "buyer": { "company": "Lipa Trade d.o.o.", "taxId": "123456789", "address": "Glavna 1, Beograd", "email": "office@lipa.example" },
  "at": 1794676907
}
PoljeZnačenje
cubospotVerzija priključka. Sada 1.
idOznaka računa. Iste porudžbine uvek daju isti id, sa bilo kog uređaja lokala.
countryDržava lokala kako je izabrana u Business‑u (RS, HR, BA-F…). Može biti prazno.
place, tableIme lokala i sto ili soba.
guestSamo kad je račun deo jednog gosta: njegovo ime.
paymentKako gost želi da plati: card, cash ili prazno ako nije rekao.
linesStavke sabrane po artiklu. item je Cubospot oznaka artikla, price cena po komadu kako stoji u meniju (sa porezom), total = cena × količina. price je null kad artikal u meniju nema cenu. Gratis stavka sa kartice sa pečatima ima "free": true, price i total 0 i listPrice (redovna cena): kasa je knjiži kao popust 100 % ili kao stavku po ceni 0, kako propisi njene države traže.
totalZbir. Nema ga kad neka stavka nema cenu. Sa porezima i taksama lokala (dole): zbir sa njima, onako kako ga je sabrao Cubospot server.
lines[].taxSamo kad je lokal upisao poreske stope (⚙ → Porezi i takse): {"name": "PDV 20%", "pct": 20} — stopa koju je lokal dodelio tom artiklu. Kasa ostaje izvor istine za fiskalni porez: ako njena stopa za artikal nije ista, važi kasina.
taxModeUz stope: included — cene u lines sadrže porez (Evropa, Balkan); added — porez se dodaje na račun (SAD), tada je u taxes porez po stopi (name, pct, base, tax).
lines[].feeServisna taksa ("service") ili druga taksa lokala ("fee", npr. muzički dinar, couvert, boravišna taksa) kao posebna stavka: name, qty, price, total, bez item. Kako je kasa knjiži (artikal, usluga, poreska stopa takse) određuju propisi njene države.
roundingSamo kad lokal zaokružuje zbir: razlika zaokruživanja (npr. 0.02), već uračunata u total.
ordersCubospot porudžbine koje račun pokriva.
buyerSamo kad je gost zatražio fakturu (račun na firmu) i lokal je u Business‑u štiklirao „Pošalji kasi podatke firme za fakturu“: company (naziv firme), a ako ih je gost upisao i taxId (poreski broj, npr. PIB), address, email. Podatke je ukucao gost — Cubospot ih ne proverava. Vaš program odlučuje kako kupac ide na račun po propisima države; ako ne ume da izda račun na kupca, neka buyer zanemari — konobar zahtev za fakturu vidi i u Business‑u. Uz račun dela jednog gosta ide samo ako je baš taj gost tražio fakturu.
atVreme slanja, Unix sekunde.

Odgovor

HTTP 200 i JSON. Kad je račun izdat:

{ "ok": true, "number": "AB12CD34-AB12CD34-123", "link": "https://suf.purs.gov.rs/v/?vl=..." }

Kad nije: { "ok": false, "error": "razlog" }. Svaki drugi odgovor Cubospot čita kao „kasa se nije javila“ i to kaže konobaru.

Pravila


Cubospot and the fiscal cash register — the connector

For makers and service technicians of cash-register programs. Version 1 · November 2026.

Cubospot never issues a fiscal receipt. When a guest asks for the bill in the app, Cubospot Business sends the bill to your cash-register program. Your register issues and prints the fiscal receipt, by the rules of its country. Taxes, numbering, the payment method and the link with the tax administration stay the register's job.

How it works

  1. In Cubospot Business (⚙ → Fiscal cash register) the place ticks “Connect Cubospot to the fiscal cash register” and enters the address where your program takes a bill, for example http://192.168.1.50:8080/cubospot. The address is in the place's network; no internet is needed.
  2. A guest asks for the bill (or the waiter taps “Send to the register”). Business sends a POST with the bill as JSON to that address.
  3. Your program issues the fiscal receipt and answers with its number and, if there is one, the verification link.
  4. The number and the link reach the guest's phone, as a copy next to the paper receipt from the register.

Request

POST to the register's address · Content-Type: application/json · when the place entered a password: Authorization: Bearer <password>. The body is the JSON shown above.

FieldMeaning
cubospotThe version of the connector. Now 1.
idThe id of the bill. The same orders always give the same id, from any device of the place.
countryThe place's country as chosen in Business (RS, HR, BA-F…). May be empty.
place, tableThe name of the place and the table or room.
guestOnly when the bill is one guest's part: his name.
paymentHow the guest wants to pay: card, cash, or empty when he did not say.
linesThe items, added up by item. item is Cubospot's id of the item, price the unit price as the menu shows it (tax included), total = price × quantity. price is null when the menu has no price for it. A free item of the stamp card has "free": true, price and total 0 and listPrice (its usual price): the register books it as a 100 % discount or as an item at 0, as the rules of its country require.
totalThe sum. Absent when a line has no price. With the place's taxes and fees (below): the sum with them, as the Cubospot server added it up.
lines[].taxOnly when the place wrote tax rates (⚙ → Taxes and fees): {"name": "VAT 20%", "pct": 20} — the rate the place gave that item. The register stays the source of truth for the fiscal tax: when its rate for the item differs, the register's counts.
taxModeWith the rates: included — the prices in lines include the tax (Europe, the Balkans); added — the tax is added to the bill (the USA), then taxes has the tax by rate (name, pct, base, tax).
lines[].feeThe service charge ("service") or another fee of the place ("fee", e.g. a music fee, a couvert, a city tax) as a line of its own: name, qty, price, total, no item. How the register books it (item, service, the tax rate of the fee) is up to the rules of its country.
roundingOnly when the place rounds the total: the difference of the rounding (e.g. 0.02), already in total.
ordersThe Cubospot orders the bill covers.
buyerOnly when the guest asked for an invoice to a company and the place ticked “Send the company details for an invoice to the register” in Business: company (the company's name) and, if the guest typed them, taxId, address, email. The guest typed these — Cubospot does not check them. Your program decides how the buyer goes on the receipt under the country's rules; if it cannot issue a receipt to a buyer, let it ignore buyer — the waiter sees the invoice request in Business as well. With the bill of one guest's part it comes only when that very guest asked for the invoice.
atWhen it was sent, Unix seconds.

Answer

HTTP 200 and JSON. When the receipt is issued:

{ "ok": true, "number": "AB12CD34-AB12CD34-123", "link": "https://suf.purs.gov.rs/v/?vl=..." }

When it is not: { "ok": false, "error": "why" }. Any other answer Cubospot reads as “the register did not answer” and says so to the waiter.

Rules