Skip to main content

Response

Expected results of generating receipts

The response contains everything about the generated receipt, and it can also include the PDF as well.

You should use <hivasAzonosito/> in the posted XML to make the call fault tolerant. If this field is in use, it needs to be unique, otherwise the API call will be unsuccessful. This ensures that if the same XML is posted multiple times, it will not duplicate an existing receipt.

Every successful call contains the <sikeres>true</sikeres> field in the response. In case the generation of the receipt fails and the result field is false: <sikeres>false</sikeres>, two additional fields will be included in the response, <hibakod/> for the error code and <hibauzenet/> for the error message itself.

Apart from the general error messages described in the previous chapters, you may also receive one of the following messages:

Error codeDescription
336“This prefix is already used to create invoices, and cannot be used to generate receipts.” You need to use a prefix that is not already in use to create invoices. Please keep in mind that these prefixes used to create receipts are not visible on the front end, which means that these prefixes used by Számla Agent will remain hidden.
337Prefix is not in the expected format: it can only contain capital letters and numbers
338The caller ID (unique field) you have just used already exists on the server.
339Receipt number does not exist (receipt query, send or delete).
340The paid amount of the receipt differs from the gross amount of the receipt.

When you try to create a receipt in a foreign currency, and the currency field <penznem/> differs from “Ft” or “HUF”, you also need to supply the exchange rate and the name of the bank providing the rates.

XML response example

<?xml version="1.0" encoding="UTF-8"?>
<xmlnyugtavalasz xmlns="http://www.szamlazz.hu/xmlnyugtavalasz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.szamlazz.hu/xmlnyugtavalasz https://www.szamlazz.hu/szamla/docs/xsds/nyugtavalasz/xmlnyugtavalasz.xsd">
<sikeres>true</sikeres> <!-- REQ boolean -->
<hibakod></hibakod> <!-- string --> <!-- error code (if any) -->
<hibauzenet></hibauzenet> <!-- string --> <!-- error message (if any) -->

<nyugtaPdf>...</nyugtaPdf> <!-- string --> <!--receipt PDF with base64 encoding -->

<nyugta> <!-- REQ -->
<alap> <!-- REQ -->
<id>123456</id> <!-- REQ id -->
<hivasAzonosito></hivasAzonosito> <!-- string --> <!-- If the call ID were defined during the creation of the receipt-->
<nyugtaszam>NYGT-2017-123</nyugtaszam> <!-- REQ string -->
<tipus>NY</tipus> <!-- REQ string --> <!-- type of the receipt: NY - "receipt", SN - "receipt cancellation" -->
<stornozott>false</stornozott> <!-- REQ boolean --> <!-- true if the receipt is cancelled, otherwise false (interesting if the receipt type is NY (receipt)) -->
<stornozottNyugtaszam>NYGT-2017-100</stornozottNyugtaszam> <!-- string --> <!-- If the receipt is cancelled, then the ID of the cancelled receipt (shows which receipt was cancelled in case of SN ("receipt cancellation") type) -->
<kelt>2015-12-01</kelt> <!-- REQ date --> <!-- date of the receipt -->
<fizmod>cash</fizmod> <!-- REQ string -->
<penznem>EUR</penznem> <!-- REQ string --> <!-- empty, Ft, HUF, EUR, CHF, USD, ... -->
<devizabank></devizabank> <!-- string -->
<devizaarf>210</devizaarf> <!-- double -->
<megjegyzes></megjegyzes> <!-- string -->
<fokonyvVevo></fokonyvVevo> <!-- string --> <!-- accounting information -->
<teszt>false</teszt> <!-- REQ boolean --> <!-- The receipt was created by a test company (true) or a real company (false)-->
</alap>

<tetelek>
<tetel>
<azonosito></azonosito> <!-- string --> <!-- item ID -->
<megnevezes>Kitten doormat</megnevezes> <!-- REQ string --> <!-- item name -->
<mennyiseg>2.0</mennyiseg> <!-- REQ double --> <!-- item quantity -->
<mennyisegiEgyseg>db</mennyisegiEgyseg> <!-- REQ string --> <!-- unit of quantity -->
<nettoEgysegar>10000</nettoEgysegar> <!-- REQ double --> <!-- net unit price -->
<netto>20000.0</netto> <!-- REQ double --> <!-- item net value (net unit price * item quantity) -->
<afakulcs>27</afakulcs> <!-- REQ double --> <!-- VAT rate, values: `TEHK` : Outside the scope of Hungarian VAT, `TAHK` : Not subject to VAT , `TAM` : supply exempt from VAT / exempt supply, `AAM` : person exempt from VAT / exempt person, `EUT` : Within EU (former 'EU'), `EUKT` : Outside EU (former 'EUK'), `MAA` : exempt from tax, `F.AFA` : reverse VAT, `K.AFA` : differential VAT, HO, EUE, EUFADE, EUFAD37, ATK, NAM, EAM, KBAUK, KBAET (translation WIP), `0, 5, 7, 18, 19, 20, 25, 27` : exact VAT rate -->
<afa>5400.0</afa> <!-- REQ double --> <!-- VAT total value -->
<brutto>25400.0</brutto> <!-- REQ double --> <!-- gross total value -->
<fokonyv> <!-- --> <!-- general ledger information -->
<arbevetel></arbevetel> <!-- string --> <!-- sales general ledger ID -->
<afa></afa> <!-- string --> <!-- VAT general ledger ID -->
</fokonyv>
</tetel>
<tetel>
<megnevezes>Puppy doormat</megnevezes>
<mennyiseg>2.0</mennyiseg>
<mennyisegiEgyseg>db</mennyisegiEgyseg>
<nettoEgysegar>10000</nettoEgysegar>
<nettoErtek>20000.0</nettoErtek>
<afakulcs>27</afakulcs>
<afaErtek>5400.0</afaErtek>
<bruttoErtek>25400.0</bruttoErtek>
</tetel>
</tetelek>

<kifizetesek>
<kifizetes>
<fizetoeszkoz>voucher</fizetoeszkoz>
<osszeg>1000.0</osszeg>
<leiras>OTP SZÉP kártya</leiras>
</kifizetes>
<kifizetes>
<fizetoeszkoz>debit card</fizetoeszkoz>
<osszeg>3000.0</osszeg>
</kifizetes>
</kifizetesek>

<osszegek>
<afakulcsossz> <!-- REQ int -->
<afatipus>ÁKK</afatipus> <!-- string --> <!--  `TEHK` : Outside the scope of Hungarian VAT, `TAHK` : Not subject to VAT , `TAM` : supply exempt from VAT / exempt supply, `AAM` : person exempt from VAT / exempt person, `EUT` : Within EU (former 'EU'), `EUKT` : Outside EU (former 'EUK'), `MAA` : exempt from tax, `F.AFA` : reverse VAT, `K.AFA`, HO, EUE, EUFADE, EUFAD37, ATK, NAM, EAM, KBAUK, KBAET (translation WIP) : differential VAT, `0, 5, 7, 18, 19, 20, 25, 27` : exact VAT rate -->
<afakulcs>0</afakulcs> <!-- REQ double -->
<netto>200</netto> <!-- REQ double -->
<afa>54</afa> <!-- REQ double -->
<brutto>254</brutto> <!-- REQ double -->
</afakulcsossz>
<totalossz> <!-- REQ -->
<netto>200</netto> <!-- REQ double -->
<afa>54</afa> <!-- REQ double -->
<brutto>254</brutto> <!-- REQ double -->
</totalossz>
</osszegek>
</nyugta>

</xmlnyugtavalasz>

XML response scheme

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.szamlazz.hu/xmlnyugtavalasz" xmlns:tns="http://www.szamlazz.hu/xmlnyugtavalasz" elementFormDefault="qualified">

<simpleType name="afatipusTipus">
<restriction base="string">
<enumeration value="TAM"></enumeration>
<enumeration value="AAM"></enumeration>
<enumeration value="EU"></enumeration>
<enumeration value="EUK"></enumeration>
<enumeration value="MAA"></enumeration>
<enumeration value="F.AFA"></enumeration>
<enumeration value="K.AFA"></enumeration>
<enumeration value="ÁKK"></enumeration>
<enumeration value="TAHK"></enumeration>
<enumeration value="TEHK"></enumeration>
<enumeration value="EUT"></enumeration>
<enumeration value="EUKT"></enumeration>
<enumeration value="HO"></enumeration>
<enumeration value="EUE"></enumeration>
<enumeration value="EUFADE"></enumeration>
<enumeration value="EUFAD37"></enumeration>
<enumeration value="ATK"></enumeration>
<enumeration value="NAM"></enumeration>
<enumeration value="EAM"></enumeration>
<enumeration value="KBAUK"></enumeration>
<enumeration value="KBAET"></enumeration>
</restriction>
</simpleType>

<simpleType name="nyugtatipusTipus">
<restriction base="string">
<enumeration value="NY"></enumeration> <!-- receipt -->
<enumeration value="SN"></enumeration> <!-- receipt cancellation -->
</restriction>
</simpleType>


<!-- receipt details -->
<complexType name="alapTipus">
<all>
<element name="id" type="int" maxOccurs="1" minOccurs="1"></element>
<element name="hivasAzonosito" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="nyugtaszam" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="tipus" type="tns:nyugtatipusTipus" maxOccurs="1" minOccurs="1"></element>
<element name="stornozott" type="boolean" maxOccurs="1" minOccurs="1"></element>
<element name="stornozottNyugtaszam" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="kelt" type="date" maxOccurs="1" minOccurs="1"></element>
<element name="fizmod" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="penznem" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="devizabank" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="devizaarf" type="double" maxOccurs="1" minOccurs="0"></element>
<element name="megjegyzes" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="fokonyvVevo" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="teszt" type="boolean" maxOccurs="1" minOccurs="1"></element>
</all>
</complexType>

<!-- receipt items -->
<complexType name="fokonyvtetelTipus">
<all>
<element name="arbevetel" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="afa" type="string" maxOccurs="1" minOccurs="0"></element>
</all>
</complexType>
<complexType name="tetelTipus">
<all>
<element name="megnevezes" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="azonosito" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="nettoEgysegar" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="mennyiseg" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="mennyisegiEgyseg" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="netto" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="afatipus" type="tns:afatipusTipus" maxOccurs="1" minOccurs="0"></element>
<element name="afakulcs" maxOccurs="1" minOccurs="1">
<simpleType>
<restriction base="int">
<minInclusive value="0"></minInclusive>
</restriction>
</simpleType>
</element>
<element name="afa" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="brutto" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="fokonyv" type="tns:fokonyvtetelTipus" maxOccurs="1" minOccurs="0"></element>
</all>
</complexType>
<complexType name="tetelekTipus">
<sequence>
<element name="tetel" type="tns:tetelTipus" maxOccurs="unbounded" minOccurs="1"></element>
</sequence>
</complexType>

<!-- summary by VAT rate-->
<complexType name="afakulcsosszTipus">
<all>
<element name="afatipus" type="tns:afatipusTipus" maxOccurs="1" minOccurs="0"></element>
<element name="afakulcs" maxOccurs="1" minOccurs="1">
<simpleType>
<restriction base="int">
<minInclusive value="0"></minInclusive>
</restriction>
</simpleType>
</element>
<element name="netto" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="afa" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="brutto" type="double" maxOccurs="1" minOccurs="1"></element>
</all>
</complexType>
<!-- receipt totam summary -->
<complexType name="totalosszTipus">
<all>
<element name="netto" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="afa" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="brutto" type="double" maxOccurs="1" minOccurs="1"></element>
</all>
</complexType>
<!-- receipt summaries (by VAT rates and total)-->
<complexType name="osszegekTipus">
<sequence>
<element name="afakulcsossz" type="tns:afakulcsosszTipus" maxOccurs="unbounded" minOccurs="1"></element>
<element name="totalossz" type="tns:totalosszTipus" maxOccurs="1" minOccurs="1"></element>
</sequence>
</complexType>

<!-- credit notes -->
<complexType name="kifizetesTipus">
<all>
<element name="fizetoeszkoz" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="osszeg" type="double" maxOccurs="1" minOccurs="1"></element>
<element name="leiras" type="string" maxOccurs="1" minOccurs="0"></element>
</all>
</complexType>
<complexType name="kifizetesekTipus">
<sequence>
<element name="kifizetes" type="tns:kifizetesTipus" maxOccurs="unbounded" minOccurs="1"></element>
</sequence>
</complexType>

<complexType name="nyugtaTipus">
<all>
<element name="alap" type="tns:alapTipus" maxOccurs="1" minOccurs="1"></element>
<element name="tetelek" type="tns:tetelekTipus" maxOccurs="1" minOccurs="1"></element>
<element name="kifizetesek" type="tns:kifizetesekTipus" maxOccurs="1" minOccurs="0"></element>
<element name="osszegek" type="tns:osszegekTipus" maxOccurs="1" minOccurs="1"></element>
</all>
</complexType>

<element name="xmlnyugtavalasz">
<complexType>
<all>
<element name="sikeres" type="boolean" maxOccurs="1" minOccurs="1"></element>
<element name="hibakod" type="int" maxOccurs="1" minOccurs="0"></element>
<element name="hibauzenet" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="nyugtaPdf" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="nyugta" type="tns:nyugtaTipus" maxOccurs="1" minOccurs="0"></element>
</all>
</complexType>
</element>
</schema>