Description
When an order becomes “Processing” or “Completed”, the plugin sends it to the HAFiskal Cloud API, which issues a fiscal receipt through the Serbian Tax Administration fiscal system (PFR). The receipt (number, QR code, journal, verification link) is stored on the order and shown:
- to the customer on the “Thank you” page and in “My account > Orders”;
- in customer emails (the receipt is issued before the email is sent) – black text on white with inline styles, readable in Gmail, Outlook and dark mode, with the verification QR code above “КРАЈ ФИСКАЛНОГ РАЧУНА” as on the printed receipt;
- on a public printable page;
- to the shop admin in an order meta box and an orders list column.
Other features:
- Fiscalization start date: orders paid before the date the fiscal software (ESIR) was approved are never fiscalized – not automatically, not by the retry cron, not by bulk or manual actions.
- Foreign buyers (billing country other than Serbia): all lines with the 0% rate (tax label G) and a configurable legal note printed after the fiscal part of the receipt.
- Customer type field: private person or company, with company name, tax ID (PIB) and company registration number (MB), validated by check digit. Company buyers get their details on the receipt. Compatible with “Serbian Addons for WooCommerce” (same field keys, no duplicate fields).
- Explicit mapping of every payment method to the fiscal payment type (bank transfer, card, instant payment, cash).
- Automatic retries via WP-Cron without duplicate receipts.
- Automatic storno when an order is refunded.
- Serbian e-invoices (eFaktura, SEF) for company buyers, sent through HAFiskal – see below.
- Bank transfer / IPS QR payment method confirmed automatically by HAFiskal – see below.
- Products and stock synced with HAFiskal – see below.
Bank transfer / IPS QR payment
A payment method “Uplata na račun / IPS QR” (bank transfer / IPS QR), available for RSD.
- At checkout the plugin opens a payment request in HAFiskal (one per order, idempotent). If HAFiskal cannot open it (no connection, company bank account missing), the customer sees a clear error and can choose another payment method.
- The order is set to “On hold” and the customer gets the NBS IPS QR code and the payment slip data (payee, account, amount, model 97 and reference number, purpose, payment code) on the “Thank you” page, in “My account > Orders” and in the “On hold” / invoice email (the QR image in emails is a signed link, because many email clients block embedded images).
- When HAFiskal matches the payment from the bank statement, it notifies the shop (webhook, HMAC-SHA256 signature checked with the webhook secret). A fully paid order is marked paid and the existing flow issues the fiscal receipt or e-invoice. Partial or over-payments only add an order note and an admin notice.
- Fallback: WP-Cron checks waiting orders every 15 minutes for a configurable number of days (default 14).
- Cancelling the order cancels the payment request.
- On the fiscal receipt this method is always mapped (default “Bank transfer”; can be changed to “Instant payment” in the payment method mapping).
Products and stock
Settings tab “Artikli i zalihe” (products and stock).
- Simple products and variations with a SKU are sent to HAFiskal when saved, or all at once with “Send all products” (batches of 100 in the background, progress shown). Products without a SKU are skipped and listed.
- Price with VAT (active price, sale price when valid) according to the store tax settings; VAT rate from the product tax class (editable table, default standard 20%, reduced 10%, zero 0%).
- Stock is managed in HAFiskal (selected warehouse). A paid order (“Processing”/”Completed”) decreases it once, cancelled or refunded orders (full or per line) increase it. Stock changes in HAFiskal reach the shop through a webhook, the “Reconcile stock now” button and a daily check; these updates are never sent back. Quantities held by orders still waiting for payment are subtracted on the shop.
- Products list column and order notes show the sync status.
Fiscalization start date
Settings tab “Fiskalizacija”: “Datum početka fiskalizacije” (fiscalization start date) and “Blokiraj fiskalizaciju zaostalih porudžbina” (block backlog orders, default on).
- An order whose payment date is before the start date is never sent to HAFiskal: not when its status changes, not by the WP-Cron retry or the “unsent orders” sweep, not by the bulk action and not by the “Fiscalize” button (the order screen shows the reason instead). The order is marked “skipped (before fiscalization start)”.
- On a new installation or update to 1.11.0 the date is set to the day of the first load and an admin notice asks to change it to the ESIR approval date.
- A skipped order stays skipped while “block backlog orders” is on, even if the date is moved back. It can be fiscalized (manually or in bulk) only after the date is moved earlier and the block is turned off.
Foreign buyers
Settings tab “Fiskalizacija”, section “Strani kupci (van Srbije)”. A foreign buyer is an order whose billing country is not Serbia (an empty country counts as Serbia).
- Issue fiscal receipts to foreign buyers: yes / no.
- Tax label: G (all lines at 0%, the fiscal device assigns label G to the 0% rate; default) or the rates from the order. The amount is always what the customer paid. HAFiskal must have a 0% tax rate.
- With label G, a note is printed after the fiscal part of the receipt (HAFiskal “note” field, not sent to the fiscal device): one text for companies and one for private persons (company or person is taken from the customer type field or a filled company name). Both texts are editable; the defaults refer to the place of supply of services – for goods sold abroad check the legal basis with your accountant.
- A foreign company’s tax number is never sent as a Serbian tax ID (PIB); foreign buyers never get a Serbian e-invoice (SEF).
eFaktura (SEF)
E-invoices are a feature of the HAFiskal service: the plugin sends the invoice data to HAFiskal, and HAFiskal sends the e-invoice to SEF (the Serbian e-invoice system) on the merchant’s behalf, using the SEF settings (SEF API key, environment, company data, bank account) stored in the merchant’s HAFiskal account. The plugin itself never connects to SEF. The invoice also appears in HAFiskal among outgoing invoices, numbered by the company’s HAFiskal numbering. An HAFiskal account with eFaktura enabled and set up is required; if it is not, HAFiskal’s message is shown on the order and the buyer gets a fiscal receipt.
- Turned on with “Send e-invoices” (“Šalji eFakture”) on the eFaktura settings tab; “Check connection” (“Proveri vezu”) shows whether eFaktura is ready in HAFiskal.
- Only buyers marked as a company with a valid tax ID (PIB) whose company is registered on SEF get an e-invoice (HAFiskal checks the tax ID; the answer is kept for 24 hours). Private persons never get one.
- Invoice lines are the same as on the fiscal receipt (exact order total, shipping as a line, RSD only); VAT category and exemption code for 0% lines are configurable.
- Sent automatically when the order becomes “Processing” or “Completed” (configurable) or manually from the order screen and the “Send e-invoice” (“Pošalji eFakturu”) bulk action. An already sent order is never sent again automatically; a new e-invoice for the same order requires explicit confirmation.
- Temporary errors are retried by WP-Cron with the same invoice reference, so no duplicates are created.
- Configurable fiscal receipt rules: company with e-invoice – no fiscal receipt (default), company without e-invoice – fiscal receipt, private person – fiscal receipt. A skipped receipt is recorded on the order with the reason and can still be issued manually.
An HAFiskal account with an API key is required (https://hafiskal.rs).
External services
This plugin connects to one external service, the HAFiskal Cloud API. Nothing is sent when the plugin is activated: no data leaves the site until the shop admin connects the shop to HAFiskal (“Connect to HAFiskal”) or enters an HAFiskal API key. Without an API key the plugin makes no requests at all.
HAFiskal Cloud API (HostArena)
What it is: HAFiskal is a Serbian invoicing and fiscalization service provided by HostArena (https://hafiskal.rs). The plugin talks to the HAFiskal Cloud API at the address set in the plugin settings (default https://api.hafiskal.rs) and, only during “Connect to HAFiskal”, sends the admin’s browser to the HAFiskal web app (default https://dash.hafiskal.rs). https://api.ha.co.rs and https://fiscal.ha.co.rs are the former addresses of the same HAFiskal Cloud API and web app; installations that still have them saved are switched to the new addresses automatically on update.
What it is used for and what data is sent, and when:
- Fiscal receipts (fiscalization): when an order becomes “Processing” or “Completed” (or the admin clicks “Fiscalize”), and on WP-Cron retries of failed orders, the plugin sends the order ID and number, currency, order items (name, quantity, price with VAT, VAT rate, discounts), shipping and fees, the payment method mapped to the fiscal payment type and the amount. For company buyers only, it also sends the company name, tax ID (PIB), company registration number (MB), billing address, e-mail and phone so that the buyer appears on the receipt (for companies outside Serbia: company name, billing address with country, e-mail and phone, without a tax number). For foreign buyers the receipt note also contains the legal text configured in “Strani kupci (van Srbije)”. No personal data is sent for private persons. Orders paid before the configured fiscalization start date are never sent. When an order is refunded, the order ID and refunded amounts are sent to issue a refund (storno) receipt.
- Tax rates and company check: the plugin reads the company’s VAT rates, business locations and company name/tax ID from HAFiskal (when fiscalizing and when the admin clicks “Test connection”).
- E-invoices (eFaktura, only when “Send e-invoices” is turned on, and only for company buyers): before the first e-invoice to a buyer, the buyer’s tax ID (PIB) is sent to check whether the company is registered on SEF (the answer is kept for 24 hours). When an e-invoice is sent (automatically on order status “Processing”/”Completed”, or manually from the order screen or bulk action) the plugin sends the invoice data: buyer company name, tax ID (PIB), company registration number (MB), public sector ID (JBKJS, if entered), billing address, postcode, city and e-mail, order items (name, quantity, price with VAT, VAT rate, discounts), shipping, amounts, issue/delivery/due dates, the order number as the payment reference and the payment method. HAFiskal forwards this data to the Serbian e-invoice system SEF (Ministry of Finance of the Republic of Serbia) on the merchant’s behalf, using the merchant’s SEF settings stored in HAFiskal; the plugin never contacts SEF itself. “Refresh status” and “Check connection” ask HAFiskal for the invoice status and for whether eFaktura is ready.
- Payment requests (bank transfer / IPS QR): when a customer chooses the “Uplata na račun / IPS QR” payment method, the plugin sends the order ID, order total, currency, description (“Order #number”), the customer’s name and e-mail and the expiry date to get the payment slip data and the NBS IPS QR code. While the order waits for payment, the plugin asks HAFiskal for the payment status (at most every 15 minutes, for the configured number of days) and cancels the request when the order is cancelled. HAFiskal sends payment notifications to the shop’s webhook URL (/wp-json/hafiscal/v1/webhook); they are accepted only with a valid HMAC-SHA256 signature.
- Products and stock (only when enabled in the “Artikli i zalihe” tab): product data (SKU, name, price with VAT, VAT rate, barcode, category, short description, image URL, active flag) is sent when a product is saved or on “Send all products”; stock movements (SKU, quantity change, order or refund ID) are sent when an order is paid, cancelled or refunded; the list of warehouses and stock quantities is read on “Reconcile stock now” and once a day. No customer data is sent for products and stock.
-
One-click connect (“Connect to HAFiskal”): when the admin clicks the button, the browser is sent to the HAFiskal web app with the shop URL, shop name, return URL and a random one-time state value. After the admin approves, the plugin sends the one-time code and the shop URL to the HAFiskal Cloud API (/v1/connect/exchange) and receives the API key, API address, webhook secret and the company name and tax ID. “Set up notifications automatically” sends the shop’s webhook URL and the list of events.
-
Service provider: HostArena, https://hafiskal.rs
- Terms of Service: https://hafiskal.rs/uslovi-koriscenja/
- Privacy Policy: https://hafiskal.rs/politika-privatnosti/
Data forwarded by HAFiskal to SEF (e-invoices only): SEF – Sistem e-faktura, the Serbian e-invoice system operated by the Ministry of Finance of the Republic of Serbia. Terms of use, privacy and legal documents: https://www.efaktura.gov.rs
Links shown to customers
The fiscal receipt contains a verification link and QR code issued by the Tax Administration of the Republic of Serbia (suf.purs.gov.rs). The plugin only shows this link; the customer’s browser opens it only if the customer clicks it or scans the QR code. The QR code image is generated by the plugin itself from the verification link (no external QR service is used); in e-mails it is a signed image link served from the shop itself.
Installation
- Click “Connect to HAFiskal” (“Poveži sa HAFiskal”) in WooCommerce > HAFiskal, log in to HAFiskal and approve the connection. The API key and the notification (webhook) secret are set up automatically – nothing to copy.
- Map payment methods on the same page and save. Enable “Uplata na račun / IPS QR” in WooCommerce > Settings > Payments if you want bank transfer / IPS QR payments.
- Installing: Plugins > Add New (search “HAFiskal” or “hafiscal”) or upload the
hafiscal-for-woocommercefolder towp-content/pluginsand activate it. If a very old copy of this plugin (older than 1.5.0, in a different folder) is installed, deactivate and delete it first; settings and receipts are kept. - Shops that already entered an API key manually: click “Set up notifications automatically” (“Podesi obaveštenja automatski”). Manual API key and webhook secret fields remain under “Advanced / manual setup” (“Napredno / ručno podešavanje”).
Changelog
1.11.0
- Name: “HAFiskal for WooCommerce” everywhere (menus, notices, order notes, emails, logs). Internal names (options, order data, scheduled tasks) are moved automatically on update; already fiscalized orders are never fiscalized again and settings are kept.
- New: fiscalization start date and “block backlog orders” – orders paid before the start date are never fiscalized (automatic, retry cron, bulk and manual actions) and are marked as skipped.
- New: foreign buyers (billing country other than Serbia) – tax label G (0%) on all lines and a legal note after the fiscal part of the receipt (separate editable texts for companies and private persons); option to not issue receipts to foreign buyers; a foreign tax number is not sent as a Serbian PIB; no Serbian e-invoice for foreign buyers.
- Receipt in emails and on pages: black text on white with inline styles (was hard to read in some email clients and in dark mode), QR code generated from the verification link and placed above “КРАЈ ФИСКАЛНОГ РАЧУНА” in the middle of the receipt, “Proveri račun na sajtu Poreske uprave” link under it. In emails the QR code is a signed image link from the shop (shown in Gmail and Outlook); it is now shown also when the fiscal device did not return an image.
- Fix: saving settings from code (connect, disconnect, automatic notifications setup) turned “No” options into “Yes” and “Disconnect” did not remove the API key.
- Fix: the order screen QR code and refund QR code use the same generated image.
- Links from emails sent before 1.11.0 keep working.
1.10.0
- E-invoices (eFaktura) are now sent through HAFiskal: the plugin sends the invoice data to the HAFiskal Cloud API and HAFiskal sends the e-invoice to SEF with the SEF settings from the merchant’s HAFiskal account. The plugin no longer connects to SEF and no longer stores SEF API keys or seller data (removed from existing installations on update).
- E-invoices also appear in HAFiskal among outgoing invoices.
- New “Send e-invoices” switch and “Check connection” button on the eFaktura tab; installations with a SEF API key entered keep e-invoices turned on.
- Readme: “External services” lists only the HAFiskal Cloud API, including the e-invoice data that HAFiskal forwards to SEF; the former HAFiskal addresses (api.ha.co.rs, fiscal.ha.co.rs) are documented.
1.9.0
- Styles and scripts are loaded only with wp_enqueue_* / registered handles from the assets folder; no inline style or script tags. The admin script is loaded only on the plugin’s own screens (HAFiskal settings and order screens).
- Admin notices are shown only on the plugin’s own screens (HAFiskal settings, orders, WooCommerce payment settings) and can be hidden; the “WooCommerce required” notice is shown only on the Plugins screen.
- Block checkout fields: removed the unsupported “inputmode” attribute (no notices with WP_DEBUG).
- WP-Cron events are scheduled on “init” instead of “plugins_loaded” (no early translation loading notice); fixed a PHP 8.4 deprecation notice.
- No requests to external services until the shop is connected to HAFiskal / an API key is entered.
- Readme: “External services” section with what is sent, when, and links to the Terms of Service and Privacy Policy.
1.8.1
- HAFiskal moved to the hafiskal.rs domain: default API address is now https://api.hafiskal.rs and the HAFiskal web address is https://dash.hafiskal.rs.
- On update, saved addresses equal to the old defaults (https://api.ha.co.rs, https://fiscal.ha.co.rs) are switched to the new ones automatically. Custom addresses are not changed. The old addresses keep working.
1.8.0
- One-click “Connect to HAFiskal” (“Poveži sa HAFiskal”): approve in HAFiskal, API key, API address and webhook secret are saved automatically, connection is tested; status box with company name and tax ID, “Reconnect” and “Disconnect”.
- “Set up notifications automatically” for shops with a manually entered API key (creates or updates the webhook in HAFiskal and saves the secret).
- New setting “HAFiskal web address”; manual API key and webhook secret fields moved to “Advanced / manual setup”. Keys and secrets are never shown or logged.
1.7.0
- New payment method “Uplata na račun / IPS QR”: payment request in HAFiskal at checkout, IPS QR code and payment slip on the “Thank you” page, in My account and in emails, automatic confirmation by webhook (HMAC signature) with a 15-minute fallback check, partial/over-payment notes and admin notice, request cancelled with the order; mapped to “Bank transfer” on the fiscal receipt.
- Webhook endpoint /wp-json/hafiscal/v1/webhook and webhook secret setting.
- New settings tab “Artikli i zalihe”: product sync by SKU (on save and in bulk), VAT rate per tax class, warehouse choice, stock movements for paid, cancelled and refunded orders, stock updates from HAFiskal (webhook, button, daily) without loops, products list column.
1.6.0
- Serbian e-invoices (eFaktura, SEF) for company buyers registered on SEF: exact order totals, automatic or manual sending, bulk action, safe retries.
- Fiscal receipt rules per buyer type (company with e-invoice, company without e-invoice, private person); skipped receipts are recorded with the reason.
- Fix: the retry cron no longer picks up refund objects.
1.5.0
- Prepared for WordPress.org: plugin slug and text domain “hafiscal-for-woocommerce”. Existing installations: deactivate the old copy from the previous folder, settings and receipts are kept.
1.4.1
- Plugin name “HAFiskal for WooCommerce”, license header, English readme, translator comments.
1.4.0
- Customer type field (person / company) with company name, tax ID and registration number on checkout, registration and My account; compatible with Serbian Addons for WooCommerce.
1.3.0
- Explicit payment method mapping (bank transfer, card, instant payment, cash).
1.2.1
- Company buyer details on the receipt.
1.2.0
- Automatic retries via WP-Cron without duplicate receipts.
1.1.0
- Receipt shown to the customer, emails, refunds, HPOS compatibility and many fixes.
1.0.0
- First version.
