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

> 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.

**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.

- Group: E-invoices
- Endpoint: `POST https://api.1001fx.com/einvoice/createxrechnung`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 3 credits per call
- Ready-made in: Make
- Docs: https://1001fx.com/functions/createxrechnung

## Parameters

- `invoice` (object, required) – Invoice: Invoice data in the model of inputModel (default simple). The API computes all amounts.
  - `type` (enum, optional, one of `invoice`, `creditnote`, `correction`, `prepayment`) – Type: invoice (380, default), creditnote (381), correction (384), prepayment (386) (BT-3).
  - `invoiceNumber` (string, required) – Invoice number: Invoice number (BT-1).
  - `issueDate` (string, required) – Issue date: YYYY-MM-DD (BT-2).
  - `dueDate` (string, optional) – Due date: YYYY-MM-DD (BT-9). Either dueDate or payment.terms.
  - `deliveryDate` (string, optional) – Delivery date: YYYY-MM-DD (BT-72).
  - `servicePeriodStart` (string, optional) – Service period start: YYYY-MM-DD (BT-73).
  - `servicePeriodEnd` (string, optional) – Service period end: YYYY-MM-DD (BT-74).
  - `currency` (string, optional) – Currency: ISO 4217 code, default EUR (BT-5).
  - `buyerReference` (string, optional) – Buyer reference: Leitweg-ID for public authorities, otherwise the reference the buyer gave you (BT-10). Required for XRechnung.
  - `orderReference` (string, optional) – Order reference: Buyer's order number (BT-13).
  - `precedingInvoiceNumber` (string, optional) – Preceding invoice number: Invoice that is corrected or credited (BT-25). Required for type correction.
  - `precedingInvoiceDate` (string, optional) – Preceding invoice date: YYYY-MM-DD (BT-26).
  - `note` (string, optional) – Note: Free text on the invoice (BT-22).
  - `smallBusiness` (boolean, optional) – Small business: Kleinunternehmer § 19 UStG: no VAT, all lines exempt with the required note.
  - `vatExemptionReason` (string, optional) – VAT exemption reason: Reason for exempt or zero VAT (BT-120). Default text for reverseCharge, intraCommunity, export, notSubject and smallBusiness; required for exempt.
  - `paidAmount` (number, optional) – Paid amount: Amount already paid, e.g. a prepayment (BT-113).
  - `seller` (object, required) – Seller: Seller (BG-4).
    - `name` (string, required) – Name: Company or person name (BT-27 / BT-44).
    - `street` (string, optional) – Street: Street and house number (BT-35 / BT-50).
    - `additionalStreet` (string, optional) – Additional street: Second address line (BT-36 / BT-51).
    - `zip` (string, optional) – ZIP: Postal code (BT-38 / BT-53).
    - `city` (string, optional) – City: City (BT-37 / BT-52).
    - `country` (string, required) – Country: ISO 3166-1 country code, e.g. DE (BT-40 / BT-55).
    - `vatId` (string, optional) – VAT ID: VAT identification number, e.g. DE123456789 (BT-31 / BT-48).
    - `taxNumber` (string, optional) – Tax number: Seller only: local tax number (Steuernummer), if there is no VAT ID (BT-32).
    - `registrationNumber` (string, optional) – Registration number: Commercial register number, e.g. HRB 12345 (BT-30 / BT-47).
    - `contactName` (string, optional) – Contact name: Contact person (BT-41 / BT-56). XRechnung requires it for the seller.
    - `phone` (string, optional) – Phone: Contact phone (BT-42 / BT-57). XRechnung requires it for the seller.
    - `email` (string, optional) – Email: Contact email (BT-43 / BT-58). Also used as electronic address if electronicAddress is empty.
    - `electronicAddress` (string, optional) – Electronic address: Address for receiving e-invoices (BT-34 / BT-49), e.g. Peppol ID or Leitweg-ID. Default: email.
    - `electronicAddressScheme` (string, optional) – Electronic address scheme: Scheme of the electronic address (EAS code), e.g. EM (email, default), 9930 (German VAT ID), 0088 (GLN), 0204 (Leitweg-ID).
  - `buyer` (object, required) – Buyer: Buyer (BG-7).
    - `name` (string, required) – Name: Company or person name (BT-27 / BT-44).
    - `street` (string, optional) – Street: Street and house number (BT-35 / BT-50).
    - `additionalStreet` (string, optional) – Additional street: Second address line (BT-36 / BT-51).
    - `zip` (string, optional) – ZIP: Postal code (BT-38 / BT-53).
    - `city` (string, optional) – City: City (BT-37 / BT-52).
    - `country` (string, required) – Country: ISO 3166-1 country code, e.g. DE (BT-40 / BT-55).
    - `vatId` (string, optional) – VAT ID: VAT identification number, e.g. DE123456789 (BT-31 / BT-48).
    - `taxNumber` (string, optional) – Tax number: Seller only: local tax number (Steuernummer), if there is no VAT ID (BT-32).
    - `registrationNumber` (string, optional) – Registration number: Commercial register number, e.g. HRB 12345 (BT-30 / BT-47).
    - `contactName` (string, optional) – Contact name: Contact person (BT-41 / BT-56). XRechnung requires it for the seller.
    - `phone` (string, optional) – Phone: Contact phone (BT-42 / BT-57). XRechnung requires it for the seller.
    - `email` (string, optional) – Email: Contact email (BT-43 / BT-58). Also used as electronic address if electronicAddress is empty.
    - `electronicAddress` (string, optional) – Electronic address: Address for receiving e-invoices (BT-34 / BT-49), e.g. Peppol ID or Leitweg-ID. Default: email.
    - `electronicAddressScheme` (string, optional) – Electronic address scheme: Scheme of the electronic address (EAS code), e.g. EM (email, default), 9930 (German VAT ID), 0088 (GLN), 0204 (Leitweg-ID).
  - `lines` (array<object>, required) – Lines: Invoice lines (BG-25).
    - `name` (string, required) – Name: Item name (BT-153).
    - `description` (string, optional) – Description: Item description (BT-154).
    - `itemNumber` (string, optional) – Item number: Seller's item number (BT-155).
    - `quantity` (number, required) – Quantity: Invoiced quantity (BT-129). Negative for returns.
    - `unit` (string, optional) – Unit: Unit as word (piece, hour, day, month, kg, m, l …) or UN/ECE code (C62, HUR, DAY …), default piece (BT-130).
    - `unitPrice` (number, required) – Unit price: Net price per unit (BT-146).
    - `vatRate` (number, optional) – VAT rate: VAT rate in percent, e.g. 19 or 7 (BT-152). 0 or empty for categories other than standard.
    - `vatCategory` (enum, optional, one of `standard`, `zeroRated`, `exempt`, `reverseCharge`, `intraCommunity`, `export`, `notSubject`) – VAT category: standard (default if vatRate > 0), zeroRated, exempt, reverseCharge, intraCommunity, export, notSubject (BT-151).
    - `discountAmount` (number, optional) – Discount amount: Net discount on this line (BT-136).
    - `discountPercent` (number, optional) – Discount percent: Discount in percent of quantity × unit price (BT-138). Either discountAmount or discountPercent.
    - `discountReason` (string, optional) – Discount reason: Reason for the line discount (BT-139), default Discount.
  - `discounts` (array<object>, optional) – Discounts: Discounts on the whole invoice (BG-20).
    - `reason` (string, required) – Reason: Reason, e.g. Discount or Freight (BT-97 / BT-104).
    - `amount` (number, optional) – Amount: Net amount (BT-92 / BT-99).
    - `percent` (number, optional) – Percent: Percent of the net line total of the same VAT rate (BT-94 / BT-101). Either amount or percent.
    - `vatRate` (number, optional) – VAT rate: VAT rate of the discount or charge (BT-96 / BT-103).
    - `vatCategory` (enum, optional, one of `standard`, `zeroRated`, `exempt`, `reverseCharge`, `intraCommunity`, `export`, `notSubject`) – VAT category: As in the lines (BT-95 / BT-102).
  - `charges` (array<object>, optional) – Charges: Charges on the whole invoice, e.g. freight (BG-21).
    - `reason` (string, required) – Reason: Reason, e.g. Discount or Freight (BT-97 / BT-104).
    - `amount` (number, optional) – Amount: Net amount (BT-92 / BT-99).
    - `percent` (number, optional) – Percent: Percent of the net line total of the same VAT rate (BT-94 / BT-101). Either amount or percent.
    - `vatRate` (number, optional) – VAT rate: VAT rate of the discount or charge (BT-96 / BT-103).
    - `vatCategory` (enum, optional, one of `standard`, `zeroRated`, `exempt`, `reverseCharge`, `intraCommunity`, `export`, `notSubject`) – VAT category: As in the lines (BT-95 / BT-102).
  - `payment` (object, optional) – Payment: Payment instructions (BG-16). XRechnung requires them.
    - `method` (enum, optional, one of `sepaTransfer`, `transfer`, `sepaDirectDebit`, `card`, `cash`, `other`) – Method: sepaTransfer (default with IBAN), transfer, sepaDirectDebit, card, cash, other (BT-81).
    - `iban` (string, optional) – IBAN: Account to pay to (BT-84).
    - `bic` (string, optional) – BIC: BIC of the account (BT-86).
    - `accountName` (string, optional) – Account name: Account holder (BT-85).
    - `reference` (string, optional) – Payment reference: Text for the transfer, default the invoice number (BT-83).
    - `terms` (string, optional) – Payment terms: Payment terms as text (BT-20).
    - `mandateReference` (string, optional) – Mandate reference: SEPA direct debit mandate (BT-89).
    - `creditorId` (string, optional) – Creditor ID: SEPA creditor identifier (BT-90).
    - `debtorIban` (string, optional) – Debtor IBAN: Account that is debited (BT-91).
- `syntax` (enum, optional, one of `ubl`, `cii`, default `ubl`) – Syntax: ubl (default) or cii. Public authorities accept both.
- `inputModel` (enum, optional, one of `simple`, `ubljson`, default `simple`) – Input model: simple (default): flat fields, amounts are computed. ubljson: the UBL JSON of e-invoice-eu, amounts as given.

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

```bash
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."}}'
```
