E-Rechnung

This page explains how to create electronic invoices (XRechnung or Zugferd) using the Detailed Invoice Model API. It includes field descriptions, data structures, and examples for different payment me

Detailed Invoice Model

See -> Detailed Invoice Model

Structure explained

This is the general structure of each call to create an e-invoice file.

//Main function call
app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Option to choose the profile (xRechnung or Zugferd)

    //Option to save the file as an attachment
  
    //Invoice Header with general data
    
    //Payment Terms
    
    //Depending on the payment terms debitor or creditor information

    //Invoice totals
    
    //Taxes for each tax rate
 
    //Seller information
  
    //Buyer information

    //Item lines with price and quantity information

});

First select the profile that is to be used to create the XML file.

//Option to choose the profile (xRechnung or Zugferd)
type: "XRechnung",
or 
type: "Zugferd",

You can use these options to create an attachment and add it to an existing data record.

//Option to save the file as an attachment
archive: true,                    //enables the archive function
recordId: 20,                     //record that gets the attachemnt
appName: "customerOrder",         //app name for the record id
filename: "Rechnung2024000.xml",  //filename for the attachment
documentTypeId: 1,                //document type of the attachment

The general header data of the invoice is saved in this area. The fields “invoiceNoAsReference” and “referenceOrderNo” are mandatory fields. If no information is available, the invoice number can be used.

//Invoice Header with general data
invoiceNo: "RE2024000",             //invoice number
invoiceDate: "2025-01-01",          //invoice date
currencyCode: "EUR",                //currency
invoiceNoAsReference: "RE2024000",  //invoice reference
actualDeliveryDate: "2025-01-01",   //service date
referenceOrderNo: "PO-12345",       //external order number

The payment terms must be transferred as an array. Depending on the payment type, either a debitor account or creditor account is required.

//Payment Terms
"tradePaymentTerms": [    //this is an array
    {
        "description": "Zahlbar innerhalb 30 Tagen netto",
        "dueDate": "2025-01-31"
    }
],
//Payment Means
"paymentMeans": {
    "paymentCode": "SEPACreditTransfer",     //code for the payment type
    "information": "Überweisung",            //information text
    "identifikationsnummer": "DE02120300000000202051" //identification in the example IBAN    
},

//Only one of the next options is required:

//For SEPADirectDebit the debitorFinancialAccount is required
"debitorFinancialAccount": {
    "iban": "DE02500105170137075030",
    "bic": "GENODEM1GLS"
},
//For SEPACreditTransfer the creditorFinancialAccount is required
"creditorFinancialAccount": {
    "iban": "DE02500105170137075030",
    "bic": "GENODEM1GLS"
},

The invoice totals are shown in this section. The totals are cross-checked against the individual items.

//Invoice totals
"invoiceTotals": {
    "lineTotalAmount": 100,    //net amount of all lines
    "chargeTotalAmount": 0,    //sum of surcharges
    "allowanceTotalAmount": 0, //sum of discounts
    "taxBasisAmount": 100,     //base for tax calculation
    "taxTotalAmount": 19,      //total tax amount
    "grandTotalAmount": 119,   //gross invoice amount
    "totalPrepaidAmount": 0,   //prepaid amount
    "duePayableAmount": 119    //payable amount
},

The control information is transferred in an array. One entry is required for each tax rate.

//Taxes for each tax rate
"applicableTradeTaxes": [    //this is an array
    {
        "basisAmount": 100,    //base for this specific tax calculation
        "percent": 19,         //tax percentage
        "taxAmount": 19,       //tax amount for this specific tax
        "typeCode": "VAT",     //tax type code
        "categoryCode": "S"    //tax category code
    }
],

Necessary information about the seller including identification and contact details.

//Seller information
"seller": {
    "name": "Verkäufer GmbH",
    "postcode": "12345",
    "city": "Berlin",
    "street": "Musterstraße 1",
    "country": "DE"
},
"sellerContact": {
    "name": "Max Mustermann",
    "emailAddress": "max@verkaeufer-gmbh.de",
    "phoneNo": "030123456789"
},
//Required fields the identify the seller 
"sellerTaxRegistrations": [
    {
        "taxRegistrationNo": "DE123456789",    
        "schemeId": "VA"    //type of identification                    
    }
],
"sellerElectronicAddress": [
    {
        "address": "DE123456789",
        "schemeIdentifier": "GermanyVatNumber" //type of identification
    }
],

Necessary information about the buyer including identification.

//Buyer information
"buyer": {
    "name": "Nationaler Kunde AG",
    "postcode": "52062",
    "city": "Aachen",
    "street": "Hauptstraße 1",
    "country": "DE"
},
"buyerElectronicAddress": [
    {
        "address": "DE123456788",
        "schemeIdentifier": "GermanyVatNumber" //type of identification
    }
],

Information on article items on the invoice. If there is an item discount or surcharge, this can be entered here.

//Item lines with price and quantity information
"tradeLineItems": [
        {
            "lineID": "1",                        //our record id
            "name": "Produkt 1",                  //item name
            "description": "Testprodukt",         //longer description
            "unitCode": "C62",                    //quantity Code
            "billedQuantity": 1,                  //billed quantity
            "grossUnitPrice": 119,                //gross unit price
            "netUnitPrice": 100,                  //net unit price
            "taxType": "VAT",                     //type of tax
            "categoryCode": "S",                  //category of tax
            "taxPercent": 19,                     //tax percentage
            "buyerAssignedID": "Fremdbeleg 4711"  //external order number
            //OPTIONAL
            //Line Discount+Surcharge
            "lineDiscount": [
                {
                    "isDiscount": true,            //true = discount / false = surcharge
                    "basisAmount": 100,            //base amount
                    "currency": "EUR",             //currency
                    "actualAmount": 10,            //absolute amount
                    "reason": "Positionsrabatt",   //information text
                    "taxTypeCode": "VAT",          //type of tax
                    "taxCategoryCode": "S",        //category of tax
                    "taxPercent": 19               //tax percentage
                }
            ]
        }
    ]

Examples

National Invoice

International Invoice

Bank transfer with attachment archive

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "type": "XRechnung",
    //Attachment
    "archive": true,
    "recordId": 20,
    "appName": "customerOrder",
    "filename": "Rechnung2024000.xml",
    "documentTypeId": 1,
    //Invoice Header
    "invoiceNo": "RE2024000",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024000",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 100,
        "taxTotalAmount": 19,
        "grandTotalAmount": 119,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 119
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 19,
            "taxAmount": 19,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Direct Debit with attachment archive

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    "archive": true,
    "recordId": 20,
    "appName": "customerOrder",
    "filename": "Rechnung2024002.xml",
    //Invoice Header
    "invoiceNo": "RE2024002",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024002",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPADirectDebit",
        "information": "Lastschrift",
        "identifikationsnummer": "DE02120300000000202051",
        "mandateNumber": "Mandatsnummer"
    },
    //Required for SEPADirectDebit
    "debitorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 100,
        "taxTotalAmount": 19,
        "grandTotalAmount": 119,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 119
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 19,
            "taxAmount": 19,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Invoice with discount

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024005",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024005",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount
    "tradeAllowanceCharges": [
        {
            "isDiscount": true,
            "basisAmount": 100,
            "currency": "EUR",
            "actualAmount": 10,
            "chargePercentage": 10,
            "reason": "Belegrabatt",
            "taxTypeCode": "VAT",
            "taxCategoryCode": "S",
            "taxPercent": 19
        }
    ],
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 10,
        "taxBasisAmount": 90,
        "taxTotalAmount": 17.1,
        "grandTotalAmount": 107.1,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 107.1
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 90,
            "percent": 19,
            "taxAmount": 17.1,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Invoice with line discount

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024008",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024008",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount+Surcharge
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 90,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 90,
        "taxTotalAmount": 17.1,
        "grandTotalAmount": 107.1,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 107.1
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 90,
            "percent": 19,
            "taxAmount": 17.1,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 100,
            "netUnitPrice": 90,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711",
            //Line Discount
            "lineDiscount": [
                {
                    "isDiscount": true,
                    "basisAmount": 100,
                    "currency": "EUR",
                    "actualAmount": 10,
                    "reason": "Positionsrabatt",
                    "taxTypeCode": "VAT",
                    "taxCategoryCode": "S",
                    "taxPercent": 19
                }
            ]
        }
    ]
});

Invoice with surcharge

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024006",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024006",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Surcharge
    "tradeAllowanceCharges": [
        {
            "isDiscount": false,
            "basisAmount": 100,
            "currency": "EUR",
            "actualAmount": 10,
            "chargePercentage": 10,
            "reason": "Aufschlag",
            "taxTypeCode": "VAT",
            "taxCategoryCode": "S",
            "taxPercent": 19
        }
    ],
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 10,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 110,
        "taxTotalAmount": 20.9,
        "grandTotalAmount": 130.9,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 130.9
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 110,
            "percent": 19,
            "taxAmount": 20.9,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Invoice with cash discount

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024007",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024007",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        },
        {
            "dueDays": 7,
            "paymentTermsType": "Skonto",
            "percentage": 4
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount+Surcharge
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 100,
        "taxTotalAmount": 19,
        "grandTotalAmount": 119,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 119
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 19,
            "taxAmount": 19,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Bank Transfer with multiple tax rates

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024001",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024001",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount+Surcharge
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 200,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 200,
        "taxTotalAmount": 26,
        "grandTotalAmount": 226,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 226
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 19,
            "taxAmount": 19,
            "typeCode": "VAT",
            "categoryCode": "S"
        },
        {
            "basisAmount": 100,
            "percent": 7,
            "taxAmount": 7,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Standardprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        },
        {
            "lineID": "2",
            "name": "Produkt 2",
            "description": "Ermäßigt besteuertes Produkt",
            "unitCode": "C62",
            "billedQuantity": 2,
            "grossUnitPrice": 53.50,
            "netUnitPrice": 50,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 7,
            "buyerAssignedID": "Fremdbeleg 4712"
        }
    ]
});

Direct debit with multiple tax rates

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024003",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024003",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPADirectDebit",
        "information": "Lastschrift",
        "identifikationsnummer": "DE02120300000000202051",
        "mandateNumber": "Mandatsnummer"
    },
    //Required for SEPADirectDebit
    "debitorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount+Surcharge
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 200,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 200,
        "taxTotalAmount": 26,
        "grandTotalAmount": 226,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 226
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 19,
            "taxAmount": 19,
            "typeCode": "VAT",
            "categoryCode": "S"
        },
        {
            "basisAmount": 100,
            "percent": 7,
            "taxAmount": 7,
            "typeCode": "VAT",
            "categoryCode": "S"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Nationaler Kunde AG",
        "postcode": "52062",
        "city": "Aachen",
        "street": "Hauptstraße 1",
        "country": "DE"
    },
    "buyerElectronicAddress": [
        {
            "address": "DE123456788",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Standardprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 119,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 19,
            "buyerAssignedID": "Fremdbeleg 4711"
        },
        {
            "lineID": "2",
            "name": "Produkt 2",
            "description": "Ermäßigt besteuertes Produkt",
            "unitCode": "C62",
            "billedQuantity": 2,
            "grossUnitPrice": 53.50,
            "netUnitPrice": 50,
            "taxType": "VAT",
            "categoryCode": "S",
            "taxPercent": 7,
            "buyerAssignedID": "Fremdbeleg 4712"
        }
    ],
});

International bank transfer

app.businessFunction({
  functionName: "ERechnung",
  methodName: "CreateERechnung",
    //Profile
    "Type": "XRechnung",
    //Attachment 
    //Invoice Header
    "invoiceNo": "RE2024004",
    "invoiceDate": "2025-01-01",
    "currencyCode": "EUR",
    "invoiceNoAsReference": "RE2024004",
    "actualDeliveryDate": "2025-01-01",
    "referenceOrderNo": "PO-12345",
    //Payment Terms
    "tradePaymentTerms": [
        {
            "description": "Zahlbar innerhalb 30 Tagen netto",
            "dueDate": "2025-01-31"
        }
    ],
    "paymentMeans": {
        "paymentCode": "SEPACreditTransfer",
        "information": "Überweisung",
        "identifikationsnummer": "DE02120300000000202051"
    },
    //Required for SEPACreditTransfer
    "creditorFinancialAccount": {
        "iban": "DE02500105170137075030",
        "bic": "GENODEM1GLS"
    },
    //Discount+Surcharge
    //Totals
    "invoiceTotals": {
        "lineTotalAmount": 100,
        "chargeTotalAmount": 0,
        "allowanceTotalAmount": 0,
        "taxBasisAmount": 100,
        "taxTotalAmount": 0,
        "grandTotalAmount": 100,
        "totalPrepaidAmount": 0,
        "duePayableAmount": 100
    },
    //Taxes
    "applicableTradeTaxes": [
        {
            "basisAmount": 100,
            "percent": 0,
            "taxAmount": 0,
            "typeCode": "VAT",
            "categoryCode": "AE",
            "taxExemptionReasonCodes": "VATEX_EU_AE",
            "exemptionReason": "Reverse charge"
        }
    ],
    //Seller
    "seller": {
        "name": "Verkäufer GmbH",
        "postcode": "12345",
        "city": "Berlin",
        "street": "Musterstraße 1",
        "country": "DE"
    },
    "sellerContact": {
        "name": "Max Mustermann",
        "emailAddress": "max@verkaeufer-gmbh.de",
        "phoneNo": "030123456789"
    },
    "sellerTaxRegistrations": [
        {
            "taxRegistrationNo": "DE123456789",
            "schemeId": "VA"
        }
    ],
    "sellerElectronicAddress": [
        {
            "address": "DE123456789",
            "schemeIdentifier": "GermanyVatNumber"
        }
    ],
    //Buyer
    "buyer": {
        "name": "Österreichischer Kunde GmbH",
        "postcode": "1010",
        "city": "Wien",
        "street": "Stephansplatz 1",
        "country": "AT"
    },
    "buyerTaxRegistrations": [
        {
            "taxRegistrationNo": "ATU12345678",
            "schemeId": "VA"
        }
    ],
    "buyerElectronicAddress": [
        {
            "address": "ATU12345678",
            "schemeIdentifier": "AustriaVatNumber"
        }
    ],
    //Lines
    "tradeLineItems": [
        {
            "lineID": "1",
            "name": "Produkt 1",
            "description": "Testprodukt",
            "unitCode": "C62",
            "billedQuantity": 1,
            "grossUnitPrice": 100,
            "netUnitPrice": 100,
            "taxType": "VAT",
            "categoryCode": "AE",
            "taxPercent": 0,
            "buyerAssignedID": "Fremdbeleg 4711"
        }
    ]
});

Last updated

Was this helpful?