Invoicing: XML Invoice Export

Modified on Thu, 5 Feb at 3:55 PM

How to save and export invoices in XML format

This guide walks you through the steps to export invoices in different XML Formats.


Current supported formats are:

  1. EN-16931 → UBL 1.3.15 → Peppol BIS Billing 3.0 compliant XML format. 
  2. Facturae (Spain)
  3. Factur-X/ZUGFeRD EN 16931

Before you begin

  • Make sure you are running farmerswife server 7.3.
  • You also need a license with the XML Invoice flag enabled. Contact sales@farmerswife.com.

Step-by-step instructions

Step 1: Configure necessary Invoice Custom Fields (Server Side)

If you are a cloud hosted client please email the below table filled in with the values to support@farmerswife.com


Minimum requirement:

  • E-Invoice Currency; Type: Selector; ISO 3digit standards


    Step 2: Prepare your invoice contacts with the necessary fields
    Configure the below Contact Customfields. They should be with "Company Relation" so all contacts belonging to a Company have the fields applied.
    • E-Invoice Buyer Name (The legal name of the buyer company)
    • E-Invoice Buyer Endpoint ID (A unique electronic address identifying the buyer in an e-invoicing network)
    • E-Invoice Buyer Endpoint Scheme (Defines which identification system is used for the Endpoint ID)
    • E-Invoice Buyer Street
    • E-Invoice Buyer City
    • E-Invoice Buyer Postal Zone
    • E-Invoice Buyer Country Code Country codes in an invoice MUST be coded using ISO code list 3166-1
    • E-Invoice Buyer Identifier (NIF/NIE/CIF/VAT ID)

        Step 3: Enable E-Invoice

  1. As Admin User go to Toolbox > Settings > Server Setup > "Enable E-Invoice" checkbox
  2. Configure the XML Invoice Supplier data:


Prepare the Invoice

  1. Open Invoice Creator.

  2. Create or open an invoice.

  3. Select a Contact in the Your Ref field.



    If Contact Custom Field have been configured correctly, the corresponding Invoice Custom Field for currency will be automatically populated with the buyer/customer information.

  4. Click OK to save the invoice


Export the Invoice

  • Open Invoice Creator or Invoice Manager.

  • Select one or multiple invoices.

  • Right-click on the invoice column.

  • Choose one of the following options:

    1. Save E-Invoice XML

    2. Save Factur-X / ZUGFeRD PDF



      Supports credit notes by using the "InvoiceTypeCode" 381 + the farmerswife credited invoice number as the E-Invoice BillingReference data.

Save the File


After selecting an export option:

  1. A Save File dialog appears.

  2. Choose the destination folder.

  3. Save the file.


Troubleshooting

Custom Fields Mapping Behavior

  • Make sure all required Contact Custom Fields are properly configured.

  • The XML exporter always uses the Contact Custom Fields as the source of buyer/customer data.

  • Invoice Custom Fields are not required for the export, with the exception of Currency, which must be present at invoice level.

  • Any values shown in the Invoice UI are for display purposes only.


What Happens If the Field Names Do Not Match


If an Invoice Custom Field is added and its name does not exactly match the corresponding Contact Custom Field (for example, a typo such as Buyer Name → Buyer Names):

  • The value will not be displayed in the Invoice UI.

  • This is expected behavior.

  • The XML export will still work correctly, as all buyer/customer data is read directly from the Contact Custom Fields, not from the Invoice Custom Fields.


Best Practices

  • Treat Contact Custom Fields as the single source of truth for E-Invoice exports.

  • Use Invoice Custom Fields only for visual reference, not as mandatory export data (except for Currency).



Useful links:

Used the following validators in dev: 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article