Help / Records
e-Invoice (UJP)
Outgoing e-invoices with automatic resending and offline entry, incoming e-invoices with VAT totals.
On this page
The Invoices screen is in the Records group. Here you send outgoing e-invoices to the UJP, fetch the incoming ones and accept or reject them. Every request to the UJP is signed with the legal entity’s certificate.
You do not retype here a sales invoice that has already been entered in Invoices: you send it with Send to UJP in the list of invoices. That e-invoice then shows up in Issued.
Important: an e-invoice created on this screen (New e-invoice) and received e-invoices are not posted automatically as an entry. You have to enter them separately in Invoices or post them.
Who can do what
| Action | Roles |
|---|---|
| Environment and EUJP ID (in Settings), uploading and deactivating a certificate | administrator |
| New e-invoice, offline e-invoice, reversal, refreshing the status, ASiC, history, fetching and deciding on incoming invoices, VAT totals | administrator, accountant |
| Viewing Issued, Received | all members |
The administrator sets certificates; the administrator and accountant can unlock a certificate and use the signer.
In read-only mode (inactive subscription) the database allows no new records. All actions are written to the audit trail.
Setup
Settings → Company — The settings card shows the Tax ID, Environment, EUJP ID, Certificate (subject and “valid until”, or No certificate) and Signing. The Signing field shows “Unlocked until …”, Locked or “Local (the key stays with you)”.
Set the environment, EUJP ID, .p12 certificate and public certificate for local signing in Settings → Company. Invoices shows the certificate status and a link to these settings.
- Open Settings from the user menu, the Legal entity tab (see Settings).
- Choose the Environment: Test or Production.
- Enter the Legal entity’s EUJP ID.
- Click Save. The message “e-Invoice settings saved” appears.
Other roles see these settings but do not change them: “Only the administrator changes the company settings; you can view them.” The settings are not changed in place. Every save is a new version, and the database requires the administrator role.
While something is missing, the screen shows “Missing: …” with one or more items:
- Legal entity’s EUJP ID
- Certificate (local or .p12)
- Local signer (the desktop app or kc signer)
- The server has no KC_SECRET_KEY
- Unlocking the certificate (password)
Note: the default environment is the UJP test environment. KontoCloud has been tested live only with the UJP test environment.
Server certificate (.p12)
This option exists only if the server has an encryption key set (KC_SECRET_KEY). Without it the screen shows “The server has no KC_SECRET_KEY: the certificate cannot be stored encrypted.” In that case, use the local signer.
- Choose a
.p12or.pfxfile. You can select it before entering the password. Only the administrator can do this. - Enter the Certificate password, then click the Upload certificate (.p12) button. Selecting the file alone does not upload it.
- The message “Certificate uploaded and unlocked” means it is ready for signing.
The file is stored encrypted (AES-256-GCM), and the password is never saved. Unlocking lasts at most 12 hours and is kept only in the server’s memory. After a server restart you have to enter the password again and click Unlock. Lock ends the unlocking immediately.
The database refuses the certificate with error KC261 if:
- it is issued to another EDB (“The certificate is issued to EDB …, and the legal entity has EDB …”);
- it has expired (“The certificate expired on …”).
Deactivate certificate (administrator) does not delete the certificate. It is a new event, and the last certificate that has not been deactivated stays valid.
For a certificate that stays on a USB token or in your own local .p12, see Local signer.
New e-invoice
Open Invoices → New sales invoice. Select a partner with an ЕДБ, document kind, dates and number series; enter lines and accounts. Choose payment and tax codes for VAT-exempt lines in the same form. The database assigns the number; totals appear below the lines.
Issuing saves the document, accounting entry and submission request together. It works when UJP or the signer is unavailable. The option to issue without sending skips the immediate submission; later submission keeps the original number and date using docAlt. The invoice stays in the same list with its sending status. The form supports domestic MKD invoices (100), advances (130) and credit notes (110). Locked periods and read-only access still prevent issuing.
Automatic resending
If sending fails because of a temporary error (the UJP does not respond, timeout), the e-invoice enters the resend queue. The attempts come after 1, 2, 5, 10 and 30 minutes, then every hour, for at most 3 days. The automatic attempts are recorded under the name of the user whose sending failed.
The queue waits if the server certificate is not unlocked or the local signer is not connected. The queue stops if:
- the UJP rejects the e-invoice: “The UJP rejected the e-invoice: fix it and send it manually.”;
- 3 days pass: “…after 3 days of attempts: send it manually.”;
- the legal entity is in read-only mode, the environment has changed or the user no longer has permission.
Sending manually (Send again) closes the queue. While an automatic attempt is running, manual sending is refused: “e-Invoice … is being sent automatically right now; try again in a few minutes” (KC265).
Issued
The table (how tables work) has the columns Number, Date, Type (Invoice, Reversal, Correction), Buyer, VAT, Total, Status, Status at UJP and Automatic sending. Hidden columns are EDB, Net, EUID, Error, From invoice (the number of the invoice from Invoices) and Entered by.
The Automatic sending column shows “Next attempt … (attempt …)”, “Waiting: …”, “Stopped: …” or “Sending…”. An e-invoice created offline has the label offline (“Created offline and sent in alternative mode (docAlt)”).
The statuses are: Sent, Failed, Sending, Reversed, Accepted, Rejected, Received.
Actions per row:
- PDF: in every row. Saves the e-invoice as
e-faktura-<number>.pdfin the KontoCloud layout, with the legal entity’s logo (see Settings). Once UJP accepts it, the PDF also has the EUID and the QR code for verification. - Refresh status, PDF from UJP, ASiC and History: for a sent invoice. PDF from UJP downloads the PDF that UJP makes, as
e-faktura-<number>-ujp.pdf. ASiC downloads the signed package from the UJP ase-faktura-<number>.asice. History opens the table “Status history at UJP: …” with the columns Time, Previous status, New status and Comment; if there are no changes, it says “UJP has recorded no status changes.” You close it with Close. When the invoice is sent, PDF, PDF from UJP and ASiC are grouped in the row’s Download menu. - Send again: for a failed invoice.
- Reversal: for a sent invoice that is not a reversal itself and has not already been reversed.
Sending in a batch
In the Issued table select the invoices and click Send selected. The UJP has no batch format: each invoice is sent as a separate request, and a failed one does not stop the others. Batches are listed under Send batches; Resend failed sends only the failed ones again.
A batch checks the locked period and the closed year on its own business date (today), not on the invoice date. When the period is locked up to today or the year of today’s date is closed, the database accepts neither a new batch nor a resend (KC003, KC110). An invoice dated in a locked period is accepted into a batch, but its sending is still checked by the e-invoice rule: that item fails with “The period is locked until …” and the others are sent. A read-only legal entity accepts neither a batch nor a resend.
Reversal
- Enter the Reversal number (a new number).
- Choose the Reason (UJP code list) and, if needed, enter a Comment.
- Click Reversal in the row of the invoice. On success you will see the message “Reversal … sent”.
The database refuses a reversal (KC264) if the invoice is itself a reversal, if it has not been sent or if it is from another UJP environment. A second attempt to reverse the same invoice is refused with KC265 (“has already been reversed”). For more on corrections, see Reversals and corrections.
Note: a correction of an e-invoice (a new state of the lines) is for now available only in the API and in the CLI:
kc efaktura correction. There is no button for it in the app.
Received
- Choose From and To. The default is the last 30 days.
- Click Fetch from UJP. The message “Found: …, new: …” tells you how many invoices were fetched.
The table has the columns Number, Date, Seller, VAT, Total, Status and VAT reported (✓ when the VAT totals have been reported). EDB, Net and EUID are hidden columns. Each row has PDF (in the KontoCloud layout, without a logo) and PDF from UJP. Until the VAT totals are reported, there is also VAT totals, and, until you have decided, Accept and Reject. When the UJP PDF is available, PDF and PDF from UJP are in the row’s Download menu.
To reject, choose a Reason and enter a Comment, then click Reject. Without a reason the database refuses the action with KC092. An invoice is decided only once: a second decision is refused with KC265 (“A decision has already been made on e-invoice …”).
VAT totals for the purchase
- Click VAT totals in the row of the received e-invoice. “VAT totals for purchase …” opens.
- For each row, enter the Tax indicator, VAT group, Rate %, Tax base and VAT. You add a new row with + line.
- Click Report to UJP. The message is “VAT totals for … reported”.
“The totals are reported to UJP once and cannot be changed afterwards.” If a row is missing the indicator, base or VAT, the screen shows “Row …: enter the indicator, tax base and VAT”. A second time, the database refuses the report with KC265.
Offline e-invoices
When the app has no connection to the server, the offline form appears in place of the Invoices screen: “No connection to the server. The e-invoice is kept on this device and sent to UJP in alternative mode when the connection is back.”
If the server is not available already at sign-in, the sign-in screen offers Work offline. Then choose a Legal entity from the last sign-in (only those where you are the administrator or the accountant). Back to sign-in takes you back.
- Enter the Number, Date (not in the future), Due and Payment method.
- Enter the Buyer tax ID (13 digits).
- Enter the lines and, if needed, a Note.
- Click Save on this device. The message is “E-invoice … is saved on this device and will be sent when the connection is back.”
If the number is already waiting on the device, the message is “An e-invoice with number … is already waiting on this device.” The form needs the UJP code lists saved on the device: “The UJP code lists are not saved on this device. Open e-Invoice at least once while connected to the server.”
Sending when the connection is back
The table “E-invoices waiting on this device” has the columns Number, Date, Legal entity, Buyer tax ID, Created on device and Status (Waiting for connection, Waiting for sign-in, Syncing… or the text of the error). When there is a connection and the same user is signed in, the e-invoices are sent on their own. You can also do it manually with Sync now. The message is “Offline e-invoices sent: …”.
The server calculates the e-invoice and sends it to the UJP in alternative mode (docAlt) under the number entered on the device. The device time must not be in the future (5 minutes tolerance), and the invoice date must not be after the day it was created (KC266). The same e-invoice is not sent twice. On a temporary error the e-invoice keeps waiting; on a permanent error you see the error and can remove it with Remove.
Important: offline e-invoices are stored unencrypted on the device: in the browser (localStorage) or, in the desktop app, in
~/.config/kontocloud. Offline entry works only if the app is already open; the web app does not open without a connection.
Signatures
The Signatures sub-tab shows the signatures made with a local certificate: time, what was signed, who requested it and who signed. See Local signer.
What is kept
The e-invoice states (sending, sent, failed, status, accepted, rejected), the resend queue and the VAT totals are records that are only added and never changed. E-invoices, including offline e-invoices (podatoci/e-fakturi-oflajn.jsonl), are part of the archive. A synced offline e-invoice is written to the audit trail as einvoice.offline_synced.
From the CLI, besides sending: kc efaktura send-invoice (an invoice from Invoices), pdf <id> --out <file> [--ujp], history, asic, vat-totals, offline-new --file and offline-sync --file.
Global UJP settings
Set the default EUJP ID and certificate in Account settings → UJP settings (/settings/ujp). They apply to companies where you are the primary (first active) administrator. Company overrides take precedence. An empty EUJP ID inherits the account default; Use account certificate restores inheritance without deleting history. The overview shows effective values, sources and certificate expiry. Only the account administrator unlocks the global certificate. Environments remain company-specific; global defaults do not grant UJP permissions.
Something unclear or wrong? Write to us at [email protected].