Building the request and the XML
This page is the technical reference of the action-agent_ceg_mb request: the request parameters, the XML blocks and fields, and the example XML with the XSD. For the overview of the flow and the prerequisites, see Establish the connection via API.
Building the request
The technical parameters of the request are the same as for other Számla Agent calls:
- URL:
https://www.szamlazz.hu/szamla/ - Method: POST
- Content type:
multipart/form-data - Form field name:
action-agent_ceg_mb - File content: the supplier company's and the dedicated user's data in XML format (see below)
The request can be submitted with an HTML form like this:
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<body>
<form action="https://www.szamlazz.hu/szamla/" method="post" enctype="multipart/form-data">
<input type="file" name="action-agent_ceg_mb"><br><br>
<input type="submit" name="generate" value="Create supplier account">
</form>
</body>
You can try the same flow here:
Structure of the XML
The root element of the XML is <XmlCegMb>, containing three blocks, in this order:
| Block | Purpose |
|---|---|
<login> | Identifies the calling (delegate) account |
<cegMb> | The supplier company's details - the supplier account is created from these |
<usrMb> | The dedicated user's details - the delegate will invoice in the supplier's account with this user |
Field order in the XML is fixed - do not reorder elements; the system validates the request against the XSD. We recommend validating the XML against the XSD before submitting.
<login> - identifying the delegate
The calling (delegate) account can be identified in two ways: with an Agent key or with a username + password pair. If <szamlaagentkulcs> is filled in, the system uses it for identification - <loginname> and <password> can then be omitted (if you still fill them in, their values are ignored).
| Field | Required | Description |
|---|---|---|
<loginname> | yes* | Login name of the delegate account's user. The user must belong to exactly one account; a multi-account user results in error code 164, wrong credentials in error code 3. |
<password> | yes* | Password of the above user. |
<szamlaagentkulcs> | no | The delegate account's Agent key. The account owner or an administrator can create the key at the bottom of the control panel, in the Számla Agent kulcsok (Agent keys) section; detailed guide: What is the Számla Agent key (API key)? (Hungarian) and the Authentication page. |
* Required only with username + password identification; if <szamlaagentkulcs> is filled in, it can be omitted.
<cegMb> - the supplier company's details
| Field | Required | Description |
|---|---|---|
<cegcompanyname> | yes | The supplier (megbízó) company's name. When a new account is created, this will appear as the seller name on the invoices; for an existing account the system uses the company name stored in the account and this field is not taken over. |
<cegtaxnumber> | yes | The supplier's tax number. The system searches for a live account with this tax number (exact, character-by-character match on the full 13-character tax number): if no such account exists, a new one is created; if one exists, a join request is sent to it. A malformed tax number results in error code 309. |
<cegszamlaszamelotag> | yes | The delegate's invoice number prefix: the invoices issued as a delegate will be numbered with this prefix (e.g. MBSZ-2026-1) and go into a separate ledger from the supplier's own invoices. The ledger is created when the supplier accepts the request. Format: max. 5 characters, uppercase letters and digits only (a malformed prefix results in error code 337, a missing prefix in error code 7); see Prefix handling. |
<cegirsz>, <cegcity>, <cegaddr> | yes | The supplier's registered address: postal code, city, street address. |
<cegpostirsz>, <cegpostcity>, <cegpostaddr> | no | Mailing address, if different from the registered address. |
<cegbank>, <cegbankaccount> | yes** | The supplier's bank name and bank account number; these appear on the invoices. If sent empty, no bank account data is created in the account. |
<cegemail> | yes | The supplier company's valid, live email address: when a new account is created, the activation (account-owner invitation) email is sent here. For an existing account this field is not used: the notification goes to the email address(es) stored in the existing account. |
<cegemailreplyto> | yes** | This will be the reply-to address in the invoice notification emails. If sent empty, the system uses the account's szamlazz.hu email address, or failing that the account owner's email address, as the reply-to address. |
<cegpenzforgdattol>, <cegpenzforgdatig> | no | Period of cash accounting (YYYY-MM-DD). Provide these if the supplier opted for cash-basis VAT accounting: in that case the "Pénzforgalmi elszámolás." (cash accounting) indication is mandatory on their invoices, and the system adds it based on this period. The end date can be omitted. Details: Setting the cash accounting period (Hungarian). |
<cegkatadattol>, <cegkatadatig> | no | Period of the small taxpayer (KATA) status (YYYY-MM-DD). The "Kisadózó." (small taxpayer) text is put on the invoice based on these; the indication applies to the old KATA period (valid until 31 August 2022), it is no longer a mandatory element on new-KATA invoices. The end date can be omitted. Details: Removing the "Kisadózó" indication from the invoice (Hungarian). |
** The tag must be present in the XML (the XSD requires it), but its value may be left empty.
<usrMb> - the dedicated user
| Field | Required | Description |
|---|---|---|
<usremail> | yes | The dedicated user's email address, which is also the login name. It cannot be a login name that already exists in the system; a taken name results in error code 101. |
<usrpassword> | yes | The dedicated user's password. At least 8 and at most 128 characters; a shorter password fails the call with error 506, a longer one with error 507. |
<usrvezeteknev> | no | The user's last name. |
<usrkeresztnev> | yes | The user's first name. |
If you connect to multiple suppliers, use a separate <usremail> (a separate dedicated user) for each supplier. If you specify the email address of an already existing user for another supplier, the join request is created for that existing user, and after the acceptance the user has access to multiple accounts - from then on, every Agent call of that user fails with error 164.
Example XML and XSD
- Example XML
- XSD (reference)
<?xml version="1.0" encoding="UTF-8"?>
<XmlCegMb xmlns="http://www.szamlazz.hu/xmlcegmb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.szamlazz.hu/xmlcegmb http://www.szamlazz.hu/docs/xsds/agentmb/xmlcegmb.xsd">
<login>
<!-- This is the user created by the delegate. This user can only access 1 company,
otherwise the login attempt will fail because the system won't be able to decide
which company is that the user wants to access.
A multi-account user results in error code 164; wrong credentials result in error code 3.
-->
<loginname>user</loginname>
<password>passwd</password>
<szamlaagentkulcs>agentkey</szamlaagentkulcs>
</login>
<cegMb>
<!--
Details of the supplier company
-->
<cegcompanyname>Company name Co.</cegcompanyname>
<cegtaxnumber>12345678-1-12</cegtaxnumber>
<cegszamlaszamelotag>MBSZ</cegszamlaszamelotag>
<cegirsz>1117</cegirsz>
<cegcity>Budapest</cegcity>
<cegaddr>Budafoki út 17.</cegaddr>
<cegpostirsz>1121</cegpostirsz>
<cegpostcity>Budapest</cegpostcity>
<cegpostaddr>Pf. 17.</cegpostaddr>
<cegbank>AXA</cegbank>
<cegbankaccount>12345678-12345678</cegbankaccount>
<cegpenzforgdattol>2014-01-01</cegpenzforgdattol>
<cegpenzforgdatig>2014-12-31</cegpenzforgdatig>
<cegkatadattol>2014-01-01</cegkatadattol>
<cegkatadatig>2014-12-31</cegkatadatig>
</cegMb>
<usrMb>
<!-- The dedicated user: after the approval, the delegate will invoice
in the supplier's account with this user. -->
<usrpassword>As6dezh7*K#</usrpassword>
<usrvezeteknev>John</usrvezeteknev>
<usrkeresztnev>Doe</usrkeresztnev>
</usrMb>
</XmlCegMb>
Elements marked with minOccurs="1" are required: the tag must be present in the XML. Elements marked with minOccurs="0" are optional and can be omitted.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.szamlazz.hu/xmlcegmb" xmlns:tns="http://www.szamlazz.hu/xmlcegmb" elementFormDefault="qualified">
<complexType name="usrMbTipus">
<sequence>
<element name="usremail" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="usrpassword" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="usrvezeteknev" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="usrkeresztnev" type="string" maxOccurs="1" minOccurs="1"></element>
</sequence>
</complexType>
<complexType name="loginMbTipus">
<sequence>
<element name="loginname" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="password" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="szamlaagentkulcs" type="string" maxOccurs="1" minOccurs="0"></element>
</sequence>
</complexType>
<complexType name="cegMbTipus">
<sequence>
<element name="cegcompanyname" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegtaxnumber" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegszamlaszamelotag" maxOccurs="1" minOccurs="1">
<simpleType>
<restriction base="string"><maxLength value = "5"/></restriction>
</simpleType>
</element>
<element name="cegirsz" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegcity" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegaddr" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegpostirsz" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="cegpostcity" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="cegpostaddr" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="cegbank" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegbankaccount" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegemail" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegemailreplyto" type="string" maxOccurs="1" minOccurs="1"></element>
<element name="cegpenzforgdattol" type="date" maxOccurs="1" minOccurs="0"></element>
<element name="cegpenzforgdatig" type="date" maxOccurs="1" minOccurs="0"></element>
<element name="cegkatadattol" type="date" maxOccurs="1" minOccurs="0"></element>
<element name="cegkatadatig" type="date" maxOccurs="1" minOccurs="0"></element>
</sequence>
</complexType>
<element name="XmlCegMb">
<complexType>
<sequence>
<element name="login" type="tns:loginMbTipus" maxOccurs="1" minOccurs="1"></element>
<element name="cegMb" type="tns:cegMbTipus" maxOccurs="1" minOccurs="1"></element>
<element name="usrMb" type="tns:usrMbTipus" maxOccurs="1" minOccurs="1"></element>
</sequence>
</complexType>
</element>
</schema>
Next step
Once you have submitted the request, read what happens next: After submission: the different cases and the supplier's tasks.