Skip to content
Browse all functions

Create XRechnung (XML) – E-Invoice for Germany (Experimental)

einvoice/createxrechnung

createxrechnung (Create XRechnung (XML) – E-Invoice for Germany (Experimental)) is a 1001fx API function in the group E-invoices: POST https://api.1001fx.com/einvoice/createxrechnung, 3 credits per call. It works as a ready-made module in Make or as a plain HTTP call.

3 credits per callHTTP APIMake

Experimental – not for production. Output may change without notice; validate results before sending invoices to customers or authorities. Creates an XRechnung 3.0 (E-Rechnung) as XML in UBL or CII syntax from simple invoice data: the API computes line totals, VAT per rate and the invoice totals. For invoices to German public authorities (Leitweg-ID in buyerReference) and B2B. Supports reverse charge, intra-community supply, export, exempt and small business (§ 19 UStG). Store the file yourself; it is not archived by 1001fx.

Try it in the 1001fx app

Run createxrechnung in your browser with your API key – fill the form, click Run and get the answer or the file.

createxrechnung in the 1001fx app: the form with example values
Create XRechnung (XML) – E-Invoice for Germany (Experimental) in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/einvoice/createxrechnung
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json

Parameters

  • invoiceobjectrequired

    Invoice data in the model of inputModel (default simple). The API computes all amounts.

    • typeenumoptional

      invoice (380, default), creditnote (381), correction (384), prepayment (386) (BT-3).

      Values:
      invoice
      creditnote
      correction
      prepayment
    • invoiceNumberstringrequired

      Invoice number (BT-1).

      Example:
      2026-117
    • issueDatestringrequired

      YYYY-MM-DD (BT-2).

      Example:
      2026-11-01
    • dueDatestringoptional

      YYYY-MM-DD (BT-9). Either dueDate or payment.terms.

      Example:
      2026-11-15
    • deliveryDatestringoptional

      YYYY-MM-DD (BT-72).

      Example:
      2026-10-31
    • servicePeriodStartstringoptional

      YYYY-MM-DD (BT-73).

    • servicePeriodEndstringoptional

      YYYY-MM-DD (BT-74).

    • currencystringoptional

      ISO 4217 code, default EUR (BT-5).

      Example:
      EUR
    • buyerReferencestringoptional

      Leitweg-ID for public authorities, otherwise the reference the buyer gave you (BT-10). Required for XRechnung.

      Example:
      04011000-12345-67
    • orderReferencestringoptional

      Buyer's order number (BT-13).

    • precedingInvoiceNumberstringoptional

      Invoice that is corrected or credited (BT-25). Required for type correction.

    • precedingInvoiceDatestringoptional

      YYYY-MM-DD (BT-26).

    • notestringoptional

      Free text on the invoice (BT-22).

    • smallBusinessbooleanoptional

      Kleinunternehmer § 19 UStG: no VAT, all lines exempt with the required note.

    • vatExemptionReasonstringoptional

      Reason for exempt or zero VAT (BT-120). Default text for reverseCharge, intraCommunity, export, notSubject and smallBusiness; required for exempt.

    • paidAmountnumberoptional

      Amount already paid, e.g. a prepayment (BT-113).

    • sellerobjectrequired

      Seller (BG-4).

      • namestringrequired

        Company or person name (BT-27 / BT-44).

        Example:
        Muster GmbH
      • streetstringoptional

        Street and house number (BT-35 / BT-50).

        Example:
        Hauptstr. 1
      • additionalStreetstringoptional

        Second address line (BT-36 / BT-51).

      • zipstringoptional

        Postal code (BT-38 / BT-53).

        Example:
        10115
      • citystringoptional

        City (BT-37 / BT-52).

        Example:
        Berlin
      • countrystringrequired

        ISO 3166-1 country code, e.g. DE (BT-40 / BT-55).

        Example:
        DE
      • vatIdstringoptional

        VAT identification number, e.g. DE123456789 (BT-31 / BT-48).

        Example:
        DE123456789
      • taxNumberstringoptional

        Seller only: local tax number (Steuernummer), if there is no VAT ID (BT-32).

      • registrationNumberstringoptional

        Commercial register number, e.g. HRB 12345 (BT-30 / BT-47).

      • contactNamestringoptional

        Contact person (BT-41 / BT-56). XRechnung requires it for the seller.

        Example:
        Erika Muster
      • phonestringoptional

        Contact phone (BT-42 / BT-57). XRechnung requires it for the seller.

        Example:
        +49 30 123456
      • emailstringoptional

        Contact email (BT-43 / BT-58). Also used as electronic address if electronicAddress is empty.

        Example:
        rechnung@muster.de
      • electronicAddressstringoptional

        Address for receiving e-invoices (BT-34 / BT-49), e.g. Peppol ID or Leitweg-ID. Default: email.

      • electronicAddressSchemestringoptional

        Scheme of the electronic address (EAS code), e.g. EM (email, default), 9930 (German VAT ID), 0088 (GLN), 0204 (Leitweg-ID).

    • buyerobjectrequired

      Buyer (BG-7).

      • namestringrequired

        Company or person name (BT-27 / BT-44).

        Example:
        Muster GmbH
      • streetstringoptional

        Street and house number (BT-35 / BT-50).

        Example:
        Hauptstr. 1
      • additionalStreetstringoptional

        Second address line (BT-36 / BT-51).

      • zipstringoptional

        Postal code (BT-38 / BT-53).

        Example:
        10115
      • citystringoptional

        City (BT-37 / BT-52).

        Example:
        Berlin
      • countrystringrequired

        ISO 3166-1 country code, e.g. DE (BT-40 / BT-55).

        Example:
        DE
      • vatIdstringoptional

        VAT identification number, e.g. DE123456789 (BT-31 / BT-48).

        Example:
        DE123456789
      • taxNumberstringoptional

        Seller only: local tax number (Steuernummer), if there is no VAT ID (BT-32).

      • registrationNumberstringoptional

        Commercial register number, e.g. HRB 12345 (BT-30 / BT-47).

      • contactNamestringoptional

        Contact person (BT-41 / BT-56). XRechnung requires it for the seller.

        Example:
        Erika Muster
      • phonestringoptional

        Contact phone (BT-42 / BT-57). XRechnung requires it for the seller.

        Example:
        +49 30 123456
      • emailstringoptional

        Contact email (BT-43 / BT-58). Also used as electronic address if electronicAddress is empty.

        Example:
        rechnung@muster.de
      • electronicAddressstringoptional

        Address for receiving e-invoices (BT-34 / BT-49), e.g. Peppol ID or Leitweg-ID. Default: email.

      • electronicAddressSchemestringoptional

        Scheme of the electronic address (EAS code), e.g. EM (email, default), 9930 (German VAT ID), 0088 (GLN), 0204 (Leitweg-ID).

    • linesarray<object>required

      Invoice lines (BG-25).

      • namestringrequired

        Item name (BT-153).

        Example:
        Beratung
      • descriptionstringoptional

        Item description (BT-154).

      • itemNumberstringoptional

        Seller's item number (BT-155).

      • quantitynumberrequired

        Invoiced quantity (BT-129). Negative for returns.

        Example:
        10
      • unitstringoptional

        Unit as word (piece, hour, day, month, kg, m, l …) or UN/ECE code (C62, HUR, DAY …), default piece (BT-130).

        Example:
        hour
      • unitPricenumberrequired

        Net price per unit (BT-146).

        Example:
        95
      • vatRatenumberoptional

        VAT rate in percent, e.g. 19 or 7 (BT-152). 0 or empty for categories other than standard.

        Example:
        19
      • vatCategoryenumoptional

        standard (default if vatRate > 0), zeroRated, exempt, reverseCharge, intraCommunity, export, notSubject (BT-151).

        Values:
        standard
        zeroRated
        exempt
        reverseCharge
        intraCommunity
        export
        notSubject
      • discountAmountnumberoptional

        Net discount on this line (BT-136).

      • discountPercentnumberoptional

        Discount in percent of quantity × unit price (BT-138). Either discountAmount or discountPercent.

      • discountReasonstringoptional

        Reason for the line discount (BT-139), default Discount.

    • discountsarray<object>optional

      Discounts on the whole invoice (BG-20).

      • reasonstringrequired

        Reason, e.g. Discount or Freight (BT-97 / BT-104).

        Example:
        Discount
      • amountnumberoptional

        Net amount (BT-92 / BT-99).

      • percentnumberoptional

        Percent of the net line total of the same VAT rate (BT-94 / BT-101). Either amount or percent.

      • vatRatenumberoptional

        VAT rate of the discount or charge (BT-96 / BT-103).

        Example:
        19
      • vatCategoryenumoptional

        As in the lines (BT-95 / BT-102).

        Values:
        standard
        zeroRated
        exempt
        reverseCharge
        intraCommunity
        export
        notSubject
    • chargesarray<object>optional

      Charges on the whole invoice, e.g. freight (BG-21).

      • reasonstringrequired

        Reason, e.g. Discount or Freight (BT-97 / BT-104).

        Example:
        Discount
      • amountnumberoptional

        Net amount (BT-92 / BT-99).

      • percentnumberoptional

        Percent of the net line total of the same VAT rate (BT-94 / BT-101). Either amount or percent.

      • vatRatenumberoptional

        VAT rate of the discount or charge (BT-96 / BT-103).

        Example:
        19
      • vatCategoryenumoptional

        As in the lines (BT-95 / BT-102).

        Values:
        standard
        zeroRated
        exempt
        reverseCharge
        intraCommunity
        export
        notSubject
    • paymentobjectoptional

      Payment instructions (BG-16). XRechnung requires them.

      • methodenumoptional

        sepaTransfer (default with IBAN), transfer, sepaDirectDebit, card, cash, other (BT-81).

        Values:
        sepaTransfer
        transfer
        sepaDirectDebit
        card
        cash
        other
      • ibanstringoptional

        Account to pay to (BT-84).

        Example:
        DE02120300000000202051
      • bicstringoptional

        BIC of the account (BT-86).

        Example:
        BYLADEM1001
      • accountNamestringoptional

        Account holder (BT-85).

      • referencestringoptional

        Text for the transfer, default the invoice number (BT-83).

      • termsstringoptional

        Payment terms as text (BT-20).

        Example:
        Zahlbar bis 15.11.2026 ohne Abzug
      • mandateReferencestringoptional

        SEPA direct debit mandate (BT-89).

      • creditorIdstringoptional

        SEPA creditor identifier (BT-90).

      • debtorIbanstringoptional

        Account that is debited (BT-91).

  • syntaxenumoptional

    ubl (default) or cii. Public authorities accept both.

    Values:
    ubl
    cii
    Default:
    ubl
  • inputModelenumoptional

    simple (default): flat fields, amounts are computed. ubljson: the UBL JSON of e-invoice-eu, amounts as given.

    Values:
    simple
    ubljson
    Default:
    simple

Examples

Create XRechnung (XML) – E-Invoice for Germany (Experimental)

Create XRechnung (XML) – E-Invoice for Germany (Experimental)

Input

Expects a json body
{
  "syntax": "ubl",
  "invoice": {
    "type": "invoice",
    "invoiceNumber": "2026-117",
    "issueDate": "2026-11-01",
    "dueDate": "2026-11-15",
    "deliveryDate": "2026-10-31",
    "currency": "EUR",
    "buyerReference": "04011000-12345-67",
    "seller": {
      "name": "Muster GmbH",
      "street": "Hauptstr. 1",
      "zip": "10115",
      "city": "Berlin",
      "country": "DE",
      "vatId": "DE123456789",
      "contactName": "Erika Muster",
      "phone": "+49 30 123456",
      "email": "rechnung@muster.de"
    },
    "buyer": {
      "name": "Kunde AG",
      "street": "Ringstr. 5",
      "zip": "80331",
      "city": "München",
      "country": "DE",
      "vatId": "DE987654321",
      "email": "ap@kunde.de"
    },
    "lines": [
      {
        "name": "Beratung",
        "quantity": 10,
        "unit": "hour",
        "unitPrice": 95,
        "vatRate": 19
      },
      {
        "name": "Fachbuch",
        "quantity": 1,
        "unit": "piece",
        "unitPrice": 40,
        "vatRate": 7
      }
    ],
    "payment": {
      "iban": "DE02120300000000202051",
      "bic": "BYLADEM1001",
      "terms": "Zahlbar bis 15.11.2026 ohne Abzug"
    },
    "note": "Vielen Dank für Ihren Auftrag."
  }
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/einvoice/createxrechnung' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"syntax":"ubl","invoice":{"type":"invoice","invoiceNumber":"2026-117","issueDate":"2026-11-01","dueDate":"2026-11-15","deliveryDate":"2026-10-31","currency":"EUR","buyerReference":"04011000-12345-67","seller":{"name":"Muster GmbH","street":"Hauptstr. 1","zip":"10115","city":"Berlin","country":"DE","vatId":"DE123456789","contactName":"Erika Muster","phone":"+49 30 123456","email":"rechnung@muster.de"},"buyer":{"name":"Kunde AG","street":"Ringstr. 5","zip":"80331","city":"München","country":"DE","vatId":"DE987654321","email":"ap@kunde.de"},"lines":[{"name":"Beratung","quantity":10,"unit":"hour","unitPrice":95,"vatRate":19},{"name":"Fachbuch","quantity":1,"unit":"piece","unitPrice":40,"vatRate":7}],"payment":{"iban":"DE02120300000000202051","bic":"BYLADEM1001","terms":"Zahlbar bis 15.11.2026 ohne Abzug"},"note":"Vielen Dank für Ihren Auftrag."}}'

Try createxrechnung now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.001.11.2026created
Ask 1001fx