Skip to main content

Invoice prefix handling

In delegated invoicing, every invoice book (prefix) belongs either to the supplier or to one specific delegate. This page summarises:

  • why prefixes matter in delegated invoicing,
  • where delegated prefixes come from,
  • what happens with the prefix you send via Számla Agent - decision tree with a textual explanation,
  • how receipt prefixes differ,
  • and the typical prefix errors.

Why prefixes matter in delegated invoicing

  • Prefixes separate the supplier's own invoices from the delegate's invoices; storno, correction, and repeat rights follow this separation (see Restrictions on invoice operations).
  • A delegate can only see and use invoice books tied to their own company; the supplier's other invoice books are not available to them.
  • A prefix is at most 5 characters. You can only provide your own prefix via Számla Agent: in the API join request or in the invoice XML - not on the UI. If you provide one, that is used; the system only generates an MB-prefixed one when you did not provide your own.
  • A prefix that has already been used (a document was issued with it) can no longer be modified: if a user with rights to edit prefixes in the supplier account (typically the account owner) tries to rename it on the Settings > Prefixes page, they get error message 360 on save.

Where do delegated prefixes come from?

SourceWhen
<cegszamlaszamelotag> in the action-agent_ceg_mb callSupplier account creation or join request via API: the prefix is stored with the request, and the invoice book is created when the supplier's account owner accepts the join request on their dashboard. A join request sent from the UI cannot contain a prefix.
Automatic generation when the request is acceptedIf the join request contained no prefix, and the delegate has no invoice book with this supplier yet, the system generates one when the request is accepted (MB + letters). In practice this means requests started from the UI, since no prefix can be given there; in the API request <cegszamlaszamelotag> is mandatory (without it the call fails with error 7).
New prefix sent in an invoice XMLRegistered automatically and tied to the delegate (see the decision tree).
New prefix sent in a receipt XMLRegistered automatically as a new receipt book in the supplier account (see Receipt prefixes).
Receipt prefix generated at UI loginWhen the dedicated (delegated) user first logs in to the supplier account and has no receipt book yet, the system automatically generates an MB-prefixed receipt prefix.

Decision tree: what happens with the prefix you send

The following logic runs on every delegated Agent invoice call (xmlszamla):

An exception to the disabled-book rule: cancellation (storno), correction invoices, and invoices created from a proforma or advance invoice can be issued into a disabled invoice book as well.

The steps of the decision tree in words:

  • You send your agreed delegated prefix: the invoice is issued into that book.
  • You send no prefix: if you have exactly one delegated invoice book with this supplier, the system automatically uses that single prefix of yours; if you have none or more than one, the call fails with error 357 and you must specify the prefix.
  • You send a brand new prefix: a new invoice book is registered automatically, tied to your company. It is worth agreeing with the supplier before introducing a new prefix.
  • You send a prefix that belongs to another delegate or is a receipt prefix: the call fails with error 354.
  • You send a disabled prefix: the call fails with error 202 at the invoice book check, even if the book is otherwise tied to your company.
  • You send an existing supplier prefix that is not tied to any delegate: if you already have a proper delegated book, the response tells you to use that one (error 356, with the correct prefix in the message). If you have none and the prefix is still unused, it is assigned to your company and the invoice is issued; if it already has invoices, the call fails with error 354.

Receipt prefixes

For receipts the <elotag> field is required; there is no automatic selection. Receipt prefixes are separate from invoice prefixes: a prefix already used by invoices cannot become a receipt prefix (error 336). Details: Issue receipts in third-party invoicing.

Prefix errors overview

The table below summarises all prefix-related error codes, in ascending order:

CodeMessage (translated)Typical cause and what to do
68An account already exists with this tax number and invoice prefix.The prefix given in the action-agent_ceg_mb request is already used by this tax number; agree on a different prefix with the supplier.
200This prefix is currently in use by a billing account with the same tax number as an invoice/receipt prefix. Please choose another prefix.The prefix is currently used by another active account with the same tax number (can occur when a new invoice book is created, when the join request is accepted, and when a new prefix is registered); choose a different prefix.
202This invoice prefix does not exist or is not enabled: (prefix).The invoice book of the prefix you sent is disabled or blocked due to an invoice number collision found in NAV; a disabled book can be enabled in the supplier account on the Settings > Prefixes page, a NAV-blocked book requires a different prefix.
336This prefix is already used by invoicing, so it cannot be a receipt prefix ((prefix)).You sent a prefix for a receipt that already has invoices; choose a separate receipt prefix.
337The prefix may only contain uppercase letters and digits, and may be at most 5 characters long.The <cegszamlaszamelotag> sent in the action-agent_ceg_mb request has an invalid format; fix it in the request.
353There is no valid invoice prefix at all.There is no enabled invoice book in the account at all; create or enable one.
354This invoice prefix cannot be used.The prefix you sent belongs to another delegate, is a receipt prefix, or already has invoices and cannot be taken over; send your agreed delegated prefix.
356Instead of the given invoice prefix, use this: (prefix).You already have a delegated invoice book with this supplier; you must use the prefix returned in the message.
357Please provide the invoice prefix.You sent no prefix, and it cannot be selected automatically either, because you have no delegated invoice book or more than one; send the agreed prefix in <szamlaszamElotag>.
360This prefix cannot be modified because it was already used for invoicing.You tried to edit a prefix on the UI that already has documents issued with it; a used prefix cannot be modified - a new invoice book can be created instead.
362This tax number already used this prefix earlier. Please choose another prefix.This tax number already used the prefix earlier, in a since-disabled (no longer active) account; choose another prefix.
524This receipt prefix is not enabled: (prefix).The receipt book was disabled by the supplier; it can be re-enabled on the Settings > Prefixes page.

Exact messages and resolutions: Error handling.

Practical tips

  1. Agree the prefix with the supplier in advance and treat it as part of the contract.
  2. Use a prefix that identifies the delegated relationship (for example the supplier's short name), at most 5 characters.
  3. Send the prefix explicitly in every invoice XML, even if automatic selection would work. Automatic selection only works while you have exactly one delegated invoice book: if a second book is created later, calls without a prefix start failing with error 357.
  4. You cannot use the supplier's own prefixes: a supplier prefix that is already used is rejected with an error, and an unused one would be reassigned to your company (see the decision tree) - so always send the agreed delegated prefix.