Cubospot i fiskalna kasa — priključak
Za proizvođače i servisere programa fiskalnih kasa. Verzija 1 · novembar 2026.
Kako radi
- 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. - Gost zatraži račun (ili konobar dodirne „Pošalji kasi“). Business na tu adresu pošalje
POSTsa računom u JSON‑u. - Vaš program izda fiskalni račun i odgovori brojem računa i, ako ga ima, linkom za proveru.
- 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
}
| Polje | Značenje |
|---|---|
cubospot | Verzija priključka. Sada 1. |
id | Oznaka računa. Iste porudžbine uvek daju isti id, sa bilo kog uređaja lokala. |
country | Država lokala kako je izabrana u Business‑u (RS, HR, BA-F…). Može biti prazno. |
place, table | Ime lokala i sto ili soba. |
guest | Samo kad je račun deo jednog gosta: njegovo ime. |
payment | Kako gost želi da plati: card, cash ili prazno ako nije rekao. |
lines | Stavke 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. |
total | Zbir. Nema ga kad neka stavka nema cenu. Sa porezima i taksama lokala (dole): zbir sa njima, onako kako ga je sabrao Cubospot server. |
lines[].tax | Samo 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. |
taxMode | Uz 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[].fee | Servisna 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. |
rounding | Samo kad lokal zaokružuje zbir: razlika zaokruživanja (npr. 0.02), već uračunata u total. |
orders | Cubospot porudžbine koje račun pokriva. |
buyer | Samo 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. |
at | Vreme 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.
number— broj fiskalnog računa, do 40 znakova.link— link za proveru računa koji je dala poreska uprava ili kasa. Mora da počinje sahttps://. Ako ga nema, izostavite ga.
Pravila
- Isti
id= isti račun. Ako zahtev sa istimidstigne ponovo, odgovorite računom koji ste već izdali. Ne izdajte drugi. - Link je samo link tog računa. Cubospot ga prikazuje gostu onakvog kakav je stigao. Link koji vodi na drugi račun je prekršaj.
- Vreme: Cubospot čeka odgovor do 25 sekundi.
- Provera veze: „Proveri vezu“ šalje
{ "cubospot": 1, "test": true }. Odgovorite{ "ok": true }i ne izdajte ništa. - Artikli: povežite Cubospot
itemilinamesa artiklom u svojoj kasi; poresku stopu uzimate iz kase. - Ispravke i storno rade se na kasi. Cubospot ih ne šalje.
- Dodatne porudžbine posle izdatog računa stižu kao nov račun, samo sa novim stavkama.
Cubospot and the fiscal cash register — the connector
For makers and service technicians of cash-register programs. Version 1 · November 2026.
How it works
- 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. - A guest asks for the bill (or the waiter taps “Send to the register”). Business sends a
POSTwith the bill as JSON to that address. - Your program issues the fiscal receipt and answers with its number and, if there is one, the verification link.
- 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.
| Field | Meaning |
|---|---|
cubospot | The version of the connector. Now 1. |
id | The id of the bill. The same orders always give the same id, from any device of the place. |
country | The place's country as chosen in Business (RS, HR, BA-F…). May be empty. |
place, table | The name of the place and the table or room. |
guest | Only when the bill is one guest's part: his name. |
payment | How the guest wants to pay: card, cash, or empty when he did not say. |
lines | The 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. |
total | The 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[].tax | Only 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. |
taxMode | With 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[].fee | The 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. |
rounding | Only when the place rounds the total: the difference of the rounding (e.g. 0.02), already in total. |
orders | The Cubospot orders the bill covers. |
buyer | Only 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. |
at | When 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.
number— the number of the fiscal receipt, up to 40 characters.link— the verification link of the receipt, as the tax administration or the register gave it. It must start withhttps://. Leave it out when there is none.
Rules
- The same
idis the same bill. When a request with the sameidarrives again, answer with the receipt you already issued. Do not issue another. - The link is the link of that receipt only. Cubospot shows it to the guest as it came. A link that leads to another receipt is an offence.
- Time: Cubospot waits up to 25 seconds for the answer.
- Checking the connection: “Check the connection” sends
{ "cubospot": 1, "test": true }. Answer{ "ok": true }and issue nothing. - Items: match Cubospot's
itemornameto the item in your register; the tax rate comes from the register. - Corrections and refunds are made on the register. Cubospot does not send them.
- Orders added after a receipt was issued arrive as a new bill, with the new lines only.