Skip to content

Developer notes

Technical reference for developers who customize Croatia Fiscal Receipts for CS-Cart and Multi-Vendor, and the sources every rule in it comes from.

Item Value
Add-on id kv_croatia_fiscalization
Function prefix fn_kv_croatia_fiscalization_
Language variables kv_croatia_fiscalization.*
CSS scope .kv-croatia-fiscalization
PHP namespace Tygh\Addons\KvCroatiaFiscalization

In 1.0 (consumer receipts, “fiskalizacija racuna u krajnjoj potrosnji”)

  • Receipt data from CS-Cart orders (VAT groups per rate, total in euros, payment code G / K / T / O, optional buyer OIB), sent to the fiscalization system (CIS) as a signed RacunZahtjev, answered with the JIR.
  • ZKI (protective code), gap-free receipt numbers per business premises (P) or per device (N), QR code with the verification link, receipt view, JIR / ZKI / QR on the order page and on the customer’s order page.
  • Storno receipts (negative amounts), retry with the stored data, late delivery (NakDost), the two-working-day term, the 30-day limit.
  • Echo connection test, sealed FINA certificate, test and live mode side by side, Multi-Vendor owner mode or one account per vendor.

Not in 1.0 (documented, not hidden)

  • B2B eRacun (structured e-invoice, EN 16931 / UBL 2.1 with the Croatian CIUS HR-FISK 2.0, exchange through an information intermediary or an own access point, fiscalization of the e-invoice, e-reporting of payments and rejections). This needs a certified information intermediary or an own accredited access point and its contract; the Porezna uprava publishes the list of intermediaries (https://porezna-uprava.gov.hr/hr/popis-informacijskih-posrednika/8019) and each has its own API and onboarding. No public intermediary API was found that a shop owner can use without a contract, so nothing here guesses one. B2B sales that are paid in cash or by card and get a fiscalized receipt ARE covered (the buyer OIB is sent, see below).
  • Tips (“napojnica”, spec chapter 2.3), change of payment method / buyer OIB after fiscalization (chapter 2.1.6; use a storno plus a new receipt), self-service devices (2.2), working hours of the premises (2.8), the test-only receipt check ProvjeraZahtjev (2.5).
  • Registering business premises: the premises must be registered by the taxpayer with the Porezna uprava (ePorezna); the add-on only uses the mark.
  • Several premises or devices per account (one premises mark and one device number per mode and account).
  • Partial refunds: a storno cancels a whole receipt; for a partial refund issue the storno and a new receipt by hand.

All facts below come from the official documents, checked on 2026-11-09. “Not verified” marks what the documents do not say.

Topic Source
Technical specification v2.7 (history: 16.06.2026, 06.07.2026, 21.07.2026) https://porezna-uprava.gov.hr/UserDocsImages/Fiskalizacija/Tehni%C4%8Dke%20specifikacije/Fiskalizacija%20-%20Tehnicka%20specifikacija%20za%20korisnike_v2.7%20(21.07.2026.).pdf (published 2026-07-06, notice https://porezna-uprava.gov.hr/hr/obavijest-obveznicima-fiskalizacije-u-krajnjoj-potrosnji-tehnicka-unapredjenja-u-sustavu-fiskalizacije-u-krajnjoj-potrosnji/8769)
Pravilnik o fiskalizaciji racuna u krajnjoj potrosnji NN 153/2025, https://narodne-novine.nn.hr/clanci/sluzbeni/2025_12_153_2278.html
Zakon o fiskalizaciji NN 89/2025, https://narodne-novine.nn.hr/clanci/sluzbeni/2025_06_89_1233.html
Fiscalization 2.0 guide, e-invoice phases, MIKROeRACUN https://porezna-uprava.gov.hr/hr/vodic-kroz-fiskalizaciju-2-0-8151/8151
DEMO certificate of the test system replaced in July 2026 https://www.fiscal-requirements.com/news/5630-croatia-demo-fiskalcistest-certificate-to-be-replaced-in-july-2026
Overview of the B2C changes https://www.fiscal-requirements.com/news/5743-croatia-updates-technical-requirements-for-b2c-fiscalisation

Endpoints, transport, signature (spec v2.7 chapters 3, 4, 5, 6.1, 7)

Section titled “Endpoints, transport, signature (spec v2.7 chapters 3, 4, 5, 6.1, 7)”
Item Rule
Test URL https://cistest.apis-it.hr:8449/FiskalizacijaServiceTest (chapter 6.1); available except weekdays 16:00-17:00 and Sundays 08:00-12:00
Live URL https://cis.porezna-uprava.hr:8449/FiskalizacijaService
Transport SOAP 1.1 document-literal over HTTPS, one-way TLS 1.2 / 1.3 (chapter 3.2, 3.3), UTF-8 XML, TCP port 8449
TLS 1.1 refused by the test system since 2026-07-01 and by production from 2027-01-01 (chapter 2); the add-on requires TLS 1.2+
Server certificates production: issued by FINA RDC CA for cis.porezna-uprava.hr; test: FINA DEMO CA for cistest.apis-it.hr (chapter 5). Both CAs may be missing from the server trust store: paste the chain on the Connection page
Namespace http://www.apis-it.hr/fin/2012/types/f73
Request signature XMLDSig “enveloped” on the root element (Id attribute, Reference URI="#<Id>"), exclusive canonicalization http://www.w3.org/2001/10/xml-exc-c14n#, transforms enveloped-signature + exc-c14n, KeyInfo/X509Data with X509Certificate (chapter 7)
Signature algorithm RSA-SHA256 + SHA-256 digest (http://www.w3.org/2001/04/xmldsig-more#rsa-sha256, http://www.w3.org/2001/04/xmlenc#sha256). RSA-SHA1 is refused by the test system since 2026-07-01 and by production from 2027-01-01; production accepts SHA1 or SHA256 until 2026-12-31. The add-on only produces SHA-256. The 21.07.2026 revision of the spec corrected the algorithm URIs in the examples
Answer signed with the algorithm of the request, inclusive canonicalization http://www.w3.org/TR/2001/REC-xml-c14n-20010315 (chapter 7 note); signed with the application certificate fiskalcis (production) / fiskalcistest (test) (Pravilnik NN 153/25 art. 8(2) point 6 and art. 23(6)). The add-on verifies digest and signature value, requires that certificate name for the mode and, when a CA chain is saved on the Connection page, the chain (setting “Check the signature of the answers”, on by default). An answer with a JIR that fails the check keeps the JIR and is flagged; it is never resent
Certificate advanced certificate of a trust service provider on the EU trusted list that contains the OIB (ETSI EN 319 412-3, organizationIdentifier VATHR-<OIB>); FINA application certificates and existing “Fiskal” certificates are accepted (chapters 5, 11). A test certificate is not accepted live and the other way round (chapter 4.2)
Message id UUID, a new one for every message, also for a repeated one (chapter 2.1.1)

SOAPAction: taken from the official WSDL v1.7 (binding of the racuni and echo operations): http://e-porezna.porezna-uprava.hr/fiskalizacija/2012/services/FiskalizacijaService/racuni and .../echo. The element order of Racun matches the RacunType sequence of the official FiskalizacijaSchema.xsd v1.7.

Not verified: against the live system: whether it returns the same JIR for a repeated message, and the exact subject of the fiskalcis answer certificate (the name is the one the Pravilnik gives).

Receipt data (chapter 2.1.1) and how the add-on fills it

Section titled “Receipt data (chapter 2.1.1) and how the add-on fills it”
Element Source in the add-on
Zaglavlje/IdPoruke, DatumVrijeme new UUID per attempt, send time in Croatian local time dd.mm.yyyyThh:mm:ss
Oib OIB of the mode in the account
USustPdv setting “VAT status”
DatVrijeme issue time of the receipt (stored, never changes), Europe/Zagreb
OznSlijed P numbering per premises, N per device
BrRac/BrOznRac, OznPosPr, OznNapUr gap-free number (digits, no leading zero), premises mark, device number
Pdv/Porez (Stopa, Osnovica, Iznos) one group per VAT rate, from the order taxes (both CS-Cart tax calculation methods)
IznosUkupno order total in euros (a store with another primary currency converts with the EUR currency of the store)
NacinPlac G cash, K card, T bank transfer, O other (several ways = O), from the payment method mapping; cash on delivery defaults to G
OibOper operator OIB (default the taxpayer OIB)
ZastKod ZKI
NakDost true from the second attempt on (the receipt was issued without a JIR)
OibPrimateljaRacuna valid buyer OIB from the configured profile field, only when the payment code is not T (restrictive error 181)

Not sent in 1.0: Pnp, OstaliPor, IznosMarza, ParagonBrRac, SpecNamj.

ZKI = MD5( RSA-sign( OIB + dd.MM.yyyy HH:mm:ss + number + premises + device + total ) ), UTF-8, decimal point, 32 lower-case hex characters. Conflict in the sources: the specification v2.7 (chapter 12.1, Java and .NET examples) signs with RSA-SHA256; the Pravilnik NN 153/2025 art. 16 still names RSA-SHA1. The add-on follows the newer specification and offers SHA-1 as a setting; confirm with the tax administration (fiskalizacija.help@apis-it.hr) before going live.

https://porezna.gov.hr/rn?jir=<JIR>&datv=YYYYMMDD_HHMM&izn=<cents> (or zki=<ZKI> while there is no JIR), amount in cents, minus sign for a storno. The QR is model 2, error correction M (the specification asks for at least L), no logo; print it at least 2 x 2 cm. The add-on draws it with a white margin of 4 modules (Pravilnik art. 18(1): at least 2 mm) and prints it at 156 px on the receipt page and 124 px in the order documents.

  • The number comes from kv_croatia_fiscalization_counters (one row per account, mode, premises and device). The counter update and the insert of the receipt are one transaction under a database lock, so a failure leaves no gap, and the sequence of test mode is separate from live.
  • The receipt row (number, issue time, ZKI, data in cents) is written before anything is sent. Every attempt rebuilds the message from that row (new message id, new signature, NakDost true from the second attempt), so a retry sends exactly the same receipt.
  • An answer that does not arrive (timeout, 5xx, SOAP fault, unreadable answer) is a retry (5 min, 15 min, 1 h, 3 h, then every 12 h, up to 60 attempts). The specification gives no production lookup for a message whose answer was lost (the check method exists only in the test environment), so the retry is a late delivery with the same data; the assumption that a repeated message returns the same JIR is not verified against the live system.
  • Late delivery term: after a connection outage the data of the receipts must be delivered within two working days counting from the day of the interruption (Zakon o fiskalizaciji art. 21; five working days after a complete device failure, art. 22). The add-on stores the first failure and shows the end of the second working day (Saturdays and Sundays skipped, public holidays not known) as the delivery term and logs a warning when it passes. The “48 hours” of the old regime is not used; it is not in the current text.
  • A receipt whose issue date is more than 30 days before the current date (Croatian calendar dates) is refused by the system (restrictive error 176, chapter 2.1.5): the add-on stops sending it and shows it as rejected. The restrictive codes are read only from the list after “restriktivne greske:” in the s013 answer.
  • Answers: JIR (UUID) = accepted and final, never downgraded. s002-s005 (certificate, signature, OIB) pause the account and park the receipts until the connection is saved again (retrying a refused identity only repeats the refusal). s006 is a system error and is retried. s001 (schema) and s013 (restrictive errors 176-184) reject the receipt with an explanation; “Send again” queues it once the cause is fixed.
  • A receipt made in test mode is never sent to the live system (it is rejected locally). A live receipt that is not delivered when the account is switched to test mode waits (status W) and is sent when the account is live again; the Connection page warns about it.
  • A receipt is sent with the OIB it was issued and ZKI-signed with (stored in its data), never with the account’s current OIB. When the account OIB or the certificate OIB differs, the receipt waits with an explanation. The OIB of a mode cannot be changed while receipts of that mode are undelivered.
  • Storno: a job with the unique key storno:<order> (status hook or button). It waits while the receipt is numbered or delivered, retries with the job back-off for about 30 days, is shown on the order tab and is dropped when the order became active again before the storno was issued. The storno carries the number and JIR of the receipt it cancels.
  • A new receipt after a storno (spec 2.1.6: storno plus new receipt) gets the source key order:<id>:R<n>; it is issued when an order whose last receipt was cancelled reaches a fiscal status again, or by the button on the order tab.
  • Every receipt stores what it was printed with: the seller (name, address), OIB, operator mark, the lines with quantity and gross amount (plus an adjustment line for order discounts and rounding), the VAT groups and the ZKI algorithm. The receipt view, the customer receipt and the document block read only that data.
  • The certificate is opened once with its password; only the PEM bundle is kept, sealed with AES-256-GCM (key derived from crypt_key of config.php). The password is never stored, logged or shown; the forms show only the public certificate details.
  • Receipts, counters, accounts and the log are legal records: uninstall keeps them unless “Permanently delete all fiscal data on uninstall” is on (retention.json; Zakon o fiskalizaciji art. 35).
Class Role
Fiscal\Format OIB check, Croatian time, amounts, ZKI input, QR link, UUID, XML-safe text, delivery term
Fiscal\Certificate opens .p12 / PEM, checks key, expiry and OIB, returns the sealed bundle
Fiscal\Signer ZKI and the XML signature (sign and verify)
Fiscal\Message RacunZahtjev / EchoRequest builders and the answer parser (XXE-safe)
Fiscal\Receipt order to receipt data, storno, payment code
Fiscal\Qr QR encoder (pure PHP, SVG, PNG data URI for documents)
ReceiptView printable receipt (admin and customer), document block for the invoice and e-mails, signed customer link
Client\Cis SOAP over cURL (TLS 1.2+, optional CA chain), mock transport for tests
Accounts, Documents, Jobs, Queue, Log, Access accounts, receipts and numbering, job handlers, queue, log, Multi-Vendor rules
Upgrade\Synchronizer, License\Client, Retention generated: self-healing upgrade, license client, kept records

PHP hook change_order_status_post (fiscalize at the first configured status, queue the storno at the storno status, log a paid status without receipt), template_snippet_render_post (fiscal block or “OVO NIJE FISKALIZIRANI RAČUN” after the products_table snippet of order documents; exists in 4.17.2 and 4.21.2), delete_order (log only). Storefront dispatch kv_croatia_fiscalization.receipt (signed link or a signed-in customer who may see the order; Cache-Control: no-store). Template hooks: orders:tabs_extra (admin order tab), orders:manage_data / orders:manage_header (list column), storefront orders:details (customer receipt block). Console cron: php admin.php --dispatch=kv_croatia_fiscalization.cron.

Test override of the endpoint (development only, never in production): $config['kv_croatia_fiscalization_base_url'] = 'http://127.0.0.1:<port>/FiskalizacijaServiceTest'; in config.local.php.

Owner mode (default): one OIB, premises, device and certificate for the marketplace owner; vendors may look at their orders’ receipts but cannot create, send, storno or retry anything. Owner mode off: every vendor connects their own OIB and certificate and fiscalizes their own orders; numbering is per account. Global actions (run queue, fiscalize missing orders) are administrator only; every vendor action compares the order’s company with the vendor’s.