Tax Filing Service

<back to all web services

CreateZm2022XmlAsync

AsyncUmsatzsteuerZusammenfassende Meldung

An asynchronous service to create xml content that represents a recapitulative tax declaration for 2022.

Requires Authentication
The following routes are available for this service:
POST/CreateZm2022XmlAsyncAn asynchronous service to create xml content that represents a recapitulative tax declaration for 2022.
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


/** @description Angaben zum Unternehmen */
// @Api(Description="Angaben zum Unternehmen")
class Anschrift implements JsonSerializable
{
    public function __construct(
        /** @description Der Name des Unternehmers. */
        // @ApiMember(Description="Der Name des Unternehmers.", IsRequired=true, Name="Name")
        /** @var string */
        public string $name='',

        /** @description Der Adresszusatz des Unternehmers. */
        // @ApiMember(Description="Der Adresszusatz des Unternehmers.", Name="Adresszusatz")
        /** @var string|null */
        public ?string $adresszusatz=null,

        /** @description Der Straßenname des Unternehmers. */
        // @ApiMember(Description="Der Straßenname des Unternehmers.", IsRequired=true, Name="Strasse")
        /** @var string */
        public string $strasse='',

        /** @description Die Hausnummer des Unternehmers. */
        // @ApiMember(Description="Die Hausnummer des Unternehmers.", Name="Hausnr")
        /** @var string|null */
        public ?string $hausnr=null,

        /** @description Der Hausnummerzusatz des Unternehmers. */
        // @ApiMember(Description="Der Hausnummerzusatz des Unternehmers.", Name="Hausnrzusatz")
        /** @var string|null */
        public ?string $hausnrzusatz=null,

        /** @description Der Ort des Unternehmers. */
        // @ApiMember(Description="Der Ort des Unternehmers.", IsRequired=true, Name="Ort")
        /** @var string */
        public string $ort='',

        /** @description Die Postleitzahl des Unternehmers. */
        // @ApiMember(Description="Die Postleitzahl des Unternehmers.", Name="PLZ")
        /** @var string|null */
        public ?string $plz=null,

        /** @description Übermittlung des ISO-3166-Alpha-2-Codes des Staates von Unternehmer. */
        // @ApiMember(Description="Übermittlung des ISO-3166-Alpha-2-Codes des Staates von Unternehmer.", IsRequired=true, Name="Staat")
        /** @var string */
        public string $staat='',

        /** @description Die Telefonummer des Unternehmers. */
        // @ApiMember(Description="Die Telefonummer des Unternehmers.", Name="Telefon")
        /** @var string|null */
        public ?string $telefon=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['adresszusatz'])) $this->adresszusatz = $o['adresszusatz'];
        if (isset($o['strasse'])) $this->strasse = $o['strasse'];
        if (isset($o['hausnr'])) $this->hausnr = $o['hausnr'];
        if (isset($o['hausnrzusatz'])) $this->hausnrzusatz = $o['hausnrzusatz'];
        if (isset($o['ort'])) $this->ort = $o['ort'];
        if (isset($o['plz'])) $this->plz = $o['plz'];
        if (isset($o['staat'])) $this->staat = $o['staat'];
        if (isset($o['telefon'])) $this->telefon = $o['telefon'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->adresszusatz)) $o['adresszusatz'] = $this->adresszusatz;
        if (isset($this->strasse)) $o['strasse'] = $this->strasse;
        if (isset($this->hausnr)) $o['hausnr'] = $this->hausnr;
        if (isset($this->hausnrzusatz)) $o['hausnrzusatz'] = $this->hausnrzusatz;
        if (isset($this->ort)) $o['ort'] = $this->ort;
        if (isset($this->plz)) $o['plz'] = $this->plz;
        if (isset($this->staat)) $o['staat'] = $this->staat;
        if (isset($this->telefon)) $o['telefon'] = $this->telefon;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Die Art der Währung */
enum Waehrung : string
{
    case UNGUELTIG = 'UNGUELTIG';
    case EUR = 'EUR';
}

/** @description Art der Meldung */
enum Meldeart : int
{
    case Nein = 10;
    case Ja = 11;
}

/** @description Die Art des Quartals */
enum Quart : int
{
    case Q1 = 1;
    case Q2 = 2;
    case Q3 = 3;
    case Q4 = 4;
    case JM = 5;
    case M11 = 11;
    case M12 = 12;
    case M13 = 13;
    case M14 = 14;
    case M21 = 21;
    case M22 = 22;
    case M23 = 23;
    case M24 = 24;
    case M25 = 25;
    case M26 = 26;
    case M27 = 27;
    case M28 = 28;
    case M29 = 29;
    case M30 = 30;
    case M31 = 31;
    case M32 = 32;
}

/** @description Meldungszeitraum */
// @Api(Description="Meldungszeitraum")
class Mzr implements JsonSerializable
{
    public function __construct(
        /** @description Quartal */
        // @ApiMember(Description="Quartal", IsRequired=true, Name="Quart")
        /** @var Quart|null */
        public ?Quart $quart=null,

        /** @description Die 4-stellige Jahreszahl, welche die Veranlagungszeitraum darstellt. */
        // @ApiMember(Description="Die 4-stellige Jahreszahl, welche die Veranlagungszeitraum darstellt.", IsRequired=true, Name="Jahr")
        /** @var int */
        public int $jahr=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['quart'])) $this->quart = JsonConverters::from('Quart', $o['quart']);
        if (isset($o['jahr'])) $this->jahr = $o['jahr'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->quart)) $o['quart'] = JsonConverters::to('Quart', $this->quart);
        if (isset($this->jahr)) $o['jahr'] = $this->jahr;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Die Art des Umsatzes. */
enum Umsatzart : string
{
    case D = 'D';
    case L = 'L';
    case S = 'S';
}

/** @description Specifies an amount of money without cents with limits and a specialized string representation */
// @Api(Description="Specifies an amount of money without cents with limits and a specialized string representation")
class GrossGeldBetragOhneCent implements JsonSerializable
{
    public function __construct(
        /** @description The intrinsic currency value. */
        // @ApiMember(Description="The intrinsic currency value.")
        /** @var int */
        public int $wert=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['wert'])) $this->wert = $o['wert'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->wert)) $o['wert'] = $this->wert;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Represents an amount of money without cents whose value has a maximum length of 11 digits. That is, 1 to 11 digits. Minus sign allowed. */
// @Api(Description="Represents an amount of money without cents whose value has a maximum length of 11 digits. That is, 1 to 11 digits. Minus sign allowed.")
class GeldBetragOhneCent11EN extends GrossGeldBetragOhneCent implements JsonSerializable
{
    /**
     * @param int $wert
     */
    public function __construct(
        int $wert=0
    ) {
        parent::__construct($wert);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['wert'])) $this->wert = $o['wert'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->wert)) $o['wert'] = $this->wert;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Meldung der Warenlieferungen */
// @Api(Description="Meldung der Warenlieferungen")
class Zeile implements JsonSerializable
{
    public function __construct(
        /** @description Umsatzart */
        // @ApiMember(Description="Umsatzart", IsRequired=true, Name="Umsatzart")
        /** @var Umsatzart|null */
        public ?Umsatzart $umsatzart=null,

        /** @description Umsatzsteuer-Identifikationsnummer des Erwerbers / Unternehmers in einem anderen Mitgliedstaat */
        // @ApiMember(Description="Umsatzsteuer-Identifikationsnummer des Erwerbers / Unternehmers in einem anderen Mitgliedstaat", IsRequired=true, Name="Knre")
        /** @var string */
        public string $knre='',

        /** @description Summe (Euro) */
        // @ApiMember(Description="Summe (Euro)", IsRequired=true, Name="Betrag")
        /** @var GeldBetragOhneCent11EN|null */
        public ?GeldBetragOhneCent11EN $betrag=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['umsatzart'])) $this->umsatzart = JsonConverters::from('Umsatzart', $o['umsatzart']);
        if (isset($o['knre'])) $this->knre = $o['knre'];
        if (isset($o['betrag'])) $this->betrag = JsonConverters::from('GeldBetragOhneCent11EN', $o['betrag']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->umsatzart)) $o['umsatzart'] = JsonConverters::to('Umsatzart', $this->umsatzart);
        if (isset($this->knre)) $o['knre'] = $this->knre;
        if (isset($this->betrag)) $o['betrag'] = JsonConverters::to('GeldBetragOhneCent11EN', $this->betrag);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Allgemeine Daten */
// @Api(Description="Allgemeine Daten")
class ZmZeilen implements JsonSerializable
{
    public function __construct(
        /** @description Währung */
        // @ApiMember(Description="Währung", IsRequired=true, Name="Waehrung")
        /** @var Waehrung|null */
        public ?Waehrung $waehrung=null,

        /** @description Berichtigte Meldung */
        // @ApiMember(Description="Berichtigte Meldung", IsRequired=true, Name="Meldeart")
        /** @var Meldeart|null */
        public ?Meldeart $meldeart=null,

        /** @description Die in § 18a Absatz 1 Satz 2 UStG enthaltene Regelung nehme ich nicht in Anspruch.  Ich gebe die Zusammenfassende Meldung künftig monatlich ab. Diese Anzeige bindet mich bis zum Zeitpunkt des Widerrufs, mindestens aber für die Dauer von 12 Kalendermonaten. */
        // @ApiMember(Description="Die in § 18a Absatz 1 Satz 2 UStG enthaltene Regelung nehme ich nicht in Anspruch.  Ich gebe die Zusammenfassende Meldung künftig monatlich ab. Diese Anzeige bindet mich bis zum Zeitpunkt des Widerrufs, mindestens aber für die Dauer von 12 Kalendermonaten.", IsRequired=true, Name="Meldeart")
        /** @var bool|null */
        public ?bool $anzeige=null,

        /** @description Widerruf meiner Anzeige nach § 18a Absatz 1 UStG */
        // @ApiMember(Description="Widerruf meiner Anzeige nach § 18a Absatz 1 UStG", IsRequired=true, Name="Widerruf")
        /** @var bool|null */
        public ?bool $widerruf=null,

        /** @description Meldungszeitraum */
        // @ApiMember(Description="Meldungszeitraum", IsRequired=true, Name="Mzr")
        /** @var Mzr|null */
        public ?Mzr $mzr=null,

        /** @description Meldungen der Warenlieferungen */
        // @ApiMember(Description="Meldungen der Warenlieferungen", IsRequired=true, Name="Zeilen")
        /** @var array<Zeile>|null */
        public ?array $zeilen=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['waehrung'])) $this->waehrung = JsonConverters::from('Waehrung', $o['waehrung']);
        if (isset($o['meldeart'])) $this->meldeart = JsonConverters::from('Meldeart', $o['meldeart']);
        if (isset($o['anzeige'])) $this->anzeige = $o['anzeige'];
        if (isset($o['widerruf'])) $this->widerruf = $o['widerruf'];
        if (isset($o['mzr'])) $this->mzr = JsonConverters::from('Mzr', $o['mzr']);
        if (isset($o['zeilen'])) $this->zeilen = JsonConverters::fromArray('Zeile', $o['zeilen']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->waehrung)) $o['waehrung'] = JsonConverters::to('Waehrung', $this->waehrung);
        if (isset($this->meldeart)) $o['meldeart'] = JsonConverters::to('Meldeart', $this->meldeart);
        if (isset($this->anzeige)) $o['anzeige'] = $this->anzeige;
        if (isset($this->widerruf)) $o['widerruf'] = $this->widerruf;
        if (isset($this->mzr)) $o['mzr'] = JsonConverters::to('Mzr', $this->mzr);
        if (isset($this->zeilen)) $o['zeilen'] = JsonConverters::toArray('Zeile', $this->zeilen);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Create XML content that represents a recapitulative tax declaration for 2022. */
// @Api(Description="Create XML content that represents a recapitulative tax declaration for 2022.")
class CreateZm2022XmlBase implements IPost, JsonSerializable
{
    public function __construct(
        /** @description Inländische Umsatzsteuer-Identifikationsnummer des Meldenden bestehend aus dem Länderkürzel 'DE' gefolgt von exakt 9 Ziffern. */
        // @ApiMember(Description="Inländische Umsatzsteuer-Identifikationsnummer des Meldenden bestehend aus dem Länderkürzel 'DE' gefolgt von exakt 9 Ziffern.", IsRequired=true)
        /** @var string */
        public string $knri='',

        /** @description Angaben zum Unternehmer */
        // @ApiMember(Description="Angaben zum Unternehmer", IsRequired=true)
        /** @var Anschrift|null */
        public ?Anschrift $anschrift=null,

        /** @description Allgemeine Daten */
        // @ApiMember(Description="Allgemeine Daten", IsRequired=true)
        /** @var ZmZeilen|null */
        public ?ZmZeilen $zmZeilen=null,

        /** @description The details of the provider that submits the tax data. */
        // @ApiMember(Description="The details of the provider that submits the tax data.", IsRequired=true)
        /** @var string */
        public string $datenLieferant=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['knri'])) $this->knri = $o['knri'];
        if (isset($o['anschrift'])) $this->anschrift = JsonConverters::from('Anschrift', $o['anschrift']);
        if (isset($o['zmZeilen'])) $this->zmZeilen = JsonConverters::from('ZmZeilen', $o['zmZeilen']);
        if (isset($o['datenLieferant'])) $this->datenLieferant = $o['datenLieferant'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->knri)) $o['knri'] = $this->knri;
        if (isset($this->anschrift)) $o['anschrift'] = JsonConverters::to('Anschrift', $this->anschrift);
        if (isset($this->zmZeilen)) $o['zmZeilen'] = JsonConverters::to('ZmZeilen', $this->zmZeilen);
        if (isset($this->datenLieferant)) $o['datenLieferant'] = $this->datenLieferant;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Represents the response from a service that generates XML content. */
// @Api(Description="Represents the response from a service that generates XML content.")
class XmlResponse implements JsonSerializable
{
    public function __construct(
        /** @description The XML-based content of the response. */
        // @ApiMember(Description="The XML-based content of the response.")
        /** @var string|null */
        public ?string $content=null,

        /** @description Metadata that contains structured error information on the XML response. */
        // @ApiMember(Description="Metadata that contains structured error information on the XML response.")
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['content'])) $this->content = $o['content'];
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->content)) $o['content'] = $this->content;
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description An asynchronous service to create xml content that represents a recapitulative tax declaration for 2022. */
// @Api(Description="An asynchronous service to create xml content that represents a recapitulative tax declaration for 2022.")
class CreateZm2022XmlAsync extends CreateZm2022XmlBase implements JsonSerializable
{
    /**
     * @param string $knri
     * @param Anschrift|null $anschrift
     * @param ZmZeilen|null $zmZeilen
     * @param string $datenLieferant
     */
    public function __construct(
        string $knri='',
        ?Anschrift $anschrift=null,
        ?ZmZeilen $zmZeilen=null,
        string $datenLieferant=''
    ) {
        parent::__construct($knri,$anschrift,$zmZeilen,$datenLieferant);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['knri'])) $this->knri = $o['knri'];
        if (isset($o['anschrift'])) $this->anschrift = JsonConverters::from('Anschrift', $o['anschrift']);
        if (isset($o['zmZeilen'])) $this->zmZeilen = JsonConverters::from('ZmZeilen', $o['zmZeilen']);
        if (isset($o['datenLieferant'])) $this->datenLieferant = $o['datenLieferant'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->knri)) $o['knri'] = $this->knri;
        if (isset($this->anschrift)) $o['anschrift'] = JsonConverters::to('Anschrift', $this->anschrift);
        if (isset($this->zmZeilen)) $o['zmZeilen'] = JsonConverters::to('ZmZeilen', $this->zmZeilen);
        if (isset($this->datenLieferant)) $o['datenLieferant'] = $this->datenLieferant;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CreateZm2022XmlAsync DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /CreateZm2022XmlAsync HTTP/1.1 
Host: taxfiling.pwc.de 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	knri: String,
	anschrift: 
	{
		name: String,
		adresszusatz: String,
		strasse: String,
		hausnr: String,
		hausnrzusatz: String,
		ort: String,
		plz: String,
		staat: String,
		telefon: String
	},
	zmZeilen: 
	{
		waehrung: UNGUELTIG,
		meldeart: Nein,
		anzeige: False,
		widerruf: False,
		mzr: 
		{
			quart: Q1,
			jahr: 0
		},
		zeilen: 
		[
			{
				umsatzart: D,
				knre: String,
				betrag: 
				{
					wert: 0
				}
			}
		]
	},
	datenLieferant: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	content: String,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}