When an order becomes "Processing" or "Completed", the plugin sends it to the HAfiscal 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);
- on a public printable page;
- to the shop admin in an order meta box and an orders list column.
Other features:
- 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 HAfiscal - see below.
- Bank transfer / IPS QR payment method confirmed automatically by HAfiscal - see below.
- Products and stock synced with HAfiscal - 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 HAfiscal (one per order, idempotent). If HAfiscal 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 HAfiscal 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 HAfiscal 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 HAfiscal (selected warehouse). A paid order ("Processing"/"Completed") decreases it once, cancelled or refunded orders (full or per line) increase it. Stock changes in HAfiscal 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.
eFaktura (SEF)
E-invoices are a feature of the HAfiscal service: the plugin sends the invoice data to HAfiscal, and HAfiscal 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 HAfiscal account. The plugin itself never connects to SEF. The invoice also appears in HAfiscal among outgoing invoices, numbered by the company's HAfiscal numbering. An HAfiscal account with eFaktura enabled and set up is required; if it is not, HAfiscal'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 HAfiscal.
- Only buyers marked as a company with a valid tax ID (PIB) whose company is registered on SEF get an e-invoice (HAfiscal 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 HAfiscal account with an API key is required (
https://hafiskal.rs).